Average Error: 6.2 → 0.1
Time: 8.5s
Precision: 64
\[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\]
\[\left(x \cdot x - \left(\left(y \cdot 4\right) \cdot z\right) \cdot z\right) - \left(y \cdot 4\right) \cdot \left(-t\right)\]
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\left(x \cdot x - \left(\left(y \cdot 4\right) \cdot z\right) \cdot z\right) - \left(y \cdot 4\right) \cdot \left(-t\right)
double f(double x, double y, double z, double t) {
        double r768205 = x;
        double r768206 = r768205 * r768205;
        double r768207 = y;
        double r768208 = 4.0;
        double r768209 = r768207 * r768208;
        double r768210 = z;
        double r768211 = r768210 * r768210;
        double r768212 = t;
        double r768213 = r768211 - r768212;
        double r768214 = r768209 * r768213;
        double r768215 = r768206 - r768214;
        return r768215;
}

double f(double x, double y, double z, double t) {
        double r768216 = x;
        double r768217 = r768216 * r768216;
        double r768218 = y;
        double r768219 = 4.0;
        double r768220 = r768218 * r768219;
        double r768221 = z;
        double r768222 = r768220 * r768221;
        double r768223 = r768222 * r768221;
        double r768224 = r768217 - r768223;
        double r768225 = t;
        double r768226 = -r768225;
        double r768227 = r768220 * r768226;
        double r768228 = r768224 - r768227;
        return r768228;
}

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.2
Target6.2
Herbie0.1
\[x \cdot x - 4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\]

Derivation

  1. Initial program 6.2

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

    \[\leadsto x \cdot x - \left(y \cdot 4\right) \cdot \color{blue}{\left(z \cdot z + \left(-t\right)\right)}\]
  4. Applied distribute-lft-in6.2

    \[\leadsto x \cdot x - \color{blue}{\left(\left(y \cdot 4\right) \cdot \left(z \cdot z\right) + \left(y \cdot 4\right) \cdot \left(-t\right)\right)}\]
  5. Applied associate--r+6.2

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

    \[\leadsto \left(x \cdot x - \color{blue}{\left(\left(y \cdot 4\right) \cdot z\right) \cdot z}\right) - \left(y \cdot 4\right) \cdot \left(-t\right)\]
  8. Final simplification0.1

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

Reproduce

herbie shell --seed 2020046 
(FPCore (x y z t)
  :name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
  :precision binary64

  :herbie-target
  (- (* x x) (* 4 (* y (- (* z z) t))))

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