Average Error: 7.2 → 7.2
Time: 9.4s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[t \cdot \left(y \cdot \left(x - z\right)\right)\]
\left(x \cdot y - z \cdot y\right) \cdot t
t \cdot \left(y \cdot \left(x - z\right)\right)
double f(double x, double y, double z, double t) {
        double r436392 = x;
        double r436393 = y;
        double r436394 = r436392 * r436393;
        double r436395 = z;
        double r436396 = r436395 * r436393;
        double r436397 = r436394 - r436396;
        double r436398 = t;
        double r436399 = r436397 * r436398;
        return r436399;
}

double f(double x, double y, double z, double t) {
        double r436400 = t;
        double r436401 = y;
        double r436402 = x;
        double r436403 = z;
        double r436404 = r436402 - r436403;
        double r436405 = r436401 * r436404;
        double r436406 = r436400 * r436405;
        return r436406;
}

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

Original7.2
Target2.9
Herbie7.2
\[\begin{array}{l} \mathbf{if}\;t \lt -9.231879582886776938073886590448747944753 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.543067051564877116200336808272775217995 \cdot 10^{83}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -0.40957676128964265 or 3.7875514373921516e-60 < y

    1. Initial program 14.0

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified14.0

      \[\leadsto \color{blue}{t \cdot \left(y \cdot \left(x - z\right)\right)}\]
    3. Using strategy rm
    4. Applied associate-*r*3.4

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

    if -0.40957676128964265 < y < 3.7875514373921516e-60

    1. Initial program 2.2

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified2.2

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

    \[\leadsto t \cdot \left(y \cdot \left(x - z\right)\right)\]

Reproduce

herbie shell --seed 2019294 
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (if (< t -9.2318795828867769e-80) (* (* y t) (- x z)) (if (< t 2.5430670515648771e83) (* y (* t (- x z))) (* (* y (- x z)) t)))

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