Average Error: 7.2 → 2.8
Time: 3.4s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -5.11190814655835692 \cdot 10^{-81} \lor \neg \left(t \le 1.97666788664023624 \cdot 10^{-21}\right):\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -5.11190814655835692 \cdot 10^{-81} \lor \neg \left(t \le 1.97666788664023624 \cdot 10^{-21}\right):\\
\;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r699489 = x;
        double r699490 = y;
        double r699491 = r699489 * r699490;
        double r699492 = z;
        double r699493 = r699492 * r699490;
        double r699494 = r699491 - r699493;
        double r699495 = t;
        double r699496 = r699494 * r699495;
        return r699496;
}

double f(double x, double y, double z, double t) {
        double r699497 = t;
        double r699498 = -5.111908146558357e-81;
        bool r699499 = r699497 <= r699498;
        double r699500 = 1.9766678866402362e-21;
        bool r699501 = r699497 <= r699500;
        double r699502 = !r699501;
        bool r699503 = r699499 || r699502;
        double r699504 = y;
        double r699505 = x;
        double r699506 = z;
        double r699507 = r699505 - r699506;
        double r699508 = r699504 * r699507;
        double r699509 = r699497 * r699508;
        double r699510 = r699507 * r699497;
        double r699511 = r699504 * r699510;
        double r699512 = r699503 ? r699509 : r699511;
        return r699512;
}

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.2
Target3.1
Herbie2.8
\[\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 t < -5.111908146558357e-81 or 1.9766678866402362e-21 < t

    1. Initial program 3.4

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

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

    if -5.111908146558357e-81 < t < 1.9766678866402362e-21

    1. Initial program 10.7

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -5.11190814655835692 \cdot 10^{-81} \lor \neg \left(t \le 1.97666788664023624 \cdot 10^{-21}\right):\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]

Reproduce

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