Average Error: 1.5 → 1.5
Time: 17.1s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[y \cdot \frac{1}{\frac{a}{z - t} - \frac{t}{z - t}} + x\]
x + y \cdot \frac{z - t}{a - t}
y \cdot \frac{1}{\frac{a}{z - t} - \frac{t}{z - t}} + x
double f(double x, double y, double z, double t, double a) {
        double r380295 = x;
        double r380296 = y;
        double r380297 = z;
        double r380298 = t;
        double r380299 = r380297 - r380298;
        double r380300 = a;
        double r380301 = r380300 - r380298;
        double r380302 = r380299 / r380301;
        double r380303 = r380296 * r380302;
        double r380304 = r380295 + r380303;
        return r380304;
}

double f(double x, double y, double z, double t, double a) {
        double r380305 = y;
        double r380306 = 1.0;
        double r380307 = a;
        double r380308 = z;
        double r380309 = t;
        double r380310 = r380308 - r380309;
        double r380311 = r380307 / r380310;
        double r380312 = r380309 / r380310;
        double r380313 = r380311 - r380312;
        double r380314 = r380306 / r380313;
        double r380315 = r380305 * r380314;
        double r380316 = x;
        double r380317 = r380315 + r380316;
        return r380317;
}

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

Original1.5
Target0.5
Herbie1.5
\[\begin{array}{l} \mathbf{if}\;y \lt -8.508084860551241069024247453646278348229 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.894426862792089097262541964056085749132 \cdot 10^{-49}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Initial program 1.5

    \[x + y \cdot \frac{z - t}{a - t}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity1.5

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

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

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

    \[\leadsto x + 1 \cdot \frac{y}{\color{blue}{\frac{a}{z - t} - \frac{t}{z - t}}}\]
  8. Using strategy rm
  9. Applied div-inv1.5

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

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

Reproduce

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

  :herbie-target
  (if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

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