Average Error: 6.0 → 0.1
Time: 12.7s
Precision: 64
\[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\]
\[\left(y \cdot 4\right) \cdot t + \left({x}^{2} - \left(z \cdot \left(y \cdot 4\right)\right) \cdot z\right)\]
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\left(y \cdot 4\right) \cdot t + \left({x}^{2} - \left(z \cdot \left(y \cdot 4\right)\right) \cdot z\right)
double f(double x, double y, double z, double t) {
        double r520948 = x;
        double r520949 = r520948 * r520948;
        double r520950 = y;
        double r520951 = 4.0;
        double r520952 = r520950 * r520951;
        double r520953 = z;
        double r520954 = r520953 * r520953;
        double r520955 = t;
        double r520956 = r520954 - r520955;
        double r520957 = r520952 * r520956;
        double r520958 = r520949 - r520957;
        return r520958;
}

double f(double x, double y, double z, double t) {
        double r520959 = y;
        double r520960 = 4.0;
        double r520961 = r520959 * r520960;
        double r520962 = t;
        double r520963 = r520961 * r520962;
        double r520964 = x;
        double r520965 = 2.0;
        double r520966 = pow(r520964, r520965);
        double r520967 = z;
        double r520968 = r520967 * r520961;
        double r520969 = r520968 * r520967;
        double r520970 = r520966 - r520969;
        double r520971 = r520963 + r520970;
        return r520971;
}

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

Derivation

  1. Initial program 6.0

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

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

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

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

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

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

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

Reproduce

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