Average Error: 11.3 → 1.3
Time: 4.9s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[x + \frac{\frac{y - z}{a - z}}{\frac{1}{t}}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
x + \frac{\frac{y - z}{a - z}}{\frac{1}{t}}
double f(double x, double y, double z, double t, double a) {
        double r716728 = x;
        double r716729 = y;
        double r716730 = z;
        double r716731 = r716729 - r716730;
        double r716732 = t;
        double r716733 = r716731 * r716732;
        double r716734 = a;
        double r716735 = r716734 - r716730;
        double r716736 = r716733 / r716735;
        double r716737 = r716728 + r716736;
        return r716737;
}

double f(double x, double y, double z, double t, double a) {
        double r716738 = x;
        double r716739 = y;
        double r716740 = z;
        double r716741 = r716739 - r716740;
        double r716742 = a;
        double r716743 = r716742 - r716740;
        double r716744 = r716741 / r716743;
        double r716745 = 1.0;
        double r716746 = t;
        double r716747 = r716745 / r716746;
        double r716748 = r716744 / r716747;
        double r716749 = r716738 + r716748;
        return r716749;
}

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

Original11.3
Target0.5
Herbie1.3
\[\begin{array}{l} \mathbf{if}\;t \lt -1.068297449017406694366747246993994850729 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.911094988758637497591020599238553861375 \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 11.3

    \[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 div-inv3.0

    \[\leadsto x + \frac{y - z}{\color{blue}{\left(a - z\right) \cdot \frac{1}{t}}}\]
  6. Applied associate-/r*1.3

    \[\leadsto x + \color{blue}{\frac{\frac{y - z}{a - z}}{\frac{1}{t}}}\]
  7. Final simplification1.3

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

Reproduce

herbie shell --seed 2019353 
(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))))