Average Error: 16.7 → 7.5
Time: 19.7s
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[x + \left(y - \frac{y}{\frac{a - t}{z - t}}\right)\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
x + \left(y - \frac{y}{\frac{a - t}{z - t}}\right)
double f(double x, double y, double z, double t, double a) {
        double r513032 = x;
        double r513033 = y;
        double r513034 = r513032 + r513033;
        double r513035 = z;
        double r513036 = t;
        double r513037 = r513035 - r513036;
        double r513038 = r513037 * r513033;
        double r513039 = a;
        double r513040 = r513039 - r513036;
        double r513041 = r513038 / r513040;
        double r513042 = r513034 - r513041;
        return r513042;
}

double f(double x, double y, double z, double t, double a) {
        double r513043 = x;
        double r513044 = y;
        double r513045 = a;
        double r513046 = t;
        double r513047 = r513045 - r513046;
        double r513048 = z;
        double r513049 = r513048 - r513046;
        double r513050 = r513047 / r513049;
        double r513051 = r513044 / r513050;
        double r513052 = r513044 - r513051;
        double r513053 = r513043 + r513052;
        return r513053;
}

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

Original16.7
Target8.6
Herbie7.5
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt -1.366497088939072697550672266103566343531 \cdot 10^{-7}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \mathbf{elif}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt 1.475429344457723334351036314450840066235 \cdot 10^{-239}:\\ \;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \end{array}\]

Derivation

  1. Initial program 16.7

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

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

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

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

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

Reproduce

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

  :herbie-target
  (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))

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