Average Error: 6.4 → 6.4
Time: 8.0s
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 r249212 = x;
        double r249213 = y;
        double r249214 = z;
        double r249215 = t;
        double r249216 = r249214 - r249215;
        double r249217 = r249213 * r249216;
        double r249218 = a;
        double r249219 = r249217 / r249218;
        double r249220 = r249212 - r249219;
        return r249220;
}

double f(double x, double y, double z, double t, double a) {
        double r249221 = x;
        double r249222 = y;
        double r249223 = z;
        double r249224 = t;
        double r249225 = r249223 - r249224;
        double r249226 = r249222 * r249225;
        double r249227 = a;
        double r249228 = r249226 / r249227;
        double r249229 = r249221 - r249228;
        return r249229;
}

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.4
Target0.7
Herbie6.4
\[\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)) < -inf.0 or 5.142235024197987e+223 < (* y (- z t))

    1. Initial program 45.4

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

      \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}}\]

    if -inf.0 < (* y (- z t)) < 5.142235024197987e+223

    1. Initial program 0.3

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

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

Reproduce

herbie shell --seed 2019308 
(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)))