Average Error: 7.3 → 2.8
Time: 7.5s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.55328258726325272230577543266566564437 \cdot 10^{43}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{elif}\;t \le 1.582494453794569229026266071932183024777 \cdot 10^{-64}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -1.55328258726325272230577543266566564437 \cdot 10^{43}:\\
\;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\

\mathbf{elif}\;t \le 1.582494453794569229026266071932183024777 \cdot 10^{-64}:\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\

\end{array}
double f(double x, double y, double z, double t) {
        double r399595 = x;
        double r399596 = y;
        double r399597 = r399595 * r399596;
        double r399598 = z;
        double r399599 = r399598 * r399596;
        double r399600 = r399597 - r399599;
        double r399601 = t;
        double r399602 = r399600 * r399601;
        return r399602;
}

double f(double x, double y, double z, double t) {
        double r399603 = t;
        double r399604 = -1.5532825872632527e+43;
        bool r399605 = r399603 <= r399604;
        double r399606 = y;
        double r399607 = x;
        double r399608 = z;
        double r399609 = r399607 - r399608;
        double r399610 = r399606 * r399609;
        double r399611 = r399610 * r399603;
        double r399612 = 1.5824944537945692e-64;
        bool r399613 = r399603 <= r399612;
        double r399614 = r399609 * r399603;
        double r399615 = r399606 * r399614;
        double r399616 = r399603 * r399606;
        double r399617 = r399616 * r399609;
        double r399618 = r399613 ? r399615 : r399617;
        double r399619 = r399605 ? r399611 : r399618;
        return r399619;
}

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
Herbie2.8
\[\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 t < -1.5532825872632527e+43

    1. Initial program 3.7

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

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

    if -1.5532825872632527e+43 < t < 1.5824944537945692e-64

    1. Initial program 9.9

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

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

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

    if 1.5824944537945692e-64 < t

    1. Initial program 3.2

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

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

      \[\leadsto \color{blue}{y \cdot \left(\left(x - z\right) \cdot t\right)}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt12.8

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot \left(\left(x - z\right) \cdot t\right)\]
    7. Applied associate-*l*12.8

      \[\leadsto \color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(\left(x - z\right) \cdot t\right)\right)}\]
    8. Taylor expanded around inf 3.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.55328258726325272230577543266566564437 \cdot 10^{43}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{elif}\;t \le 1.582494453794569229026266071932183024777 \cdot 10^{-64}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \end{array}\]

Reproduce

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