Average Error: 10.8 → 2.8
Time: 15.5s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[x + \left(y - z\right) \cdot \frac{t}{a - z}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
x + \left(y - z\right) \cdot \frac{t}{a - z}
double f(double x, double y, double z, double t, double a) {
        double r508335 = x;
        double r508336 = y;
        double r508337 = z;
        double r508338 = r508336 - r508337;
        double r508339 = t;
        double r508340 = r508338 * r508339;
        double r508341 = a;
        double r508342 = r508341 - r508337;
        double r508343 = r508340 / r508342;
        double r508344 = r508335 + r508343;
        return r508344;
}

double f(double x, double y, double z, double t, double a) {
        double r508345 = x;
        double r508346 = y;
        double r508347 = z;
        double r508348 = r508346 - r508347;
        double r508349 = t;
        double r508350 = a;
        double r508351 = r508350 - r508347;
        double r508352 = r508349 / r508351;
        double r508353 = r508348 * r508352;
        double r508354 = r508345 + r508353;
        return r508354;
}

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.8
Target0.6
Herbie2.8
\[\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 10.8

    \[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity10.8

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

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

    \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t}{a - z}\]
  6. Final simplification2.8

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

Reproduce

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