Average Error: 7.2 → 2.7
Time: 43.3s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -1997863461319427059803765080064:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \le 6.525842968778453615516463397980179254263 \cdot 10^{45}:\\ \;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\left(x - z\right) \cdot y\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -1997863461319427059803765080064:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r25880544 = x;
        double r25880545 = y;
        double r25880546 = r25880544 * r25880545;
        double r25880547 = z;
        double r25880548 = r25880547 * r25880545;
        double r25880549 = r25880546 - r25880548;
        double r25880550 = t;
        double r25880551 = r25880549 * r25880550;
        return r25880551;
}

double f(double x, double y, double z, double t) {
        double r25880552 = t;
        double r25880553 = -1.997863461319427e+30;
        bool r25880554 = r25880552 <= r25880553;
        double r25880555 = y;
        double r25880556 = r25880555 * r25880552;
        double r25880557 = x;
        double r25880558 = z;
        double r25880559 = r25880557 - r25880558;
        double r25880560 = r25880556 * r25880559;
        double r25880561 = 6.525842968778454e+45;
        bool r25880562 = r25880552 <= r25880561;
        double r25880563 = r25880559 * r25880552;
        double r25880564 = r25880563 * r25880555;
        double r25880565 = r25880559 * r25880555;
        double r25880566 = r25880552 * r25880565;
        double r25880567 = r25880562 ? r25880564 : r25880566;
        double r25880568 = r25880554 ? r25880560 : r25880567;
        return r25880568;
}

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
Target3.0
Herbie2.7
\[\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.997863461319427e+30

    1. Initial program 3.5

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

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

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

    if -1.997863461319427e+30 < t < 6.525842968778454e+45

    1. Initial program 8.7

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

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

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

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

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

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

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

    if 6.525842968778454e+45 < t

    1. Initial program 3.8

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

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

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

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

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

Reproduce

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

  :herbie-target
  (if (< t -9.231879582886777e-80) (* (* y t) (- x z)) (if (< t 2.543067051564877e+83) (* y (* t (- x z))) (* (* y (- x z)) t)))

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