Average Error: 6.8 → 3.0
Time: 2.8s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -4.69513401673003213 \cdot 10^{61}:\\ \;\;\;\;\left(x \cdot y + \left(-z \cdot y\right)\right) \cdot t\\ \mathbf{elif}\;t \le 3.1903782997110631 \cdot 10^{59}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(t \cdot y\right) \cdot \left(x - z\right)\right)}^{1}\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -4.69513401673003213 \cdot 10^{61}:\\
\;\;\;\;\left(x \cdot y + \left(-z \cdot y\right)\right) \cdot t\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r529760 = x;
        double r529761 = y;
        double r529762 = r529760 * r529761;
        double r529763 = z;
        double r529764 = r529763 * r529761;
        double r529765 = r529762 - r529764;
        double r529766 = t;
        double r529767 = r529765 * r529766;
        return r529767;
}

double f(double x, double y, double z, double t) {
        double r529768 = t;
        double r529769 = -4.695134016730032e+61;
        bool r529770 = r529768 <= r529769;
        double r529771 = x;
        double r529772 = y;
        double r529773 = r529771 * r529772;
        double r529774 = z;
        double r529775 = r529774 * r529772;
        double r529776 = -r529775;
        double r529777 = r529773 + r529776;
        double r529778 = r529777 * r529768;
        double r529779 = 3.190378299711063e+59;
        bool r529780 = r529768 <= r529779;
        double r529781 = r529771 - r529774;
        double r529782 = r529781 * r529768;
        double r529783 = r529772 * r529782;
        double r529784 = r529768 * r529772;
        double r529785 = r529784 * r529781;
        double r529786 = 1.0;
        double r529787 = pow(r529785, r529786);
        double r529788 = r529780 ? r529783 : r529787;
        double r529789 = r529770 ? r529778 : r529788;
        return r529789;
}

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

Original6.8
Target3.2
Herbie3.0
\[\begin{array}{l} \mathbf{if}\;t \lt -9.2318795828867769 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.5430670515648771 \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 < -4.695134016730032e+61

    1. Initial program 4.1

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied sub-neg4.1

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

    if -4.695134016730032e+61 < t < 3.190378299711063e+59

    1. Initial program 7.9

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

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

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

    if 3.190378299711063e+59 < t

    1. Initial program 4.2

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

      \[\leadsto \left(x \cdot y - z \cdot y\right) \cdot \color{blue}{{t}^{1}}\]
    4. Applied pow14.2

      \[\leadsto \color{blue}{{\left(x \cdot y - z \cdot y\right)}^{1}} \cdot {t}^{1}\]
    5. Applied pow-prod-down4.2

      \[\leadsto \color{blue}{{\left(\left(x \cdot y - z \cdot y\right) \cdot t\right)}^{1}}\]
    6. Simplified4.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -4.69513401673003213 \cdot 10^{61}:\\ \;\;\;\;\left(x \cdot y + \left(-z \cdot y\right)\right) \cdot t\\ \mathbf{elif}\;t \le 3.1903782997110631 \cdot 10^{59}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(t \cdot y\right) \cdot \left(x - z\right)\right)}^{1}\\ \end{array}\]

Reproduce

herbie shell --seed 2020064 +o rules:numerics
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
  :precision binary64

  :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))