Average Error: 6.8 → 0.7
Time: 3.3s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\left(x \cdot y - z \cdot y\right) \cdot t = -\infty \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le -1.53044964204086178 \cdot 10^{-264} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 1.2292279533141836 \cdot 10^{-203} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 2.66626022737372574 \cdot 10^{305}\right)\right)\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + \left(-z \cdot y\right)\right) \cdot t\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;\left(x \cdot y - z \cdot y\right) \cdot t = -\infty \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le -1.53044964204086178 \cdot 10^{-264} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 1.2292279533141836 \cdot 10^{-203} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 2.66626022737372574 \cdot 10^{305}\right)\right)\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r532484 = x;
        double r532485 = y;
        double r532486 = r532484 * r532485;
        double r532487 = z;
        double r532488 = r532487 * r532485;
        double r532489 = r532486 - r532488;
        double r532490 = t;
        double r532491 = r532489 * r532490;
        return r532491;
}

double f(double x, double y, double z, double t) {
        double r532492 = x;
        double r532493 = y;
        double r532494 = r532492 * r532493;
        double r532495 = z;
        double r532496 = r532495 * r532493;
        double r532497 = r532494 - r532496;
        double r532498 = t;
        double r532499 = r532497 * r532498;
        double r532500 = -inf.0;
        bool r532501 = r532499 <= r532500;
        double r532502 = -1.5304496420408618e-264;
        bool r532503 = r532499 <= r532502;
        double r532504 = 1.2292279533141836e-203;
        bool r532505 = r532499 <= r532504;
        double r532506 = 2.6662602273737257e+305;
        bool r532507 = r532499 <= r532506;
        double r532508 = !r532507;
        bool r532509 = r532505 || r532508;
        double r532510 = !r532509;
        bool r532511 = r532503 || r532510;
        double r532512 = !r532511;
        bool r532513 = r532501 || r532512;
        double r532514 = r532492 - r532495;
        double r532515 = r532514 * r532498;
        double r532516 = r532493 * r532515;
        double r532517 = -r532496;
        double r532518 = r532494 + r532517;
        double r532519 = r532518 * r532498;
        double r532520 = r532513 ? r532516 : r532519;
        return r532520;
}

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

Original6.8
Target3.2
Herbie0.7
\[\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 (* (- (* x y) (* z y)) t) < -inf.0 or -1.5304496420408618e-264 < (* (- (* x y) (* z y)) t) < 1.2292279533141836e-203 or 2.6662602273737257e+305 < (* (- (* x y) (* z y)) t)

    1. Initial program 24.6

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

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

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

    if -inf.0 < (* (- (* x y) (* z y)) t) < -1.5304496420408618e-264 or 1.2292279533141836e-203 < (* (- (* x y) (* z y)) t) < 2.6662602273737257e+305

    1. Initial program 0.4

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y - z \cdot y\right) \cdot t = -\infty \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le -1.53044964204086178 \cdot 10^{-264} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 1.2292279533141836 \cdot 10^{-203} \lor \neg \left(\left(x \cdot y - z \cdot y\right) \cdot t \le 2.66626022737372574 \cdot 10^{305}\right)\right)\right):\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + \left(-z \cdot y\right)\right) \cdot t\\ \end{array}\]

Reproduce

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