Average Error: 0.3 → 0.2
Time: 53.1s
Precision: 64
\[\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120\]
\[\frac{60}{z - t} \cdot \left(x - y\right) + 120 \cdot a\]
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\frac{60}{z - t} \cdot \left(x - y\right) + 120 \cdot a
double f(double x, double y, double z, double t, double a) {
        double r23522606 = 60.0;
        double r23522607 = x;
        double r23522608 = y;
        double r23522609 = r23522607 - r23522608;
        double r23522610 = r23522606 * r23522609;
        double r23522611 = z;
        double r23522612 = t;
        double r23522613 = r23522611 - r23522612;
        double r23522614 = r23522610 / r23522613;
        double r23522615 = a;
        double r23522616 = 120.0;
        double r23522617 = r23522615 * r23522616;
        double r23522618 = r23522614 + r23522617;
        return r23522618;
}

double f(double x, double y, double z, double t, double a) {
        double r23522619 = 60.0;
        double r23522620 = z;
        double r23522621 = t;
        double r23522622 = r23522620 - r23522621;
        double r23522623 = r23522619 / r23522622;
        double r23522624 = x;
        double r23522625 = y;
        double r23522626 = r23522624 - r23522625;
        double r23522627 = r23522623 * r23522626;
        double r23522628 = 120.0;
        double r23522629 = a;
        double r23522630 = r23522628 * r23522629;
        double r23522631 = r23522627 + r23522630;
        return r23522631;
}

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.3
Target0.2
Herbie0.2
\[\frac{60}{\frac{z - t}{x - y}} + a \cdot 120\]

Derivation

  1. Initial program 0.3

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x - y}{z - t}, 60, 120 \cdot a\right)}\]
  3. Using strategy rm
  4. Applied clear-num0.2

    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{z - t}{x - y}}}, 60, 120 \cdot a\right)\]
  5. Using strategy rm
  6. Applied fma-udef0.2

    \[\leadsto \color{blue}{\frac{1}{\frac{z - t}{x - y}} \cdot 60 + 120 \cdot a}\]
  7. Simplified0.2

    \[\leadsto \color{blue}{\frac{60}{z - t} \cdot \left(x - y\right)} + 120 \cdot a\]
  8. Final simplification0.2

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

Reproduce

herbie shell --seed 2019200 +o rules:numerics
(FPCore (x y z t a)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, B"

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

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