Average Error: 6.1 → 0.1
Time: 15.0s
Precision: 64
\[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\]
\[x \cdot x + 4 \cdot \left(y \cdot t + \left(-z \cdot \left(z \cdot y\right)\right)\right)\]
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
x \cdot x + 4 \cdot \left(y \cdot t + \left(-z \cdot \left(z \cdot y\right)\right)\right)
double f(double x, double y, double z, double t) {
        double r526293 = x;
        double r526294 = r526293 * r526293;
        double r526295 = y;
        double r526296 = 4.0;
        double r526297 = r526295 * r526296;
        double r526298 = z;
        double r526299 = r526298 * r526298;
        double r526300 = t;
        double r526301 = r526299 - r526300;
        double r526302 = r526297 * r526301;
        double r526303 = r526294 - r526302;
        return r526303;
}

double f(double x, double y, double z, double t) {
        double r526304 = x;
        double r526305 = r526304 * r526304;
        double r526306 = 4.0;
        double r526307 = y;
        double r526308 = t;
        double r526309 = r526307 * r526308;
        double r526310 = z;
        double r526311 = r526310 * r526307;
        double r526312 = r526310 * r526311;
        double r526313 = -r526312;
        double r526314 = r526309 + r526313;
        double r526315 = r526306 * r526314;
        double r526316 = r526305 + r526315;
        return r526316;
}

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

Derivation

  1. Initial program 6.1

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

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

    \[\leadsto \color{blue}{4 \cdot \left(y \cdot \left(t - z \cdot z\right)\right)} + x \cdot x\]
  5. Using strategy rm
  6. Applied sub-neg6.1

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

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

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

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

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

Reproduce

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

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

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