Average Error: 7.0 → 0.7
Time: 11.7s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -8.141433816661043326794834783742908825251 \cdot 10^{-88}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 9.861951895025929519173533740985910928173 \cdot 10^{-271}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 8.499894008736670624619359618410855566379 \cdot 10^{292}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r435637 = x;
        double r435638 = y;
        double r435639 = r435637 * r435638;
        double r435640 = z;
        double r435641 = r435640 * r435638;
        double r435642 = r435639 - r435641;
        double r435643 = t;
        double r435644 = r435642 * r435643;
        return r435644;
}

double f(double x, double y, double z, double t) {
        double r435645 = x;
        double r435646 = y;
        double r435647 = r435645 * r435646;
        double r435648 = z;
        double r435649 = r435648 * r435646;
        double r435650 = r435647 - r435649;
        double r435651 = -inf.0;
        bool r435652 = r435650 <= r435651;
        double r435653 = t;
        double r435654 = r435653 * r435646;
        double r435655 = r435645 - r435648;
        double r435656 = r435654 * r435655;
        double r435657 = -8.141433816661043e-88;
        bool r435658 = r435650 <= r435657;
        double r435659 = r435653 * r435650;
        double r435660 = 9.86195189502593e-271;
        bool r435661 = r435650 <= r435660;
        double r435662 = 8.49989400873667e+292;
        bool r435663 = r435650 <= r435662;
        double r435664 = r435653 * r435655;
        double r435665 = r435664 * r435646;
        double r435666 = r435663 ? r435659 : r435665;
        double r435667 = r435661 ? r435656 : r435666;
        double r435668 = r435658 ? r435659 : r435667;
        double r435669 = r435652 ? r435656 : r435668;
        return r435669;
}

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.0
Target3.0
Herbie0.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 (- (* x y) (* z y)) < -inf.0 or -8.141433816661043e-88 < (- (* x y) (* z y)) < 9.86195189502593e-271

    1. Initial program 16.8

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Taylor expanded around inf 16.8

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

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

    if -inf.0 < (- (* x y) (* z y)) < -8.141433816661043e-88 or 9.86195189502593e-271 < (- (* x y) (* z y)) < 8.49989400873667e+292

    1. Initial program 0.2

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]

    if 8.49989400873667e+292 < (- (* x y) (* z y))

    1. Initial program 58.5

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

      \[\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)}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y = -\infty:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -8.141433816661043326794834783742908825251 \cdot 10^{-88}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 9.861951895025929519173533740985910928173 \cdot 10^{-271}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 8.499894008736670624619359618410855566379 \cdot 10^{292}:\\ \;\;\;\;t \cdot \left(x \cdot y - z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \end{array}\]

Reproduce

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