Average Error: 7.7 → 2.8
Time: 4.2s
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 r1059887 = x;
        double r1059888 = y;
        double r1059889 = r1059887 * r1059888;
        double r1059890 = z;
        double r1059891 = r1059890 * r1059888;
        double r1059892 = r1059889 - r1059891;
        double r1059893 = t;
        double r1059894 = r1059892 * r1059893;
        return r1059894;
}

double f(double x, double y, double z, double t) {
        double r1059895 = t;
        double r1059896 = -1.0982906498488293e+75;
        bool r1059897 = r1059895 <= r1059896;
        double r1059898 = 11399415.74257193;
        bool r1059899 = r1059895 <= r1059898;
        double r1059900 = !r1059899;
        bool r1059901 = r1059897 || r1059900;
        double r1059902 = y;
        double r1059903 = x;
        double r1059904 = z;
        double r1059905 = r1059903 - r1059904;
        double r1059906 = r1059902 * r1059905;
        double r1059907 = r1059895 * r1059906;
        double r1059908 = r1059905 * r1059895;
        double r1059909 = r1059908 * r1059902;
        double r1059910 = 1.0;
        double r1059911 = pow(r1059909, r1059910);
        double r1059912 = r1059901 ? r1059907 : r1059911;
        return r1059912;
}

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))