Average Error: 11.0 → 1.3
Time: 16.7s
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 r480635 = x;
        double r480636 = y;
        double r480637 = z;
        double r480638 = r480636 - r480637;
        double r480639 = t;
        double r480640 = r480638 * r480639;
        double r480641 = a;
        double r480642 = r480641 - r480637;
        double r480643 = r480640 / r480642;
        double r480644 = r480635 + r480643;
        return r480644;
}

double f(double x, double y, double z, double t, double a) {
        double r480645 = y;
        double r480646 = z;
        double r480647 = r480645 - r480646;
        double r480648 = a;
        double r480649 = r480648 - r480646;
        double r480650 = r480647 / r480649;
        double r480651 = t;
        double r480652 = r480650 * r480651;
        double r480653 = x;
        double r480654 = r480652 + r480653;
        return r480654;
}

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.0
Target0.6
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.0

    \[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
  2. Simplified3.2

    \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t}{a - z} + x}\]
  3. Using strategy rm
  4. Applied clear-num3.4

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

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

    \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right) \cdot t} + x\]
  8. Simplified1.3

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

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

Reproduce

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