Average Error: 6.8 → 3.2
Time: 4.2s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.2510353792524261 \cdot 10^{97} \lor \neg \left(y \le 2.38863567504029856 \cdot 10^{103}\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 -1.2510353792524261 \cdot 10^{97} \lor \neg \left(y \le 2.38863567504029856 \cdot 10^{103}\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 r591655 = x;
        double r591656 = y;
        double r591657 = r591655 * r591656;
        double r591658 = z;
        double r591659 = r591658 * r591656;
        double r591660 = r591657 - r591659;
        double r591661 = t;
        double r591662 = r591660 * r591661;
        return r591662;
}

double f(double x, double y, double z, double t) {
        double r591663 = y;
        double r591664 = -1.2510353792524261e+97;
        bool r591665 = r591663 <= r591664;
        double r591666 = 2.3886356750402986e+103;
        bool r591667 = r591663 <= r591666;
        double r591668 = !r591667;
        bool r591669 = r591665 || r591668;
        double r591670 = t;
        double r591671 = r591670 * r591663;
        double r591672 = x;
        double r591673 = z;
        double r591674 = r591672 - r591673;
        double r591675 = r591671 * r591674;
        double r591676 = r591663 * r591674;
        double r591677 = r591670 * r591676;
        double r591678 = r591669 ? r591675 : r591677;
        return r591678;
}

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.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 < -1.2510353792524261e+97 or 2.3886356750402986e+103 < y

    1. Initial program 21.4

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

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

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

    if -1.2510353792524261e+97 < y < 2.3886356750402986e+103

    1. Initial program 2.7

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

      \[\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 -1.2510353792524261 \cdot 10^{97} \lor \neg \left(y \le 2.38863567504029856 \cdot 10^{103}\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 2020020 
(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))