Average Error: 7.7 → 3.2
Time: 4.3s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -2.2985124125575807 \cdot 10^{54} \lor \neg \left(y \le 1.9658771592643412 \cdot 10^{-129}\right):\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -2.2985124125575807 \cdot 10^{54} \lor \neg \left(y \le 1.9658771592643412 \cdot 10^{-129}\right):\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r723092 = x;
        double r723093 = y;
        double r723094 = r723092 * r723093;
        double r723095 = z;
        double r723096 = r723095 * r723093;
        double r723097 = r723094 - r723096;
        double r723098 = t;
        double r723099 = r723097 * r723098;
        return r723099;
}

double f(double x, double y, double z, double t) {
        double r723100 = y;
        double r723101 = -2.2985124125575807e+54;
        bool r723102 = r723100 <= r723101;
        double r723103 = 1.9658771592643412e-129;
        bool r723104 = r723100 <= r723103;
        double r723105 = !r723104;
        bool r723106 = r723102 || r723105;
        double r723107 = t;
        double r723108 = r723107 * r723100;
        double r723109 = x;
        double r723110 = z;
        double r723111 = r723109 - r723110;
        double r723112 = r723108 * r723111;
        double r723113 = r723100 * r723111;
        double r723114 = r723107 * r723113;
        double r723115 = r723106 ? r723112 : r723114;
        return r723115;
}

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.7
Target3.0
Herbie3.2
\[\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 2 regimes
  2. if y < -2.2985124125575807e+54 or 1.9658771592643412e-129 < y

    1. Initial program 13.8

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

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

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

    if -2.2985124125575807e+54 < y < 1.9658771592643412e-129

    1. Initial program 2.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -2.2985124125575807 \cdot 10^{54} \lor \neg \left(y \le 1.9658771592643412 \cdot 10^{-129}\right):\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \end{array}\]

Reproduce

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