Average Error: 7.4 → 3.1
Time: 17.0s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -2.67266543104995666758061087259893237368 \cdot 10^{-104} \lor \neg \left(t \le 1.024703379550815433409916260913231061372 \cdot 10^{-28}\right):\\ \;\;\;\;\left(x \cdot y + \left(-y\right) \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -2.67266543104995666758061087259893237368 \cdot 10^{-104} \lor \neg \left(t \le 1.024703379550815433409916260913231061372 \cdot 10^{-28}\right):\\
\;\;\;\;\left(x \cdot y + \left(-y\right) \cdot z\right) \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r350377 = x;
        double r350378 = y;
        double r350379 = r350377 * r350378;
        double r350380 = z;
        double r350381 = r350380 * r350378;
        double r350382 = r350379 - r350381;
        double r350383 = t;
        double r350384 = r350382 * r350383;
        return r350384;
}

double f(double x, double y, double z, double t) {
        double r350385 = t;
        double r350386 = -2.6726654310499567e-104;
        bool r350387 = r350385 <= r350386;
        double r350388 = 1.0247033795508154e-28;
        bool r350389 = r350385 <= r350388;
        double r350390 = !r350389;
        bool r350391 = r350387 || r350390;
        double r350392 = x;
        double r350393 = y;
        double r350394 = r350392 * r350393;
        double r350395 = -r350393;
        double r350396 = z;
        double r350397 = r350395 * r350396;
        double r350398 = r350394 + r350397;
        double r350399 = r350398 * r350385;
        double r350400 = r350392 - r350396;
        double r350401 = r350385 * r350400;
        double r350402 = r350393 * r350401;
        double r350403 = r350391 ? r350399 : r350402;
        return r350403;
}

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.4
Target3.1
Herbie3.1
\[\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 t < -2.6726654310499567e-104 or 1.0247033795508154e-28 < t

    1. Initial program 3.6

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied sub-neg3.6

      \[\leadsto \color{blue}{\left(x \cdot y + \left(-z \cdot y\right)\right)} \cdot t\]
    4. Simplified3.6

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

    if -2.6726654310499567e-104 < t < 1.0247033795508154e-28

    1. Initial program 11.1

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.67266543104995666758061087259893237368 \cdot 10^{-104} \lor \neg \left(t \le 1.024703379550815433409916260913231061372 \cdot 10^{-28}\right):\\ \;\;\;\;\left(x \cdot y + \left(-y\right) \cdot z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \end{array}\]

Reproduce

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