Average Error: 7.3 → 1.6
Time: 14.9s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -3.289691432454229072694311781383736379418 \cdot 10^{212} \lor \neg \left(x \cdot y - z \cdot y \le 4.13635306835415679283981035434619120167 \cdot 10^{151}\right):\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\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 \le -3.289691432454229072694311781383736379418 \cdot 10^{212} \lor \neg \left(x \cdot y - z \cdot y \le 4.13635306835415679283981035434619120167 \cdot 10^{151}\right):\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\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 r386750 = x;
        double r386751 = y;
        double r386752 = r386750 * r386751;
        double r386753 = z;
        double r386754 = r386753 * r386751;
        double r386755 = r386752 - r386754;
        double r386756 = t;
        double r386757 = r386755 * r386756;
        return r386757;
}

double f(double x, double y, double z, double t) {
        double r386758 = x;
        double r386759 = y;
        double r386760 = r386758 * r386759;
        double r386761 = z;
        double r386762 = r386761 * r386759;
        double r386763 = r386760 - r386762;
        double r386764 = -3.289691432454229e+212;
        bool r386765 = r386763 <= r386764;
        double r386766 = 4.136353068354157e+151;
        bool r386767 = r386763 <= r386766;
        double r386768 = !r386767;
        bool r386769 = r386765 || r386768;
        double r386770 = t;
        double r386771 = r386758 - r386761;
        double r386772 = r386770 * r386771;
        double r386773 = r386759 * r386772;
        double r386774 = r386763 * r386770;
        double r386775 = r386769 ? r386773 : r386774;
        return r386775;
}

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.3
Target3.0
Herbie1.6
\[\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 2 regimes
  2. if (- (* x y) (* z y)) < -3.289691432454229e+212 or 4.136353068354157e+151 < (- (* x y) (* z y))

    1. Initial program 25.5

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

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

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

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

    if -3.289691432454229e+212 < (- (* x y) (* z y)) < 4.136353068354157e+151

    1. Initial program 1.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -3.289691432454229072694311781383736379418 \cdot 10^{212} \lor \neg \left(x \cdot y - z \cdot y \le 4.13635306835415679283981035434619120167 \cdot 10^{151}\right):\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \end{array}\]

Reproduce

herbie shell --seed 2019304 
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (if (< t -9.2318795828867769e-80) (* (* y t) (- x z)) (if (< t 2.5430670515648771e83) (* y (* t (- x z))) (* (* y (- x z)) t)))

  (* (- (* x y) (* z y)) t))