Average Error: 10.7 → 1.5
Time: 8.3s
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 r832329 = x;
        double r832330 = y;
        double r832331 = z;
        double r832332 = r832330 - r832331;
        double r832333 = t;
        double r832334 = r832332 * r832333;
        double r832335 = a;
        double r832336 = r832335 - r832331;
        double r832337 = r832334 / r832336;
        double r832338 = r832329 + r832337;
        return r832338;
}

double f(double x, double y, double z, double t, double a) {
        double r832339 = y;
        double r832340 = z;
        double r832341 = r832339 - r832340;
        double r832342 = a;
        double r832343 = r832342 - r832340;
        double r832344 = r832341 / r832343;
        double r832345 = t;
        double r832346 = r832344 * r832345;
        double r832347 = x;
        double r832348 = r832346 + r832347;
        return r832348;
}

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.7
Target0.6
Herbie1.5
\[\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.7

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

    \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity3.0

    \[\leadsto x + \frac{y - z}{\frac{a - z}{\color{blue}{1 \cdot t}}}\]
  6. Applied *-un-lft-identity3.0

    \[\leadsto x + \frac{y - z}{\frac{\color{blue}{1 \cdot \left(a - z\right)}}{1 \cdot t}}\]
  7. Applied times-frac3.0

    \[\leadsto x + \frac{y - z}{\color{blue}{\frac{1}{1} \cdot \frac{a - z}{t}}}\]
  8. Applied *-un-lft-identity3.0

    \[\leadsto x + \frac{\color{blue}{1 \cdot \left(y - z\right)}}{\frac{1}{1} \cdot \frac{a - z}{t}}\]
  9. Applied times-frac3.0

    \[\leadsto x + \color{blue}{\frac{1}{\frac{1}{1}} \cdot \frac{y - z}{\frac{a - z}{t}}}\]
  10. Simplified3.0

    \[\leadsto x + \color{blue}{1} \cdot \frac{y - z}{\frac{a - z}{t}}\]
  11. Simplified1.5

    \[\leadsto x + 1 \cdot \color{blue}{\left(\frac{y - z}{a - z} \cdot t\right)}\]
  12. Final simplification1.5

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

Reproduce

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

  :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))))