Average Error: 6.0 → 6.0
Time: 4.4s
Precision: binary64
\[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)\]
\[\begin{array}{l} \mathbf{if}\;z \cdot z \leq 9.211511594325861 \cdot 10^{+280}:\\ \;\;\;\;x \cdot x + y \cdot \left(4 \cdot \left(t - z \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x + y \cdot \left(4 \cdot t\right)\\ \end{array}\]
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 9.211511594325861 \cdot 10^{+280}:\\
\;\;\;\;x \cdot x + y \cdot \left(4 \cdot \left(t - z \cdot z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot x + y \cdot \left(4 \cdot t\right)\\

\end{array}
(FPCore (x y z t) :precision binary64 (- (* x x) (* (* y 4.0) (- (* z z) t))))
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z z) 9.211511594325861e+280)
   (+ (* x x) (* y (* 4.0 (- t (* z z)))))
   (+ (* x x) (* y (* 4.0 t)))))
double code(double x, double y, double z, double t) {
	return ((double) (((double) (x * x)) - ((double) (((double) (y * 4.0)) * ((double) (((double) (z * z)) - t))))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((((double) (z * z)) <= 9.211511594325861e+280)) {
		VAR = ((double) (((double) (x * x)) + ((double) (y * ((double) (4.0 * ((double) (t - ((double) (z * z))))))))));
	} else {
		VAR = ((double) (((double) (x * x)) + ((double) (y * ((double) (4.0 * t))))));
	}
	return VAR;
}

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
Target5.9
Herbie6.0
\[x \cdot x - 4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)\]

Derivation

  1. Split input into 2 regimes
  2. if (* z z) < 9.2115115943258612e280

    1. Initial program 0.1

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

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

    if 9.2115115943258612e280 < (* z z)

    1. Initial program 53.7

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

      \[\leadsto \color{blue}{x \cdot x + y \cdot \left(4 \cdot \left(t - z \cdot z\right)\right)}\]
    3. Taylor expanded around 0 54.5

      \[\leadsto x \cdot x + \color{blue}{4 \cdot \left(t \cdot y\right)}\]
    4. Simplified54.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot z \leq 9.211511594325861 \cdot 10^{+280}:\\ \;\;\;\;x \cdot x + y \cdot \left(4 \cdot \left(t - z \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot x + y \cdot \left(4 \cdot t\right)\\ \end{array}\]

Reproduce

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

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

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