Average Error: 7.7 → 7.6
Time: 3.9s
Precision: 64
\[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\]
\[\frac{x \cdot y - 9 \cdot \left(t \cdot z\right)}{a \cdot 2}\]
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\frac{x \cdot y - 9 \cdot \left(t \cdot z\right)}{a \cdot 2}
double f(double x, double y, double z, double t, double a) {
        double r837842 = x;
        double r837843 = y;
        double r837844 = r837842 * r837843;
        double r837845 = z;
        double r837846 = 9.0;
        double r837847 = r837845 * r837846;
        double r837848 = t;
        double r837849 = r837847 * r837848;
        double r837850 = r837844 - r837849;
        double r837851 = a;
        double r837852 = 2.0;
        double r837853 = r837851 * r837852;
        double r837854 = r837850 / r837853;
        return r837854;
}

double f(double x, double y, double z, double t, double a) {
        double r837855 = x;
        double r837856 = y;
        double r837857 = r837855 * r837856;
        double r837858 = 9.0;
        double r837859 = t;
        double r837860 = z;
        double r837861 = r837859 * r837860;
        double r837862 = r837858 * r837861;
        double r837863 = r837857 - r837862;
        double r837864 = a;
        double r837865 = 2.0;
        double r837866 = r837864 * r837865;
        double r837867 = r837863 / r837866;
        return r837867;
}

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.7
Target5.6
Herbie7.6
\[\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.14403070783397609 \cdot 10^{99}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \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.7

    \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\]
  2. Using strategy rm
  3. Applied associate-*l*7.7

    \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2}\]
  4. Taylor expanded around inf 7.6

    \[\leadsto \frac{\color{blue}{x \cdot y - 9 \cdot \left(t \cdot z\right)}}{a \cdot 2}\]
  5. Final simplification7.6

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

Reproduce

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

  :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 t))) (* a 2)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))

  (/ (- (* x y) (* (* z 9) t)) (* a 2)))