Average Error: 10.9 → 1.4
Time: 19.5s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\frac{y - z}{a - z} \cdot t + x\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\frac{y - z}{a - z} \cdot t + x
double f(double x, double y, double z, double t, double a) {
        double r1311818 = x;
        double r1311819 = y;
        double r1311820 = z;
        double r1311821 = r1311819 - r1311820;
        double r1311822 = t;
        double r1311823 = r1311821 * r1311822;
        double r1311824 = a;
        double r1311825 = r1311824 - r1311820;
        double r1311826 = r1311823 / r1311825;
        double r1311827 = r1311818 + r1311826;
        return r1311827;
}

double f(double x, double y, double z, double t, double a) {
        double r1311828 = y;
        double r1311829 = z;
        double r1311830 = r1311828 - r1311829;
        double r1311831 = a;
        double r1311832 = r1311831 - r1311829;
        double r1311833 = r1311830 / r1311832;
        double r1311834 = t;
        double r1311835 = r1311833 * r1311834;
        double r1311836 = x;
        double r1311837 = r1311835 + r1311836;
        return r1311837;
}

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

Original10.9
Target0.6
Herbie1.4
\[\begin{array}{l} \mathbf{if}\;t \lt -1.0682974490174067 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.9110949887586375 \cdot 10^{-141}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \end{array}\]

Derivation

  1. Initial program 10.9

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

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

    \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t}\]
  6. Using strategy rm
  7. Applied +-commutative1.4

    \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot t + x}\]
  8. Final simplification1.4

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

Reproduce

herbie shell --seed 2019198 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"

  :herbie-target
  (if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))

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