Average Error: 7.3 → 7.3
Time: 9.5s
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 r326578 = x;
        double r326579 = y;
        double r326580 = r326578 * r326579;
        double r326581 = z;
        double r326582 = r326581 * r326579;
        double r326583 = r326580 - r326582;
        double r326584 = t;
        double r326585 = r326583 * r326584;
        return r326585;
}

double f(double x, double y, double z, double t) {
        double r326586 = t;
        double r326587 = y;
        double r326588 = x;
        double r326589 = z;
        double r326590 = r326588 - r326589;
        double r326591 = r326587 * r326590;
        double r326592 = r326586 * r326591;
        return r326592;
}

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.2
Herbie7.3
\[\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 3 regimes
  2. if y < -1.1059360982223227e-93 or -2.5266942413063604e-231 < y < -6.330270419009957e-269 or 1.046975531496553e-09 < y

    1. Initial program 12.0

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

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

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

    if -1.1059360982223227e-93 < y < -2.5266942413063604e-231

    1. Initial program 1.6

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

      \[\leadsto \color{blue}{t \cdot \left(y \cdot \left(x - z\right)\right)}\]
    3. Using strategy rm
    4. Applied sub-neg1.6

      \[\leadsto t \cdot \left(y \cdot \color{blue}{\left(x + \left(-z\right)\right)}\right)\]
    5. Applied distribute-lft-in1.6

      \[\leadsto t \cdot \color{blue}{\left(y \cdot x + y \cdot \left(-z\right)\right)}\]
    6. Applied distribute-lft-in1.6

      \[\leadsto \color{blue}{t \cdot \left(y \cdot x\right) + t \cdot \left(y \cdot \left(-z\right)\right)}\]
    7. Simplified1.6

      \[\leadsto \color{blue}{t \cdot \left(x \cdot y\right)} + t \cdot \left(y \cdot \left(-z\right)\right)\]
    8. Simplified1.6

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

    if -6.330270419009957e-269 < y < 1.046975531496553e-09

    1. Initial program 2.4

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

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

      \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot \left(x - z\right)}\]
    5. Using strategy rm
    6. Applied associate-*l*2.4

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

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

Reproduce

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