Average Error: 6.1 → 6.1
Time: 8.1s
Precision: 64
\[x - \frac{y \cdot \left(z - t\right)}{a}\]
\[x - \frac{y \cdot \left(z - t\right)}{a}\]
x - \frac{y \cdot \left(z - t\right)}{a}
x - \frac{y \cdot \left(z - t\right)}{a}
double f(double x, double y, double z, double t, double a) {
        double r245567 = x;
        double r245568 = y;
        double r245569 = z;
        double r245570 = t;
        double r245571 = r245569 - r245570;
        double r245572 = r245568 * r245571;
        double r245573 = a;
        double r245574 = r245572 / r245573;
        double r245575 = r245567 - r245574;
        return r245575;
}

double f(double x, double y, double z, double t, double a) {
        double r245576 = x;
        double r245577 = y;
        double r245578 = z;
        double r245579 = t;
        double r245580 = r245578 - r245579;
        double r245581 = r245577 * r245580;
        double r245582 = a;
        double r245583 = r245581 / r245582;
        double r245584 = r245576 - r245583;
        return r245584;
}

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

Original6.1
Target0.7
Herbie6.1
\[\begin{array}{l} \mathbf{if}\;y \lt -1.07612662163899753216593153715602325729 \cdot 10^{-10}:\\ \;\;\;\;x - \frac{1}{\frac{\frac{a}{z - t}}{y}}\\ \mathbf{elif}\;y \lt 2.894426862792089097262541964056085749132 \cdot 10^{-49}:\\ \;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if (/ (* y (- z t)) a) < -2.5229463530234854e+190 or 1.3317847127302016e-49 < (/ (* y (- z t)) a)

    1. Initial program 14.0

      \[x - \frac{y \cdot \left(z - t\right)}{a}\]
    2. Using strategy rm
    3. Applied clear-num14.1

      \[\leadsto x - \color{blue}{\frac{1}{\frac{a}{y \cdot \left(z - t\right)}}}\]
    4. Using strategy rm
    5. Applied sub-neg14.1

      \[\leadsto \color{blue}{x + \left(-\frac{1}{\frac{a}{y \cdot \left(z - t\right)}}\right)}\]
    6. Simplified3.0

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

    if -2.5229463530234854e+190 < (/ (* y (- z t)) a) < 1.3317847127302016e-49

    1. Initial program 0.4

      \[x - \frac{y \cdot \left(z - t\right)}{a}\]
    2. Using strategy rm
    3. Applied div-inv0.5

      \[\leadsto x - \color{blue}{\left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification6.1

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

Reproduce

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

  :herbie-target
  (if (< y -1.07612662163899753e-10) (- x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2.8944268627920891e-49) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t))))))

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