mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	Introduce a simple binary that can run arbitrary input against any of
the available implementations (musl, MPFR, our libm). This provides an
easy way to check results, or run specific cases against a debugger.
Examples:
    $ cargo run -p util -- eval libm pow 1.6 2.4
    3.089498284311124
    $ cargo run -p util -- eval mpfr pow 1.6 2.4
    3.089498284311124
    $ cargo run -p util -- eval musl tgamma 1.2344597839132
    0.9097442657960874
    $ cargo run -p util -- eval mpfr tgamma 1.2344597839132
    0.9097442657960874
    $ cargo run -p util -- eval libm tgamma 1.2344597839132
    0.9097442657960871
    $ cargo run -p util -- eval musl sincos 3.1415926535
    (8.979318433952318e-11, -1.0)
		
	
			
		
			
				
	
	
		
			20 lines
		
	
	
		
			735 B
		
	
	
	
		
			TOML
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			735 B
		
	
	
	
		
			TOML
		
	
	
	
	
	
[package]
 | 
						|
name = "util"
 | 
						|
version = "0.1.0"
 | 
						|
edition = "2021"
 | 
						|
publish = false
 | 
						|
 | 
						|
[features]
 | 
						|
default = ["build-musl", "build-mpfr", "unstable-float"]
 | 
						|
build-musl = ["libm-test/build-musl", "dep:musl-math-sys"]
 | 
						|
build-mpfr = ["libm-test/build-mpfr", "dep:az", "dep:rug"]
 | 
						|
unstable-float = ["libm/unstable-float", "libm-test/unstable-float", "rug?/nightly-float"]
 | 
						|
 | 
						|
[dependencies]
 | 
						|
az = { version = "1.2.1", optional = true }
 | 
						|
libm = { path = "../..", default-features = false }
 | 
						|
libm-macros = { path = "../libm-macros" }
 | 
						|
libm-test = { path = "../libm-test", default-features = false }
 | 
						|
musl-math-sys = { path = "../musl-math-sys", optional = true }
 | 
						|
rug = { version = "1.26.1", optional = true, default-features = false, features = ["float", "std"] }
 |