Average Error: 10.3 → 1.3
Time: 17.6s
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 r28128789 = x;
        double r28128790 = y;
        double r28128791 = z;
        double r28128792 = t;
        double r28128793 = r28128791 - r28128792;
        double r28128794 = r28128790 * r28128793;
        double r28128795 = a;
        double r28128796 = r28128795 - r28128792;
        double r28128797 = r28128794 / r28128796;
        double r28128798 = r28128789 + r28128797;
        return r28128798;
}

double f(double x, double y, double z, double t, double a) {
        double r28128799 = x;
        double r28128800 = y;
        double r28128801 = z;
        double r28128802 = t;
        double r28128803 = r28128801 - r28128802;
        double r28128804 = a;
        double r28128805 = r28128804 - r28128802;
        double r28128806 = r28128803 / r28128805;
        double r28128807 = r28128800 * r28128806;
        double r28128808 = r28128799 + r28128807;
        return r28128808;
}

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

Derivation

  1. Initial program 10.3

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

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

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

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

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

Reproduce

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