Average Error: 7.3 → 7.2
Time: 4.1s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[y \cdot \left(\left(x - z\right) \cdot t\right)\]
\left(x \cdot y - z \cdot y\right) \cdot t
y \cdot \left(\left(x - z\right) \cdot t\right)
double f(double x, double y, double z, double t) {
        double r308062 = x;
        double r308063 = y;
        double r308064 = r308062 * r308063;
        double r308065 = z;
        double r308066 = r308065 * r308063;
        double r308067 = r308064 - r308066;
        double r308068 = t;
        double r308069 = r308067 * r308068;
        return r308069;
}

double f(double x, double y, double z, double t) {
        double r308070 = y;
        double r308071 = x;
        double r308072 = z;
        double r308073 = r308071 - r308072;
        double r308074 = t;
        double r308075 = r308073 * r308074;
        double r308076 = r308070 * r308075;
        return r308076;
}

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.3
Target3.0
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 (- (* x y) (* z y)) < -3.289691432454229e+212 or 4.136353068354157e+151 < (- (* x y) (* z y))

    1. Initial program 25.5

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied distribute-rgt-out--25.5

      \[\leadsto \color{blue}{\left(y \cdot \left(x - z\right)\right)} \cdot t\]
    4. Applied associate-*l*1.5

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

    if -3.289691432454229e+212 < (- (* x y) (* z y)) < 4.136353068354157e+151

    1. Initial program 1.7

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

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

Reproduce

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