Average Error: 6.9 → 6.4
Time: 8.3s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\left(t \cdot y\right) \cdot \left(x - z\right)\]
\left(x \cdot y - z \cdot y\right) \cdot t
\left(t \cdot y\right) \cdot \left(x - z\right)
double f(double x, double y, double z, double t) {
        double r378801 = x;
        double r378802 = y;
        double r378803 = r378801 * r378802;
        double r378804 = z;
        double r378805 = r378804 * r378802;
        double r378806 = r378803 - r378805;
        double r378807 = t;
        double r378808 = r378806 * r378807;
        return r378808;
}

double f(double x, double y, double z, double t) {
        double r378809 = t;
        double r378810 = y;
        double r378811 = r378809 * r378810;
        double r378812 = x;
        double r378813 = z;
        double r378814 = r378812 - r378813;
        double r378815 = r378811 * r378814;
        return r378815;
}

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.9
Target3.2
Herbie6.4
\[\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 2 regimes
  2. if y < -3.4758948727223214e-17 or 3.827097534379675e+84 < y

    1. Initial program 16.2

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

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

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

    if -3.4758948727223214e-17 < y < 3.827097534379675e+84

    1. Initial program 2.4

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

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

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

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

Reproduce

herbie shell --seed 2019303 
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (if (< t -9.2318795828867769e-80) (* (* y t) (- x z)) (if (< t 2.5430670515648771e83) (* y (* t (- x z))) (* (* y (- x z)) t)))

  (* (- (* x y) (* z y)) t))