Average Error: 11.0 → 1.5
Time: 17.3s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[x + y \cdot \frac{z - t}{a - t}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
x + y \cdot \frac{z - t}{a - t}
double f(double x, double y, double z, double t, double a) {
        double r39532015 = x;
        double r39532016 = y;
        double r39532017 = z;
        double r39532018 = t;
        double r39532019 = r39532017 - r39532018;
        double r39532020 = r39532016 * r39532019;
        double r39532021 = a;
        double r39532022 = r39532021 - r39532018;
        double r39532023 = r39532020 / r39532022;
        double r39532024 = r39532015 + r39532023;
        return r39532024;
}

double f(double x, double y, double z, double t, double a) {
        double r39532025 = x;
        double r39532026 = y;
        double r39532027 = z;
        double r39532028 = t;
        double r39532029 = r39532027 - r39532028;
        double r39532030 = a;
        double r39532031 = r39532030 - r39532028;
        double r39532032 = r39532029 / r39532031;
        double r39532033 = r39532026 * r39532032;
        double r39532034 = r39532025 + r39532033;
        return r39532034;
}

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
Target1.3
Herbie1.5
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Initial program 11.0

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

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

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

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

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

Reproduce

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

  :herbie-target
  (+ x (/ y (/ (- a t) (- z t))))

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