Average Error: 6.4 → 2.1
Time: 9.5s
Precision: 64
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[\frac{y}{t} \cdot \left(z - x\right) + x\]
x + \frac{y \cdot \left(z - x\right)}{t}
\frac{y}{t} \cdot \left(z - x\right) + x
double f(double x, double y, double z, double t) {
        double r1753 = x;
        double r1754 = y;
        double r1755 = z;
        double r1756 = r1755 - r1753;
        double r1757 = r1754 * r1756;
        double r1758 = t;
        double r1759 = r1757 / r1758;
        double r1760 = r1753 + r1759;
        return r1760;
}

double f(double x, double y, double z, double t) {
        double r1761 = y;
        double r1762 = t;
        double r1763 = r1761 / r1762;
        double r1764 = z;
        double r1765 = x;
        double r1766 = r1764 - r1765;
        double r1767 = r1763 * r1766;
        double r1768 = r1767 + r1765;
        return r1768;
}

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.4
Target2.1
Herbie2.1
\[x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)\]

Derivation

  1. Initial program 6.4

    \[x + \frac{y \cdot \left(z - x\right)}{t}\]
  2. Simplified2.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)}\]
  3. Using strategy rm
  4. Applied fma-udef2.1

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

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

Reproduce

herbie shell --seed 2020025 +o rules:numerics
(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)))