Average Error: 0.4 → 0.4
Time: 4.3s
Precision: binary64
\[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120\]
\[\frac{60 \cdot x + y \cdot -60}{z - t} + a \cdot 120\]
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\frac{60 \cdot x + y \cdot -60}{z - t} + a \cdot 120
(FPCore (x y z t a)
 :precision binary64
 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
(FPCore (x y z t a)
 :precision binary64
 (+ (/ (+ (* 60.0 x) (* y -60.0)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
	return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
double code(double x, double y, double z, double t, double a) {
	return (((60.0 * x) + (y * -60.0)) / (z - t)) + (a * 120.0);
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.4
Target0.2
Herbie0.4
\[\frac{60}{\frac{z - t}{x - y}} + a \cdot 120\]

Derivation

  1. Initial program 0.4

    \[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120\]
  2. Using strategy rm
  3. Applied sub-neg_binary640.4

    \[\leadsto \frac{60 \cdot \color{blue}{\left(x + \left(-y\right)\right)}}{z - t} + a \cdot 120\]
  4. Applied distribute-lft-in_binary640.4

    \[\leadsto \frac{\color{blue}{60 \cdot x + 60 \cdot \left(-y\right)}}{z - t} + a \cdot 120\]
  5. Simplified0.4

    \[\leadsto \frac{60 \cdot x + \color{blue}{y \cdot -60}}{z - t} + a \cdot 120\]
  6. Final simplification0.4

    \[\leadsto \frac{60 \cdot x + y \cdot -60}{z - t} + a \cdot 120\]

Reproduce

herbie shell --seed 2020220 
(FPCore (x y z t a)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
  :precision binary64

  :herbie-target
  (+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0))

  (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))