Average Error: 6.8 → 0.3
Time: 9.1s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty \lor \neg \left(x \cdot y - z \cdot y \le -2.45676478580699958 \cdot 10^{-247} \lor \neg \left(x \cdot y - z \cdot y \le 1.88712653588383372 \cdot 10^{-270}\right) \land x \cdot y - z \cdot y \le 2.09756000476907307 \cdot 10^{298}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y = -\infty \lor \neg \left(x \cdot y - z \cdot y \le -2.45676478580699958 \cdot 10^{-247} \lor \neg \left(x \cdot y - z \cdot y \le 1.88712653588383372 \cdot 10^{-270}\right) \land x \cdot y - z \cdot y \le 2.09756000476907307 \cdot 10^{298}\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r676997 = x;
        double r676998 = y;
        double r676999 = r676997 * r676998;
        double r677000 = z;
        double r677001 = r677000 * r676998;
        double r677002 = r676999 - r677001;
        double r677003 = t;
        double r677004 = r677002 * r677003;
        return r677004;
}

double f(double x, double y, double z, double t) {
        double r677005 = x;
        double r677006 = y;
        double r677007 = r677005 * r677006;
        double r677008 = z;
        double r677009 = r677008 * r677006;
        double r677010 = r677007 - r677009;
        double r677011 = -inf.0;
        bool r677012 = r677010 <= r677011;
        double r677013 = -2.4567647858069996e-247;
        bool r677014 = r677010 <= r677013;
        double r677015 = 1.8871265358838337e-270;
        bool r677016 = r677010 <= r677015;
        double r677017 = !r677016;
        double r677018 = 2.097560004769073e+298;
        bool r677019 = r677010 <= r677018;
        bool r677020 = r677017 && r677019;
        bool r677021 = r677014 || r677020;
        double r677022 = !r677021;
        bool r677023 = r677012 || r677022;
        double r677024 = r677005 - r677008;
        double r677025 = t;
        double r677026 = r677024 * r677025;
        double r677027 = r677006 * r677026;
        double r677028 = r677010 * r677025;
        double r677029 = r677023 ? r677027 : r677028;
        return r677029;
}

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
Herbie0.3
\[\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 (- (* x y) (* z y)) < -inf.0 or -2.4567647858069996e-247 < (- (* x y) (* z y)) < 1.8871265358838337e-270 or 2.097560004769073e+298 < (- (* x y) (* z y))

    1. Initial program 38.1

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

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

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

    if -inf.0 < (- (* x y) (* z y)) < -2.4567647858069996e-247 or 1.8871265358838337e-270 < (- (* x y) (* z y)) < 2.097560004769073e+298

    1. Initial program 0.2

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty \lor \neg \left(x \cdot y - z \cdot y \le -2.45676478580699958 \cdot 10^{-247} \lor \neg \left(x \cdot y - z \cdot y \le 1.88712653588383372 \cdot 10^{-270}\right) \land x \cdot y - z \cdot y \le 2.09756000476907307 \cdot 10^{298}\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \end{array}\]

Reproduce

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