Average Error: 0.4 → 0.1
Time: 8.5s
Precision: binary64
\[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120\]
\[\frac{x - y}{\frac{z - t}{60}} + a \cdot 120\]
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\frac{x - y}{\frac{z - t}{60}} + a \cdot 120
double code(double x, double y, double z, double t, double a) {
	return ((double) (((double) (((double) (60.0 * ((double) (x - y)))) / ((double) (z - t)))) + ((double) (a * 120.0))));
}
double code(double x, double y, double z, double t, double a) {
	return ((double) (((double) (((double) (x - y)) / ((double) (((double) (z - t)) / 60.0)))) + ((double) (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.1
\[\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 associate-/l*0.2

    \[\leadsto \color{blue}{\frac{60}{\frac{z - t}{x - y}}} + a \cdot 120\]
  4. Using strategy rm
  5. Applied associate-/r/0.2

    \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \left(x - y\right)} + a \cdot 120\]
  6. Using strategy rm
  7. Applied clear-num0.2

    \[\leadsto \color{blue}{\frac{1}{\frac{z - t}{60}}} \cdot \left(x - y\right) + a \cdot 120\]
  8. Using strategy rm
  9. Applied associate-*l/0.1

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

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

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

Reproduce

herbie shell --seed 2020147 
(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)))