Average Error: 7.0 → 0.3
Time: 12.5s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -8.274186156879764240774351835854573918832 \cdot 10^{226}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -4.819622087448949409690444355976373823692 \cdot 10^{-247}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.232937047876378353025506941095613328966 \cdot 10^{-242}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.77758114352811529361559523864976797551 \cdot 10^{299}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y \le -8.274186156879764240774351835854573918832 \cdot 10^{226}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\

\mathbf{elif}\;x \cdot y - z \cdot y \le -4.819622087448949409690444355976373823692 \cdot 10^{-247}:\\
\;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\

\mathbf{elif}\;x \cdot y - z \cdot y \le 1.232937047876378353025506941095613328966 \cdot 10^{-242}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\

\mathbf{elif}\;x \cdot y - z \cdot y \le 1.77758114352811529361559523864976797551 \cdot 10^{299}:\\
\;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r449316 = x;
        double r449317 = y;
        double r449318 = r449316 * r449317;
        double r449319 = z;
        double r449320 = r449319 * r449317;
        double r449321 = r449318 - r449320;
        double r449322 = t;
        double r449323 = r449321 * r449322;
        return r449323;
}

double f(double x, double y, double z, double t) {
        double r449324 = x;
        double r449325 = y;
        double r449326 = r449324 * r449325;
        double r449327 = z;
        double r449328 = r449327 * r449325;
        double r449329 = r449326 - r449328;
        double r449330 = -8.274186156879764e+226;
        bool r449331 = r449329 <= r449330;
        double r449332 = t;
        double r449333 = r449325 * r449332;
        double r449334 = r449324 - r449327;
        double r449335 = r449333 * r449334;
        double r449336 = -4.8196220874489494e-247;
        bool r449337 = r449329 <= r449336;
        double r449338 = r449329 * r449332;
        double r449339 = 1.2329370478763784e-242;
        bool r449340 = r449329 <= r449339;
        double r449341 = 1.7775811435281153e+299;
        bool r449342 = r449329 <= r449341;
        double r449343 = r449332 * r449334;
        double r449344 = r449325 * r449343;
        double r449345 = r449342 ? r449338 : r449344;
        double r449346 = r449340 ? r449335 : r449345;
        double r449347 = r449337 ? r449338 : r449346;
        double r449348 = r449331 ? r449335 : r449347;
        return r449348;
}

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.1
Herbie0.3
\[\begin{array}{l} \mathbf{if}\;t \lt -9.231879582886776938073886590448747944753 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.543067051564877116200336808272775217995 \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 3 regimes
  2. if (- (* x y) (* z y)) < -8.274186156879764e+226 or -4.8196220874489494e-247 < (- (* x y) (* z y)) < 1.2329370478763784e-242

    1. Initial program 21.6

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(t \cdot \left(x - z\right)\right)}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity0.6

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

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

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

    if -8.274186156879764e+226 < (- (* x y) (* z y)) < -4.8196220874489494e-247 or 1.2329370478763784e-242 < (- (* x y) (* z y)) < 1.7775811435281153e+299

    1. Initial program 0.2

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]

    if 1.7775811435281153e+299 < (- (* x y) (* z y))

    1. Initial program 58.5

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -8.274186156879764240774351835854573918832 \cdot 10^{226}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -4.819622087448949409690444355976373823692 \cdot 10^{-247}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.232937047876378353025506941095613328966 \cdot 10^{-242}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 1.77758114352811529361559523864976797551 \cdot 10^{299}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \end{array}\]

Reproduce

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