Average Error: 7.0 → 2.5
Time: 17.2s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.3553932494300151 \cdot 10^{-45} \lor \neg \left(t \le 2.77915535238239771 \cdot 10^{-59}\right):\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \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 -1.3553932494300151 \cdot 10^{-45} \lor \neg \left(t \le 2.77915535238239771 \cdot 10^{-59}\right):\\
\;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\

\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 r380324 = x;
        double r380325 = y;
        double r380326 = r380324 * r380325;
        double r380327 = z;
        double r380328 = r380327 * r380325;
        double r380329 = r380326 - r380328;
        double r380330 = t;
        double r380331 = r380329 * r380330;
        return r380331;
}

double f(double x, double y, double z, double t) {
        double r380332 = t;
        double r380333 = -1.3553932494300151e-45;
        bool r380334 = r380332 <= r380333;
        double r380335 = 2.7791553523823977e-59;
        bool r380336 = r380332 <= r380335;
        double r380337 = !r380336;
        bool r380338 = r380334 || r380337;
        double r380339 = y;
        double r380340 = x;
        double r380341 = z;
        double r380342 = r380340 - r380341;
        double r380343 = r380339 * r380342;
        double r380344 = r380343 * r380332;
        double r380345 = r380342 * r380332;
        double r380346 = r380339 * r380345;
        double r380347 = r380338 ? r380344 : r380346;
        return r380347;
}

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
Herbie2.5
\[\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 < -1.3553932494300151e-45 or 2.7791553523823977e-59 < t

    1. Initial program 2.7

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified2.7

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

    if -1.3553932494300151e-45 < t < 2.7791553523823977e-59

    1. Initial program 10.9

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified10.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.3553932494300151 \cdot 10^{-45} \lor \neg \left(t \le 2.77915535238239771 \cdot 10^{-59}\right):\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \end{array}\]

Reproduce

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