Average Error: 6.6 → 2.0
Time: 19.9s
Precision: 64
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[x + \frac{z - x}{\frac{t}{y}}\]
x + \frac{y \cdot \left(z - x\right)}{t}
x + \frac{z - x}{\frac{t}{y}}
double f(double x, double y, double z, double t) {
        double r348371 = x;
        double r348372 = y;
        double r348373 = z;
        double r348374 = r348373 - r348371;
        double r348375 = r348372 * r348374;
        double r348376 = t;
        double r348377 = r348375 / r348376;
        double r348378 = r348371 + r348377;
        return r348378;
}

double f(double x, double y, double z, double t) {
        double r348379 = x;
        double r348380 = z;
        double r348381 = r348380 - r348379;
        double r348382 = t;
        double r348383 = y;
        double r348384 = r348382 / r348383;
        double r348385 = r348381 / r348384;
        double r348386 = r348379 + r348385;
        return r348386;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.6
Target2.1
Herbie2.0
\[x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)\]

Derivation

  1. Initial program 6.6

    \[x + \frac{y \cdot \left(z - x\right)}{t}\]
  2. Using strategy rm
  3. Applied associate-/l*6.1

    \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}}\]
  4. Using strategy rm
  5. Applied associate-/r/2.1

    \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z - x\right)}\]
  6. Taylor expanded around 0 6.6

    \[\leadsto x + \color{blue}{\left(\frac{z \cdot y}{t} - \frac{x \cdot y}{t}\right)}\]
  7. Simplified2.0

    \[\leadsto x + \color{blue}{\frac{z - x}{\frac{t}{y}}}\]
  8. Final simplification2.0

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

Reproduce

herbie shell --seed 2019325 
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
  :precision binary64

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

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