Average Error: 2.0 → 0.2
Time: 5.4s
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 r656026 = x;
        double r656027 = y;
        double r656028 = z;
        double r656029 = r656027 - r656028;
        double r656030 = t;
        double r656031 = r656030 - r656028;
        double r656032 = 1.0;
        double r656033 = r656031 + r656032;
        double r656034 = a;
        double r656035 = r656033 / r656034;
        double r656036 = r656029 / r656035;
        double r656037 = r656026 - r656036;
        return r656037;
}

double f(double x, double y, double z, double t, double a) {
        double r656038 = x;
        double r656039 = y;
        double r656040 = z;
        double r656041 = r656039 - r656040;
        double r656042 = t;
        double r656043 = r656042 - r656040;
        double r656044 = 1.0;
        double r656045 = r656043 + r656044;
        double r656046 = r656041 / r656045;
        double r656047 = a;
        double r656048 = r656046 * r656047;
        double r656049 = r656038 - r656048;
        return r656049;
}

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