Average Error: 7.3 → 7.3
Time: 19.1s
Precision: 64
\[\frac{x \cdot y - \left(z \cdot 9.0\right) \cdot t}{a \cdot 2.0}\]
\[\frac{x \cdot y - t \cdot \left(z \cdot 9.0\right)}{a \cdot 2.0}\]
\frac{x \cdot y - \left(z \cdot 9.0\right) \cdot t}{a \cdot 2.0}
\frac{x \cdot y - t \cdot \left(z \cdot 9.0\right)}{a \cdot 2.0}
double f(double x, double y, double z, double t, double a) {
        double r35443370 = x;
        double r35443371 = y;
        double r35443372 = r35443370 * r35443371;
        double r35443373 = z;
        double r35443374 = 9.0;
        double r35443375 = r35443373 * r35443374;
        double r35443376 = t;
        double r35443377 = r35443375 * r35443376;
        double r35443378 = r35443372 - r35443377;
        double r35443379 = a;
        double r35443380 = 2.0;
        double r35443381 = r35443379 * r35443380;
        double r35443382 = r35443378 / r35443381;
        return r35443382;
}

double f(double x, double y, double z, double t, double a) {
        double r35443383 = x;
        double r35443384 = y;
        double r35443385 = r35443383 * r35443384;
        double r35443386 = t;
        double r35443387 = z;
        double r35443388 = 9.0;
        double r35443389 = r35443387 * r35443388;
        double r35443390 = r35443386 * r35443389;
        double r35443391 = r35443385 - r35443390;
        double r35443392 = a;
        double r35443393 = 2.0;
        double r35443394 = r35443392 * r35443393;
        double r35443395 = r35443391 / r35443394;
        return r35443395;
}

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

Original7.3
Target5.4
Herbie7.3
\[\begin{array}{l} \mathbf{if}\;a \lt -2.090464557976709 \cdot 10^{+86}:\\ \;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;a \lt 2.144030707833976 \cdot 10^{+99}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9.0 \cdot t\right)}{a \cdot 2.0}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right) - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\ \end{array}\]

Derivation

  1. Initial program 7.3

    \[\frac{x \cdot y - \left(z \cdot 9.0\right) \cdot t}{a \cdot 2.0}\]
  2. Using strategy rm
  3. Applied *-commutative7.3

    \[\leadsto \frac{x \cdot y - \color{blue}{t \cdot \left(z \cdot 9.0\right)}}{a \cdot 2.0}\]
  4. Final simplification7.3

    \[\leadsto \frac{x \cdot y - t \cdot \left(z \cdot 9.0\right)}{a \cdot 2.0}\]

Reproduce

herbie shell --seed 2019164 +o rules:numerics
(FPCore (x y z t a)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, I"

  :herbie-target
  (if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))

  (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))