Average Error: 2.0 → 0.2
Time: 3.6s
Precision: 64
\[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\]
\[x - \frac{y - z}{\left(t - z\right) + 1} \cdot a\]
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
x - \frac{y - z}{\left(t - z\right) + 1} \cdot a
double f(double x, double y, double z, double t, double a) {
        double r658515 = x;
        double r658516 = y;
        double r658517 = z;
        double r658518 = r658516 - r658517;
        double r658519 = t;
        double r658520 = r658519 - r658517;
        double r658521 = 1.0;
        double r658522 = r658520 + r658521;
        double r658523 = a;
        double r658524 = r658522 / r658523;
        double r658525 = r658518 / r658524;
        double r658526 = r658515 - r658525;
        return r658526;
}

double f(double x, double y, double z, double t, double a) {
        double r658527 = x;
        double r658528 = y;
        double r658529 = z;
        double r658530 = r658528 - r658529;
        double r658531 = t;
        double r658532 = r658531 - r658529;
        double r658533 = 1.0;
        double r658534 = r658532 + r658533;
        double r658535 = r658530 / r658534;
        double r658536 = a;
        double r658537 = r658535 * r658536;
        double r658538 = r658527 - r658537;
        return r658538;
}

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

Original2.0
Target0.2
Herbie0.2
\[x - \frac{y - z}{\left(t - z\right) + 1} \cdot a\]

Derivation

  1. Initial program 2.0

    \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\]
  2. Using strategy rm
  3. Applied associate-/r/0.2

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

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

Reproduce

herbie shell --seed 2020027 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
  :precision binary64

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

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