Average Error: 7.7 → 2.8
Time: 7.1s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.09829064984882928 \cdot 10^{75} \lor \neg \left(t \le 11399415.7425719295\right):\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(\left(x - z\right) \cdot t\right) \cdot y\right)}^{1}\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -1.09829064984882928 \cdot 10^{75} \lor \neg \left(t \le 11399415.7425719295\right):\\
\;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r2301 = x;
        double r2302 = y;
        double r2303 = r2301 * r2302;
        double r2304 = z;
        double r2305 = r2304 * r2302;
        double r2306 = r2303 - r2305;
        double r2307 = t;
        double r2308 = r2306 * r2307;
        return r2308;
}

double f(double x, double y, double z, double t) {
        double r2309 = t;
        double r2310 = -1.0982906498488293e+75;
        bool r2311 = r2309 <= r2310;
        double r2312 = 11399415.74257193;
        bool r2313 = r2309 <= r2312;
        double r2314 = !r2313;
        bool r2315 = r2311 || r2314;
        double r2316 = y;
        double r2317 = x;
        double r2318 = z;
        double r2319 = r2317 - r2318;
        double r2320 = r2316 * r2319;
        double r2321 = r2309 * r2320;
        double r2322 = r2319 * r2309;
        double r2323 = r2322 * r2316;
        double r2324 = 1.0;
        double r2325 = pow(r2323, r2324);
        double r2326 = r2315 ? r2321 : r2325;
        return r2326;
}

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.7
Target3.0
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 < -1.0982906498488293e+75 or 11399415.74257193 < t

    1. Initial program 3.6

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

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

    if -1.0982906498488293e+75 < t < 11399415.74257193

    1. Initial program 9.6

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified9.6

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

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

      \[\leadsto t \cdot \left(\color{blue}{{y}^{1}} \cdot {\left(x - z\right)}^{1}\right)\]
    6. Applied pow-prod-down9.6

      \[\leadsto t \cdot \color{blue}{{\left(y \cdot \left(x - z\right)\right)}^{1}}\]
    7. Applied pow19.6

      \[\leadsto \color{blue}{{t}^{1}} \cdot {\left(y \cdot \left(x - z\right)\right)}^{1}\]
    8. Applied pow-prod-down9.6

      \[\leadsto \color{blue}{{\left(t \cdot \left(y \cdot \left(x - z\right)\right)\right)}^{1}}\]
    9. Simplified7.9

      \[\leadsto {\color{blue}{\left(\left(x - z\right) \cdot \left(t \cdot y\right)\right)}}^{1}\]
    10. Using strategy rm
    11. Applied associate-*r*2.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.09829064984882928 \cdot 10^{75} \lor \neg \left(t \le 11399415.7425719295\right):\\ \;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(\left(x - z\right) \cdot t\right) \cdot y\right)}^{1}\\ \end{array}\]

Reproduce

herbie shell --seed 2020025 +o rules:numerics
(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))