Average Error: 2.0 → 0.2
Time: 5.5s
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 r621399 = x;
        double r621400 = y;
        double r621401 = z;
        double r621402 = r621400 - r621401;
        double r621403 = t;
        double r621404 = r621403 - r621401;
        double r621405 = 1.0;
        double r621406 = r621404 + r621405;
        double r621407 = a;
        double r621408 = r621406 / r621407;
        double r621409 = r621402 / r621408;
        double r621410 = r621399 - r621409;
        return r621410;
}

double f(double x, double y, double z, double t, double a) {
        double r621411 = x;
        double r621412 = y;
        double r621413 = z;
        double r621414 = r621412 - r621413;
        double r621415 = t;
        double r621416 = r621415 - r621413;
        double r621417 = 1.0;
        double r621418 = r621416 + r621417;
        double r621419 = r621414 / r621418;
        double r621420 = a;
        double r621421 = r621419 * r621420;
        double r621422 = r621411 - r621421;
        return r621422;
}

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 2020039 
(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))))