Average Error: 7.2 → 7.2
Time: 8.2s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[t \cdot \left(y \cdot \left(x - z\right)\right)\]
\left(x \cdot y - z \cdot y\right) \cdot t
t \cdot \left(y \cdot \left(x - z\right)\right)
double f(double x, double y, double z, double t) {
        double r381723 = x;
        double r381724 = y;
        double r381725 = r381723 * r381724;
        double r381726 = z;
        double r381727 = r381726 * r381724;
        double r381728 = r381725 - r381727;
        double r381729 = t;
        double r381730 = r381728 * r381729;
        return r381730;
}

double f(double x, double y, double z, double t) {
        double r381731 = t;
        double r381732 = y;
        double r381733 = x;
        double r381734 = z;
        double r381735 = r381733 - r381734;
        double r381736 = r381732 * r381735;
        double r381737 = r381731 * r381736;
        return r381737;
}

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.2
Target3.2
Herbie7.2
\[\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)) < -1.0155072420958704e+257 or 1.217232128331509e+202 < (- (* x y) (* z y))

    1. Initial program 33.1

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(t \cdot \left(x - z\right)\right)}\]
    6. Using strategy rm
    7. Applied sub-neg1.0

      \[\leadsto y \cdot \left(t \cdot \color{blue}{\left(x + \left(-z\right)\right)}\right)\]
    8. Applied distribute-rgt-in1.0

      \[\leadsto y \cdot \color{blue}{\left(x \cdot t + \left(-z\right) \cdot t\right)}\]
    9. Applied distribute-rgt-in1.0

      \[\leadsto \color{blue}{\left(x \cdot t\right) \cdot y + \left(\left(-z\right) \cdot t\right) \cdot y}\]
    10. Simplified1.0

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

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

    if -1.0155072420958704e+257 < (- (* x y) (* z y)) < -5.279246409100828e-146 or 2.531528260187281e-107 < (- (* x y) (* z y)) < 1.217232128331509e+202

    1. Initial program 0.3

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

    if -5.279246409100828e-146 < (- (* x y) (* z y)) < 2.531528260187281e-107

    1. Initial program 6.0

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(t \cdot \left(x - z\right)\right)}\]
    6. Using strategy rm
    7. Applied sub-neg2.0

      \[\leadsto y \cdot \left(t \cdot \color{blue}{\left(x + \left(-z\right)\right)}\right)\]
    8. Applied distribute-rgt-in2.0

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

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

Reproduce

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