
(FPCore (x y z t) :precision binary64 (- (* x x) (* (* y 4.0) (- (* z z) t))))
double code(double x, double y, double z, double t) {
return (x * x) - ((y * 4.0) * ((z * z) - t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * x) - ((y * 4.0d0) * ((z * z) - t))
end function
public static double code(double x, double y, double z, double t) {
return (x * x) - ((y * 4.0) * ((z * z) - t));
}
def code(x, y, z, t): return (x * x) - ((y * 4.0) * ((z * z) - t))
function code(x, y, z, t) return Float64(Float64(x * x) - Float64(Float64(y * 4.0) * Float64(Float64(z * z) - t))) end
function tmp = code(x, y, z, t) tmp = (x * x) - ((y * 4.0) * ((z * z) - t)); end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- (* x x) (* (* y 4.0) (- (* z z) t))))
double code(double x, double y, double z, double t) {
return (x * x) - ((y * 4.0) * ((z * z) - t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * x) - ((y * 4.0d0) * ((z * z) - t))
end function
public static double code(double x, double y, double z, double t) {
return (x * x) - ((y * 4.0) * ((z * z) - t));
}
def code(x, y, z, t): return (x * x) - ((y * 4.0) * ((z * z) - t))
function code(x, y, z, t) return Float64(Float64(x * x) - Float64(Float64(y * 4.0) * Float64(Float64(z * z) - t))) end
function tmp = code(x, y, z, t) tmp = (x * x) - ((y * 4.0) * ((z * z) - t)); end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\end{array}
NOTE: x should be positive before calling this function (FPCore (x y z t) :precision binary64 (if (<= x 2e+165) (fma x x (* (- (* z z) t) (* y -4.0))) (* x x)))
x = abs(x);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2e+165) {
tmp = fma(x, x, (((z * z) - t) * (y * -4.0)));
} else {
tmp = x * x;
}
return tmp;
}
x = abs(x) function code(x, y, z, t) tmp = 0.0 if (x <= 2e+165) tmp = fma(x, x, Float64(Float64(Float64(z * z) - t) * Float64(y * -4.0))); else tmp = Float64(x * x); end return tmp end
NOTE: x should be positive before calling this function code[x_, y_, z_, t_] := If[LessEqual[x, 2e+165], N[(x * x + N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{+165}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(z \cdot z - t\right) \cdot \left(y \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if x < 1.9999999999999998e165Initial program 93.4%
fma-neg94.8%
*-commutative94.8%
distribute-rgt-neg-in94.8%
distribute-rgt-neg-in94.8%
metadata-eval94.8%
Simplified94.8%
if 1.9999999999999998e165 < x Initial program 81.3%
Taylor expanded in x around inf 100.0%
unpow2100.0%
Simplified100.0%
Final simplification95.4%
NOTE: x should be positive before calling this function
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x x) (* t (* y -4.0)))))
(if (<= (* x x) 5e-73)
(* -4.0 (* (- (* z z) t) y))
(if (<= (* x x) 8e+204)
t_1
(if (<= (* x x) 3.2e+214)
(* z (* z (* y -4.0)))
(if (<= (* x x) 1.9e+274) t_1 (* x x)))))))x = abs(x);
double code(double x, double y, double z, double t) {
double t_1 = (x * x) - (t * (y * -4.0));
double tmp;
if ((x * x) <= 5e-73) {
tmp = -4.0 * (((z * z) - t) * y);
} else if ((x * x) <= 8e+204) {
tmp = t_1;
} else if ((x * x) <= 3.2e+214) {
tmp = z * (z * (y * -4.0));
} else if ((x * x) <= 1.9e+274) {
tmp = t_1;
} else {
tmp = x * x;
}
return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * x) - (t * (y * (-4.0d0)))
if ((x * x) <= 5d-73) then
tmp = (-4.0d0) * (((z * z) - t) * y)
else if ((x * x) <= 8d+204) then
tmp = t_1
else if ((x * x) <= 3.2d+214) then
tmp = z * (z * (y * (-4.0d0)))
else if ((x * x) <= 1.9d+274) then
tmp = t_1
else
tmp = x * x
end if
code = tmp
end function
x = Math.abs(x);
public static double code(double x, double y, double z, double t) {
double t_1 = (x * x) - (t * (y * -4.0));
double tmp;
if ((x * x) <= 5e-73) {
tmp = -4.0 * (((z * z) - t) * y);
} else if ((x * x) <= 8e+204) {
tmp = t_1;
} else if ((x * x) <= 3.2e+214) {
tmp = z * (z * (y * -4.0));
} else if ((x * x) <= 1.9e+274) {
tmp = t_1;
} else {
tmp = x * x;
}
return tmp;
}
x = abs(x) def code(x, y, z, t): t_1 = (x * x) - (t * (y * -4.0)) tmp = 0 if (x * x) <= 5e-73: tmp = -4.0 * (((z * z) - t) * y) elif (x * x) <= 8e+204: tmp = t_1 elif (x * x) <= 3.2e+214: tmp = z * (z * (y * -4.0)) elif (x * x) <= 1.9e+274: tmp = t_1 else: tmp = x * x return tmp
x = abs(x) function code(x, y, z, t) t_1 = Float64(Float64(x * x) - Float64(t * Float64(y * -4.0))) tmp = 0.0 if (Float64(x * x) <= 5e-73) tmp = Float64(-4.0 * Float64(Float64(Float64(z * z) - t) * y)); elseif (Float64(x * x) <= 8e+204) tmp = t_1; elseif (Float64(x * x) <= 3.2e+214) tmp = Float64(z * Float64(z * Float64(y * -4.0))); elseif (Float64(x * x) <= 1.9e+274) tmp = t_1; else tmp = Float64(x * x); end return tmp end
x = abs(x) function tmp_2 = code(x, y, z, t) t_1 = (x * x) - (t * (y * -4.0)); tmp = 0.0; if ((x * x) <= 5e-73) tmp = -4.0 * (((z * z) - t) * y); elseif ((x * x) <= 8e+204) tmp = t_1; elseif ((x * x) <= 3.2e+214) tmp = z * (z * (y * -4.0)); elseif ((x * x) <= 1.9e+274) tmp = t_1; else tmp = x * x; end tmp_2 = tmp; end
NOTE: x should be positive before calling this function
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] - N[(t * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 5e-73], N[(-4.0 * N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 8e+204], t$95$1, If[LessEqual[N[(x * x), $MachinePrecision], 3.2e+214], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 1.9e+274], t$95$1, N[(x * x), $MachinePrecision]]]]]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
t_1 := x \cdot x - t \cdot \left(y \cdot -4\right)\\
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-73}:\\
\;\;\;\;-4 \cdot \left(\left(z \cdot z - t\right) \cdot y\right)\\
\mathbf{elif}\;x \cdot x \leq 8 \cdot 10^{+204}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot x \leq 3.2 \cdot 10^{+214}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\mathbf{elif}\;x \cdot x \leq 1.9 \cdot 10^{+274}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 4.9999999999999998e-73Initial program 97.2%
Taylor expanded in x around 0 92.6%
*-commutative92.6%
unpow292.6%
Simplified92.6%
if 4.9999999999999998e-73 < (*.f64 x x) < 7.99999999999999991e204 or 3.19999999999999995e214 < (*.f64 x x) < 1.8999999999999999e274Initial program 96.1%
Taylor expanded in z around 0 79.8%
associate-*r*79.8%
Simplified79.8%
if 7.99999999999999991e204 < (*.f64 x x) < 3.19999999999999995e214Initial program 99.7%
Taylor expanded in z around inf 99.7%
metadata-eval99.7%
distribute-lft-neg-in99.7%
*-commutative99.7%
unpow299.7%
*-commutative99.7%
associate-*r*99.7%
associate-*l*100.0%
distribute-rgt-neg-in100.0%
distribute-rgt-neg-in100.0%
*-commutative100.0%
distribute-lft-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
if 1.8999999999999999e274 < (*.f64 x x) Initial program 80.3%
Taylor expanded in x around inf 96.1%
unpow296.1%
Simplified96.1%
Final simplification90.2%
NOTE: x should be positive before calling this function (FPCore (x y z t) :precision binary64 (if (<= (* z z) 5e-192) (* t (* y 4.0)) (if (<= (* z z) 5e+216) (* x x) (* z (* z (* y -4.0))))))
x = abs(x);
double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e-192) {
tmp = t * (y * 4.0);
} else if ((z * z) <= 5e+216) {
tmp = x * x;
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z * z) <= 5d-192) then
tmp = t * (y * 4.0d0)
else if ((z * z) <= 5d+216) then
tmp = x * x
else
tmp = z * (z * (y * (-4.0d0)))
end if
code = tmp
end function
x = Math.abs(x);
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * z) <= 5e-192) {
tmp = t * (y * 4.0);
} else if ((z * z) <= 5e+216) {
tmp = x * x;
} else {
tmp = z * (z * (y * -4.0));
}
return tmp;
}
x = abs(x) def code(x, y, z, t): tmp = 0 if (z * z) <= 5e-192: tmp = t * (y * 4.0) elif (z * z) <= 5e+216: tmp = x * x else: tmp = z * (z * (y * -4.0)) return tmp
x = abs(x) function code(x, y, z, t) tmp = 0.0 if (Float64(z * z) <= 5e-192) tmp = Float64(t * Float64(y * 4.0)); elseif (Float64(z * z) <= 5e+216) tmp = Float64(x * x); else tmp = Float64(z * Float64(z * Float64(y * -4.0))); end return tmp end
x = abs(x) function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * z) <= 5e-192) tmp = t * (y * 4.0); elseif ((z * z) <= 5e+216) tmp = x * x; else tmp = z * (z * (y * -4.0)); end tmp_2 = tmp; end
NOTE: x should be positive before calling this function code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 5e-192], N[(t * N[(y * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * z), $MachinePrecision], 5e+216], N[(x * x), $MachinePrecision], N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5 \cdot 10^{-192}:\\
\;\;\;\;t \cdot \left(y \cdot 4\right)\\
\mathbf{elif}\;z \cdot z \leq 5 \cdot 10^{+216}:\\
\;\;\;\;x \cdot x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 z z) < 5.0000000000000001e-192Initial program 96.3%
Taylor expanded in t around inf 61.0%
associate-*r*61.0%
*-commutative61.0%
Simplified61.0%
if 5.0000000000000001e-192 < (*.f64 z z) < 4.9999999999999998e216Initial program 97.0%
Taylor expanded in x around inf 57.8%
unpow257.8%
Simplified57.8%
if 4.9999999999999998e216 < (*.f64 z z) Initial program 80.2%
Taylor expanded in z around inf 76.5%
metadata-eval76.5%
distribute-lft-neg-in76.5%
*-commutative76.5%
unpow276.5%
*-commutative76.5%
associate-*r*76.5%
associate-*l*80.2%
distribute-rgt-neg-in80.2%
distribute-rgt-neg-in80.2%
*-commutative80.2%
distribute-lft-neg-in80.2%
metadata-eval80.2%
Simplified80.2%
Final simplification65.3%
NOTE: x should be positive before calling this function (FPCore (x y z t) :precision binary64 (if (<= x 1.35e+137) (+ (* x x) (* (* y 4.0) (- t (* z z)))) (* x x)))
x = abs(x);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.35e+137) {
tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = x * x;
}
return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 1.35d+137) then
tmp = (x * x) + ((y * 4.0d0) * (t - (z * z)))
else
tmp = x * x
end if
code = tmp
end function
x = Math.abs(x);
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.35e+137) {
tmp = (x * x) + ((y * 4.0) * (t - (z * z)));
} else {
tmp = x * x;
}
return tmp;
}
x = abs(x) def code(x, y, z, t): tmp = 0 if x <= 1.35e+137: tmp = (x * x) + ((y * 4.0) * (t - (z * z))) else: tmp = x * x return tmp
x = abs(x) function code(x, y, z, t) tmp = 0.0 if (x <= 1.35e+137) tmp = Float64(Float64(x * x) + Float64(Float64(y * 4.0) * Float64(t - Float64(z * z)))); else tmp = Float64(x * x); end return tmp end
x = abs(x) function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 1.35e+137) tmp = (x * x) + ((y * 4.0) * (t - (z * z))); else tmp = x * x; end tmp_2 = tmp; end
NOTE: x should be positive before calling this function code[x_, y_, z_, t_] := If[LessEqual[x, 1.35e+137], N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.35 \cdot 10^{+137}:\\
\;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if x < 1.35000000000000009e137Initial program 94.6%
if 1.35000000000000009e137 < x Initial program 76.9%
Taylor expanded in x around inf 94.9%
unpow294.9%
Simplified94.9%
Final simplification94.6%
NOTE: x should be positive before calling this function (FPCore (x y z t) :precision binary64 (if (<= (* x x) 4.2e+215) (* -4.0 (* (- (* z z) t) y)) (* x x)))
x = abs(x);
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 4.2e+215) {
tmp = -4.0 * (((z * z) - t) * y);
} else {
tmp = x * x;
}
return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x * x) <= 4.2d+215) then
tmp = (-4.0d0) * (((z * z) - t) * y)
else
tmp = x * x
end if
code = tmp
end function
x = Math.abs(x);
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 4.2e+215) {
tmp = -4.0 * (((z * z) - t) * y);
} else {
tmp = x * x;
}
return tmp;
}
x = abs(x) def code(x, y, z, t): tmp = 0 if (x * x) <= 4.2e+215: tmp = -4.0 * (((z * z) - t) * y) else: tmp = x * x return tmp
x = abs(x) function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 4.2e+215) tmp = Float64(-4.0 * Float64(Float64(Float64(z * z) - t) * y)); else tmp = Float64(x * x); end return tmp end
x = abs(x) function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * x) <= 4.2e+215) tmp = -4.0 * (((z * z) - t) * y); else tmp = x * x; end tmp_2 = tmp; end
NOTE: x should be positive before calling this function code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 4.2e+215], N[(-4.0 * N[(N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 4.2 \cdot 10^{+215}:\\
\;\;\;\;-4 \cdot \left(\left(z \cdot z - t\right) \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 4.2000000000000003e215Initial program 97.1%
Taylor expanded in x around 0 81.4%
*-commutative81.4%
unpow281.4%
Simplified81.4%
if 4.2000000000000003e215 < (*.f64 x x) Initial program 82.1%
Taylor expanded in x around inf 93.5%
unpow293.5%
Simplified93.5%
Final simplification85.6%
NOTE: x should be positive before calling this function (FPCore (x y z t) :precision binary64 (if (<= (* x x) 1.06e+184) (* t (* y 4.0)) (* x x)))
x = abs(x);
double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 1.06e+184) {
tmp = t * (y * 4.0);
} else {
tmp = x * x;
}
return tmp;
}
NOTE: x should be positive before calling this function
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x * x) <= 1.06d+184) then
tmp = t * (y * 4.0d0)
else
tmp = x * x
end if
code = tmp
end function
x = Math.abs(x);
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x * x) <= 1.06e+184) {
tmp = t * (y * 4.0);
} else {
tmp = x * x;
}
return tmp;
}
x = abs(x) def code(x, y, z, t): tmp = 0 if (x * x) <= 1.06e+184: tmp = t * (y * 4.0) else: tmp = x * x return tmp
x = abs(x) function code(x, y, z, t) tmp = 0.0 if (Float64(x * x) <= 1.06e+184) tmp = Float64(t * Float64(y * 4.0)); else tmp = Float64(x * x); end return tmp end
x = abs(x) function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * x) <= 1.06e+184) tmp = t * (y * 4.0); else tmp = x * x; end tmp_2 = tmp; end
NOTE: x should be positive before calling this function code[x_, y_, z_, t_] := If[LessEqual[N[(x * x), $MachinePrecision], 1.06e+184], N[(t * N[(y * 4.0), $MachinePrecision]), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
x = |x|\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 1.06 \cdot 10^{+184}:\\
\;\;\;\;t \cdot \left(y \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 1.06e184Initial program 96.9%
Taylor expanded in t around inf 48.2%
associate-*r*48.2%
*-commutative48.2%
Simplified48.2%
if 1.06e184 < (*.f64 x x) Initial program 83.9%
Taylor expanded in x around inf 87.5%
unpow287.5%
Simplified87.5%
Final simplification63.4%
NOTE: x should be positive before calling this function (FPCore (x y z t) :precision binary64 (* x x))
x = abs(x);
double code(double x, double y, double z, double t) {
return x * x;
}
NOTE: x should be positive before calling this function
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * x
end function
x = Math.abs(x);
public static double code(double x, double y, double z, double t) {
return x * x;
}
x = abs(x) def code(x, y, z, t): return x * x
x = abs(x) function code(x, y, z, t) return Float64(x * x) end
x = abs(x) function tmp = code(x, y, z, t) tmp = x * x; end
NOTE: x should be positive before calling this function code[x_, y_, z_, t_] := N[(x * x), $MachinePrecision]
\begin{array}{l}
x = |x|\\
\\
x \cdot x
\end{array}
Initial program 91.9%
Taylor expanded in x around inf 46.1%
unpow246.1%
Simplified46.1%
Final simplification46.1%
(FPCore (x y z t) :precision binary64 (- (* x x) (* 4.0 (* y (- (* z z) t)))))
double code(double x, double y, double z, double t) {
return (x * x) - (4.0 * (y * ((z * z) - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * x) - (4.0d0 * (y * ((z * z) - t)))
end function
public static double code(double x, double y, double z, double t) {
return (x * x) - (4.0 * (y * ((z * z) - t)));
}
def code(x, y, z, t): return (x * x) - (4.0 * (y * ((z * z) - t)))
function code(x, y, z, t) return Float64(Float64(x * x) - Float64(4.0 * Float64(y * Float64(Float64(z * z) - t)))) end
function tmp = code(x, y, z, t) tmp = (x * x) - (4.0 * (y * ((z * z) - t))); end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(4.0 * N[(y * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot x - 4 \cdot \left(y \cdot \left(z \cdot z - t\right)\right)
\end{array}
herbie shell --seed 2023257
(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))))