
(FPCore (x y z)
:precision binary64
(fmax
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2)))double code(double x, double y, double z) {
return fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2));
}
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = fmax((sqrt(((((x * 30.0d0) ** 2.0d0) + ((y * 30.0d0) ** 2.0d0)) + ((z * 30.0d0) ** 2.0d0))) - 25.0d0), (abs((((sin((x * 30.0d0)) * cos((y * 30.0d0))) + (sin((y * 30.0d0)) * cos((z * 30.0d0)))) + (sin((z * 30.0d0)) * cos((x * 30.0d0))))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((Math.sqrt(((Math.pow((x * 30.0), 2.0) + Math.pow((y * 30.0), 2.0)) + Math.pow((z * 30.0), 2.0))) - 25.0), (Math.abs((((Math.sin((x * 30.0)) * Math.cos((y * 30.0))) + (Math.sin((y * 30.0)) * Math.cos((z * 30.0)))) + (Math.sin((z * 30.0)) * Math.cos((x * 30.0))))) - 0.2));
}
def code(x, y, z): return fmax((math.sqrt(((math.pow((x * 30.0), 2.0) + math.pow((y * 30.0), 2.0)) + math.pow((z * 30.0), 2.0))) - 25.0), (math.fabs((((math.sin((x * 30.0)) * math.cos((y * 30.0))) + (math.sin((y * 30.0)) * math.cos((z * 30.0)))) + (math.sin((z * 30.0)) * math.cos((x * 30.0))))) - 0.2))
function code(x, y, z) return fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((sqrt(((((x * 30.0) ^ 2.0) + ((y * 30.0) ^ 2.0)) + ((z * 30.0) ^ 2.0))) - 25.0), (abs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right)
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(fmax
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2)))double code(double x, double y, double z) {
return fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2));
}
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = fmax((sqrt(((((x * 30.0d0) ** 2.0d0) + ((y * 30.0d0) ** 2.0d0)) + ((z * 30.0d0) ** 2.0d0))) - 25.0d0), (abs((((sin((x * 30.0d0)) * cos((y * 30.0d0))) + (sin((y * 30.0d0)) * cos((z * 30.0d0)))) + (sin((z * 30.0d0)) * cos((x * 30.0d0))))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((Math.sqrt(((Math.pow((x * 30.0), 2.0) + Math.pow((y * 30.0), 2.0)) + Math.pow((z * 30.0), 2.0))) - 25.0), (Math.abs((((Math.sin((x * 30.0)) * Math.cos((y * 30.0))) + (Math.sin((y * 30.0)) * Math.cos((z * 30.0)))) + (Math.sin((z * 30.0)) * Math.cos((x * 30.0))))) - 0.2));
}
def code(x, y, z): return fmax((math.sqrt(((math.pow((x * 30.0), 2.0) + math.pow((y * 30.0), 2.0)) + math.pow((z * 30.0), 2.0))) - 25.0), (math.fabs((((math.sin((x * 30.0)) * math.cos((y * 30.0))) + (math.sin((y * 30.0)) * math.cos((z * 30.0)))) + (math.sin((z * 30.0)) * math.cos((x * 30.0))))) - 0.2))
function code(x, y, z) return fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((sqrt(((((x * 30.0) ^ 2.0) + ((y * 30.0) ^ 2.0)) + ((z * 30.0) ^ 2.0))) - 25.0), (abs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right)
(FPCore (x y z)
:precision binary64
(let* ((t_0 (pow (* z 30.0) 2.0)) (t_1 (pow (* y 30.0) 2.0)))
(if (<=
(fmax
(- (sqrt (+ (+ (pow (* x 30.0) 2.0) t_1) t_0)) 25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2))
-0.1)
(fmax
(- (sqrt (+ (+ (pow (* 0.0 30.0) 2.0) t_1) t_0)) 25.0)
(-
(fabs
(+
(sin (* 30.0 0.0))
(/
(*
0.25
(-
(- 0.5 (* 0.5 (cos (* 2.0 (* (- z 0.0) 30.0)))))
(- 0.5 (* 0.5 (cos (* 2.0 (* (+ z 0.0) 30.0)))))))
(* (sin (* -30.0 0.0)) (cos (* -30.0 z))))))
0.2))
(fmax
(- (hypot (* z 30.0) (hypot (* y 30.0) (* 30.0 x))) 25.0)
(-
(fabs
(+ (sin (* 30.0 z)) (* (cos (* 30.0 z)) (sin (* 30.0 y)))))
0.2)))))double code(double x, double y, double z) {
double t_0 = pow((z * 30.0), 2.0);
double t_1 = pow((y * 30.0), 2.0);
double tmp;
if (fmax((sqrt(((pow((x * 30.0), 2.0) + t_1) + t_0)) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)) <= -0.1) {
tmp = fmax((sqrt(((pow((0.0 * 30.0), 2.0) + t_1) + t_0)) - 25.0), (fabs((sin((30.0 * 0.0)) + ((0.25 * ((0.5 - (0.5 * cos((2.0 * ((z - 0.0) * 30.0))))) - (0.5 - (0.5 * cos((2.0 * ((z + 0.0) * 30.0))))))) / (sin((-30.0 * 0.0)) * cos((-30.0 * z)))))) - 0.2));
} else {
tmp = fmax((hypot((z * 30.0), hypot((y * 30.0), (30.0 * x))) - 25.0), (fabs((sin((30.0 * z)) + (cos((30.0 * z)) * sin((30.0 * y))))) - 0.2));
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = Math.pow((z * 30.0), 2.0);
double t_1 = Math.pow((y * 30.0), 2.0);
double tmp;
if (fmax((Math.sqrt(((Math.pow((x * 30.0), 2.0) + t_1) + t_0)) - 25.0), (Math.abs((((Math.sin((x * 30.0)) * Math.cos((y * 30.0))) + (Math.sin((y * 30.0)) * Math.cos((z * 30.0)))) + (Math.sin((z * 30.0)) * Math.cos((x * 30.0))))) - 0.2)) <= -0.1) {
tmp = fmax((Math.sqrt(((Math.pow((0.0 * 30.0), 2.0) + t_1) + t_0)) - 25.0), (Math.abs((Math.sin((30.0 * 0.0)) + ((0.25 * ((0.5 - (0.5 * Math.cos((2.0 * ((z - 0.0) * 30.0))))) - (0.5 - (0.5 * Math.cos((2.0 * ((z + 0.0) * 30.0))))))) / (Math.sin((-30.0 * 0.0)) * Math.cos((-30.0 * z)))))) - 0.2));
} else {
tmp = fmax((Math.hypot((z * 30.0), Math.hypot((y * 30.0), (30.0 * x))) - 25.0), (Math.abs((Math.sin((30.0 * z)) + (Math.cos((30.0 * z)) * Math.sin((30.0 * y))))) - 0.2));
}
return tmp;
}
def code(x, y, z): t_0 = math.pow((z * 30.0), 2.0) t_1 = math.pow((y * 30.0), 2.0) tmp = 0 if fmax((math.sqrt(((math.pow((x * 30.0), 2.0) + t_1) + t_0)) - 25.0), (math.fabs((((math.sin((x * 30.0)) * math.cos((y * 30.0))) + (math.sin((y * 30.0)) * math.cos((z * 30.0)))) + (math.sin((z * 30.0)) * math.cos((x * 30.0))))) - 0.2)) <= -0.1: tmp = fmax((math.sqrt(((math.pow((0.0 * 30.0), 2.0) + t_1) + t_0)) - 25.0), (math.fabs((math.sin((30.0 * 0.0)) + ((0.25 * ((0.5 - (0.5 * math.cos((2.0 * ((z - 0.0) * 30.0))))) - (0.5 - (0.5 * math.cos((2.0 * ((z + 0.0) * 30.0))))))) / (math.sin((-30.0 * 0.0)) * math.cos((-30.0 * z)))))) - 0.2)) else: tmp = fmax((math.hypot((z * 30.0), math.hypot((y * 30.0), (30.0 * x))) - 25.0), (math.fabs((math.sin((30.0 * z)) + (math.cos((30.0 * z)) * math.sin((30.0 * y))))) - 0.2)) return tmp
function code(x, y, z) t_0 = Float64(z * 30.0) ^ 2.0 t_1 = Float64(y * 30.0) ^ 2.0 tmp = 0.0 if (fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + t_1) + t_0)) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) <= -0.1) tmp = fmax(Float64(sqrt(Float64(Float64((Float64(0.0 * 30.0) ^ 2.0) + t_1) + t_0)) - 25.0), Float64(abs(Float64(sin(Float64(30.0 * 0.0)) + Float64(Float64(0.25 * Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(Float64(z - 0.0) * 30.0))))) - Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(Float64(z + 0.0) * 30.0))))))) / Float64(sin(Float64(-30.0 * 0.0)) * cos(Float64(-30.0 * z)))))) - 0.2)); else tmp = fmax(Float64(hypot(Float64(z * 30.0), hypot(Float64(y * 30.0), Float64(30.0 * x))) - 25.0), Float64(abs(Float64(sin(Float64(30.0 * z)) + Float64(cos(Float64(30.0 * z)) * sin(Float64(30.0 * y))))) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * 30.0) ^ 2.0; t_1 = (y * 30.0) ^ 2.0; tmp = 0.0; if (max((sqrt(((((x * 30.0) ^ 2.0) + t_1) + t_0)) - 25.0), (abs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)) <= -0.1) tmp = max((sqrt(((((0.0 * 30.0) ^ 2.0) + t_1) + t_0)) - 25.0), (abs((sin((30.0 * 0.0)) + ((0.25 * ((0.5 - (0.5 * cos((2.0 * ((z - 0.0) * 30.0))))) - (0.5 - (0.5 * cos((2.0 * ((z + 0.0) * 30.0))))))) / (sin((-30.0 * 0.0)) * cos((-30.0 * z)))))) - 0.2)); else tmp = max((hypot((z * 30.0), hypot((y * 30.0), (30.0 * x))) - 25.0), (abs((sin((30.0 * z)) + (cos((30.0 * z)) * sin((30.0 * y))))) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], -0.1], N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(0.0 * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * 0.0), $MachinePrecision]], $MachinePrecision] + N[(N[(0.25 * N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(N[(z - 0.0), $MachinePrecision] * 30.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(N[(z + 0.0), $MachinePrecision] * 30.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[N[(-30.0 * 0.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(-30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[Sqrt[N[(z * 30.0), $MachinePrecision] ^ 2 + N[Sqrt[N[(y * 30.0), $MachinePrecision] ^ 2 + N[(30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(30.0 * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_0 := {\left(z \cdot 30\right)}^{2}\\
t_1 := {\left(y \cdot 30\right)}^{2}\\
\mathbf{if}\;\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + t\_1\right) + t\_0} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq -0.1:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\left({\left(0 \cdot 30\right)}^{2} + t\_1\right) + t\_0} - 25, \left|\sin \left(30 \cdot 0\right) + \frac{0.25 \cdot \left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(z - 0\right) \cdot 30\right)\right)\right) - \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(z + 0\right) \cdot 30\right)\right)\right)\right)}{\sin \left(-30 \cdot 0\right) \cdot \cos \left(-30 \cdot z\right)}\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(z \cdot 30, \mathsf{hypot}\left(y \cdot 30, 30 \cdot x\right)\right) - 25, \left|\sin \left(30 \cdot z\right) + \cos \left(30 \cdot z\right) \cdot \sin \left(30 \cdot y\right)\right| - 0.2\right)\\
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < -0.10000000000000001Initial program 35.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.9%
Applied rewrites35.9%
Applied rewrites35.9%
Taylor expanded in undef-var around zero
Applied rewrites25.8%
Taylor expanded in undef-var around zero
Applied rewrites25.4%
Taylor expanded in undef-var around zero
Applied rewrites25.6%
Taylor expanded in undef-var around zero
Applied rewrites25.4%
Taylor expanded in undef-var around zero
Applied rewrites35.8%
if -0.10000000000000001 < (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) Initial program 35.9%
Applied rewrites49.3%
lift-sqrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
sqrt-prodN/A
metadata-evalN/A
sqrt-unprodN/A
metadata-evalN/A
fabs-mulN/A
*-commutativeN/A
lift-*.f64N/A
rem-sqrt-squareN/A
sqr-neg-revN/A
rem-sqrt-squareN/A
rem-sqrt-squareN/A
sqr-neg-revN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-*.f64N/A
Applied rewrites89.2%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6489.2%
Applied rewrites89.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (sin (* 30.0 (- y z))) 0.5))
(t_1 (* (sin (* 30.0 (+ z y))) 0.5))
(t_2 (sin (* 30.0 z))))
(if (<=
(fmax
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2))
-0.1)
(fmax
(- (* -30.0 z) 25.0)
(-
(fabs
(+
t_2
(/
(- (/ 1.0 (pow t_0 -2.0)) (/ 1.0 (pow t_1 -2.0)))
(- t_0 t_1))))
0.2))
(fmax
(- (hypot (* z 30.0) (hypot (* y 30.0) (* 30.0 x))) 25.0)
(- (fabs (+ t_2 (* (cos (* 30.0 z)) (sin (* 30.0 y))))) 0.2)))))double code(double x, double y, double z) {
double t_0 = sin((30.0 * (y - z))) * 0.5;
double t_1 = sin((30.0 * (z + y))) * 0.5;
double t_2 = sin((30.0 * z));
double tmp;
if (fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)) <= -0.1) {
tmp = fmax(((-30.0 * z) - 25.0), (fabs((t_2 + (((1.0 / pow(t_0, -2.0)) - (1.0 / pow(t_1, -2.0))) / (t_0 - t_1)))) - 0.2));
} else {
tmp = fmax((hypot((z * 30.0), hypot((y * 30.0), (30.0 * x))) - 25.0), (fabs((t_2 + (cos((30.0 * z)) * sin((30.0 * y))))) - 0.2));
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = Math.sin((30.0 * (y - z))) * 0.5;
double t_1 = Math.sin((30.0 * (z + y))) * 0.5;
double t_2 = Math.sin((30.0 * z));
double tmp;
if (fmax((Math.sqrt(((Math.pow((x * 30.0), 2.0) + Math.pow((y * 30.0), 2.0)) + Math.pow((z * 30.0), 2.0))) - 25.0), (Math.abs((((Math.sin((x * 30.0)) * Math.cos((y * 30.0))) + (Math.sin((y * 30.0)) * Math.cos((z * 30.0)))) + (Math.sin((z * 30.0)) * Math.cos((x * 30.0))))) - 0.2)) <= -0.1) {
tmp = fmax(((-30.0 * z) - 25.0), (Math.abs((t_2 + (((1.0 / Math.pow(t_0, -2.0)) - (1.0 / Math.pow(t_1, -2.0))) / (t_0 - t_1)))) - 0.2));
} else {
tmp = fmax((Math.hypot((z * 30.0), Math.hypot((y * 30.0), (30.0 * x))) - 25.0), (Math.abs((t_2 + (Math.cos((30.0 * z)) * Math.sin((30.0 * y))))) - 0.2));
}
return tmp;
}
def code(x, y, z): t_0 = math.sin((30.0 * (y - z))) * 0.5 t_1 = math.sin((30.0 * (z + y))) * 0.5 t_2 = math.sin((30.0 * z)) tmp = 0 if fmax((math.sqrt(((math.pow((x * 30.0), 2.0) + math.pow((y * 30.0), 2.0)) + math.pow((z * 30.0), 2.0))) - 25.0), (math.fabs((((math.sin((x * 30.0)) * math.cos((y * 30.0))) + (math.sin((y * 30.0)) * math.cos((z * 30.0)))) + (math.sin((z * 30.0)) * math.cos((x * 30.0))))) - 0.2)) <= -0.1: tmp = fmax(((-30.0 * z) - 25.0), (math.fabs((t_2 + (((1.0 / math.pow(t_0, -2.0)) - (1.0 / math.pow(t_1, -2.0))) / (t_0 - t_1)))) - 0.2)) else: tmp = fmax((math.hypot((z * 30.0), math.hypot((y * 30.0), (30.0 * x))) - 25.0), (math.fabs((t_2 + (math.cos((30.0 * z)) * math.sin((30.0 * y))))) - 0.2)) return tmp
function code(x, y, z) t_0 = Float64(sin(Float64(30.0 * Float64(y - z))) * 0.5) t_1 = Float64(sin(Float64(30.0 * Float64(z + y))) * 0.5) t_2 = sin(Float64(30.0 * z)) tmp = 0.0 if (fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) <= -0.1) tmp = fmax(Float64(Float64(-30.0 * z) - 25.0), Float64(abs(Float64(t_2 + Float64(Float64(Float64(1.0 / (t_0 ^ -2.0)) - Float64(1.0 / (t_1 ^ -2.0))) / Float64(t_0 - t_1)))) - 0.2)); else tmp = fmax(Float64(hypot(Float64(z * 30.0), hypot(Float64(y * 30.0), Float64(30.0 * x))) - 25.0), Float64(abs(Float64(t_2 + Float64(cos(Float64(30.0 * z)) * sin(Float64(30.0 * y))))) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = sin((30.0 * (y - z))) * 0.5; t_1 = sin((30.0 * (z + y))) * 0.5; t_2 = sin((30.0 * z)); tmp = 0.0; if (max((sqrt(((((x * 30.0) ^ 2.0) + ((y * 30.0) ^ 2.0)) + ((z * 30.0) ^ 2.0))) - 25.0), (abs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)) <= -0.1) tmp = max(((-30.0 * z) - 25.0), (abs((t_2 + (((1.0 / (t_0 ^ -2.0)) - (1.0 / (t_1 ^ -2.0))) / (t_0 - t_1)))) - 0.2)); else tmp = max((hypot((z * 30.0), hypot((y * 30.0), (30.0 * x))) - 25.0), (abs((t_2 + (cos((30.0 * z)) * sin((30.0 * y))))) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[N[(30.0 * N[(y - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[N[(30.0 * N[(z + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], -0.1], N[Max[N[(N[(-30.0 * z), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(t$95$2 + N[(N[(N[(1.0 / N[Power[t$95$0, -2.0], $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[Power[t$95$1, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[Sqrt[N[(z * 30.0), $MachinePrecision] ^ 2 + N[Sqrt[N[(y * 30.0), $MachinePrecision] ^ 2 + N[(30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(t$95$2 + N[(N[Cos[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(30.0 * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \sin \left(30 \cdot \left(y - z\right)\right) \cdot 0.5\\
t_1 := \sin \left(30 \cdot \left(z + y\right)\right) \cdot 0.5\\
t_2 := \sin \left(30 \cdot z\right)\\
\mathbf{if}\;\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq -0.1:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z - 25, \left|t\_2 + \frac{\frac{1}{{t\_0}^{-2}} - \frac{1}{{t\_1}^{-2}}}{t\_0 - t\_1}\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(z \cdot 30, \mathsf{hypot}\left(y \cdot 30, 30 \cdot x\right)\right) - 25, \left|t\_2 + \cos \left(30 \cdot z\right) \cdot \sin \left(30 \cdot y\right)\right| - 0.2\right)\\
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < -0.10000000000000001Initial program 35.9%
Taylor expanded in z around -inf
lower-*.f6419.7%
Applied rewrites19.7%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6419.3%
Applied rewrites19.3%
Applied rewrites22.7%
if -0.10000000000000001 < (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) Initial program 35.9%
Applied rewrites49.3%
lift-sqrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
sqrt-prodN/A
metadata-evalN/A
sqrt-unprodN/A
metadata-evalN/A
fabs-mulN/A
*-commutativeN/A
lift-*.f64N/A
rem-sqrt-squareN/A
sqr-neg-revN/A
rem-sqrt-squareN/A
rem-sqrt-squareN/A
sqr-neg-revN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-*.f64N/A
Applied rewrites89.2%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6489.2%
Applied rewrites89.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0))))
(if (<=
(fmax
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* t_0 (cos (* x 30.0)))))
0.2))
-0.1)
(fmax
(- (* -30.0 y) 25.0)
(-
(fabs
(/
(fma
(* (* x x) x)
27000.0
(* (* (- 1.0 (cos (* z 60.0))) 0.5) t_0))
(fma (* 900.0 x) x (* t_0 (fma -30.0 x t_0)))))
0.2))
(fmax
(- (hypot (* z 30.0) (hypot (* y 30.0) (* 30.0 x))) 25.0)
(-
(fabs
(+ (sin (* 30.0 z)) (* (cos (* 30.0 z)) (sin (* 30.0 y)))))
0.2)))))double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double tmp;
if (fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (t_0 * cos((x * 30.0))))) - 0.2)) <= -0.1) {
tmp = fmax(((-30.0 * y) - 25.0), (fabs((fma(((x * x) * x), 27000.0, (((1.0 - cos((z * 60.0))) * 0.5) * t_0)) / fma((900.0 * x), x, (t_0 * fma(-30.0, x, t_0))))) - 0.2));
} else {
tmp = fmax((hypot((z * 30.0), hypot((y * 30.0), (30.0 * x))) - 25.0), (fabs((sin((30.0 * z)) + (cos((30.0 * z)) * sin((30.0 * y))))) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) tmp = 0.0 if (fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(t_0 * cos(Float64(x * 30.0))))) - 0.2)) <= -0.1) tmp = fmax(Float64(Float64(-30.0 * y) - 25.0), Float64(abs(Float64(fma(Float64(Float64(x * x) * x), 27000.0, Float64(Float64(Float64(1.0 - cos(Float64(z * 60.0))) * 0.5) * t_0)) / fma(Float64(900.0 * x), x, Float64(t_0 * fma(-30.0, x, t_0))))) - 0.2)); else tmp = fmax(Float64(hypot(Float64(z * 30.0), hypot(Float64(y * 30.0), Float64(30.0 * x))) - 25.0), Float64(abs(Float64(sin(Float64(30.0 * z)) + Float64(cos(Float64(30.0 * z)) * sin(Float64(30.0 * y))))) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], -0.1], N[Max[N[(N[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * 27000.0 + N[(N[(N[(1.0 - N[Cos[N[(z * 60.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[(900.0 * x), $MachinePrecision] * x + N[(t$95$0 * N[(-30.0 * x + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[Sqrt[N[(z * 30.0), $MachinePrecision] ^ 2 + N[Sqrt[N[(y * 30.0), $MachinePrecision] ^ 2 + N[(30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(30.0 * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
\mathbf{if}\;\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + t\_0 \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq -0.1:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, \left|\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot x, 27000, \left(\left(1 - \cos \left(z \cdot 60\right)\right) \cdot 0.5\right) \cdot t\_0\right)}{\mathsf{fma}\left(900 \cdot x, x, t\_0 \cdot \mathsf{fma}\left(-30, x, t\_0\right)\right)}\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(z \cdot 30, \mathsf{hypot}\left(y \cdot 30, 30 \cdot x\right)\right) - 25, \left|\sin \left(30 \cdot z\right) + \cos \left(30 \cdot z\right) \cdot \sin \left(30 \cdot y\right)\right| - 0.2\right)\\
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < -0.10000000000000001Initial program 35.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.9%
Applied rewrites35.9%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
Taylor expanded in y around -inf
lower-*.f6446.9%
Applied rewrites46.9%
Applied rewrites25.1%
if -0.10000000000000001 < (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) Initial program 35.9%
Applied rewrites49.3%
lift-sqrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
sqrt-prodN/A
metadata-evalN/A
sqrt-unprodN/A
metadata-evalN/A
fabs-mulN/A
*-commutativeN/A
lift-*.f64N/A
rem-sqrt-squareN/A
sqr-neg-revN/A
rem-sqrt-squareN/A
rem-sqrt-squareN/A
sqr-neg-revN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-*.f64N/A
Applied rewrites89.2%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6489.2%
Applied rewrites89.2%
(FPCore (x y z) :precision binary64 (fmax (- (hypot (* z 30.0) (hypot (* y 30.0) (* 30.0 x))) 25.0) (- (fabs (+ (sin (* 30.0 z)) (* (cos (* 30.0 z)) (sin (* 30.0 y))))) 0.2)))
double code(double x, double y, double z) {
return fmax((hypot((z * 30.0), hypot((y * 30.0), (30.0 * x))) - 25.0), (fabs((sin((30.0 * z)) + (cos((30.0 * z)) * sin((30.0 * y))))) - 0.2));
}
public static double code(double x, double y, double z) {
return fmax((Math.hypot((z * 30.0), Math.hypot((y * 30.0), (30.0 * x))) - 25.0), (Math.abs((Math.sin((30.0 * z)) + (Math.cos((30.0 * z)) * Math.sin((30.0 * y))))) - 0.2));
}
def code(x, y, z): return fmax((math.hypot((z * 30.0), math.hypot((y * 30.0), (30.0 * x))) - 25.0), (math.fabs((math.sin((30.0 * z)) + (math.cos((30.0 * z)) * math.sin((30.0 * y))))) - 0.2))
function code(x, y, z) return fmax(Float64(hypot(Float64(z * 30.0), hypot(Float64(y * 30.0), Float64(30.0 * x))) - 25.0), Float64(abs(Float64(sin(Float64(30.0 * z)) + Float64(cos(Float64(30.0 * z)) * sin(Float64(30.0 * y))))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((hypot((z * 30.0), hypot((y * 30.0), (30.0 * x))) - 25.0), (abs((sin((30.0 * z)) + (cos((30.0 * z)) * sin((30.0 * y))))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(z * 30.0), $MachinePrecision] ^ 2 + N[Sqrt[N[(y * 30.0), $MachinePrecision] ^ 2 + N[(30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(30.0 * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\mathsf{max}\left(\mathsf{hypot}\left(z \cdot 30, \mathsf{hypot}\left(y \cdot 30, 30 \cdot x\right)\right) - 25, \left|\sin \left(30 \cdot z\right) + \cos \left(30 \cdot z\right) \cdot \sin \left(30 \cdot y\right)\right| - 0.2\right)
Initial program 35.9%
Applied rewrites49.3%
lift-sqrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
sqrt-prodN/A
metadata-evalN/A
sqrt-unprodN/A
metadata-evalN/A
fabs-mulN/A
*-commutativeN/A
lift-*.f64N/A
rem-sqrt-squareN/A
sqr-neg-revN/A
rem-sqrt-squareN/A
rem-sqrt-squareN/A
sqr-neg-revN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-*.f64N/A
Applied rewrites89.2%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6489.2%
Applied rewrites89.2%
(FPCore (x y z) :precision binary64 (fmax (- (hypot (* z 30.0) (hypot (* y 30.0) (* 30.0 x))) 25.0) (- (fabs (+ (sin (* 30.0 y)) (* 30.0 z))) 0.2)))
double code(double x, double y, double z) {
return fmax((hypot((z * 30.0), hypot((y * 30.0), (30.0 * x))) - 25.0), (fabs((sin((30.0 * y)) + (30.0 * z))) - 0.2));
}
public static double code(double x, double y, double z) {
return fmax((Math.hypot((z * 30.0), Math.hypot((y * 30.0), (30.0 * x))) - 25.0), (Math.abs((Math.sin((30.0 * y)) + (30.0 * z))) - 0.2));
}
def code(x, y, z): return fmax((math.hypot((z * 30.0), math.hypot((y * 30.0), (30.0 * x))) - 25.0), (math.fabs((math.sin((30.0 * y)) + (30.0 * z))) - 0.2))
function code(x, y, z) return fmax(Float64(hypot(Float64(z * 30.0), hypot(Float64(y * 30.0), Float64(30.0 * x))) - 25.0), Float64(abs(Float64(sin(Float64(30.0 * y)) + Float64(30.0 * z))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((hypot((z * 30.0), hypot((y * 30.0), (30.0 * x))) - 25.0), (abs((sin((30.0 * y)) + (30.0 * z))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(z * 30.0), $MachinePrecision] ^ 2 + N[Sqrt[N[(y * 30.0), $MachinePrecision] ^ 2 + N[(30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * y), $MachinePrecision]], $MachinePrecision] + N[(30.0 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\mathsf{max}\left(\mathsf{hypot}\left(z \cdot 30, \mathsf{hypot}\left(y \cdot 30, 30 \cdot x\right)\right) - 25, \left|\sin \left(30 \cdot y\right) + 30 \cdot z\right| - 0.2\right)
Initial program 35.9%
Applied rewrites49.3%
lift-sqrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
sqrt-prodN/A
metadata-evalN/A
sqrt-unprodN/A
metadata-evalN/A
fabs-mulN/A
*-commutativeN/A
lift-*.f64N/A
rem-sqrt-squareN/A
sqr-neg-revN/A
rem-sqrt-squareN/A
rem-sqrt-squareN/A
sqr-neg-revN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-*.f64N/A
Applied rewrites89.2%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6489.2%
Applied rewrites89.2%
Taylor expanded in z around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f6488.9%
Applied rewrites88.9%
(FPCore (x y z)
:precision binary64
(if (<=
(fmax
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2))
2e+141)
(fmax
(- (hypot (* (sqrt (fma y y (* x x))) 30.0) (* z 30.0)) 25.0)
(- (fabs (+ (sin (* 30.0 z)) (* 30.0 x))) 0.2))
(fmax (- (* -30.0 y) 25.0) (- (fabs (fma 30.0 x (* 30.0 z))) 0.2))))double code(double x, double y, double z) {
double tmp;
if (fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)) <= 2e+141) {
tmp = fmax((hypot((sqrt(fma(y, y, (x * x))) * 30.0), (z * 30.0)) - 25.0), (fabs((sin((30.0 * z)) + (30.0 * x))) - 0.2));
} else {
tmp = fmax(((-30.0 * y) - 25.0), (fabs(fma(30.0, x, (30.0 * z))) - 0.2));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) <= 2e+141) tmp = fmax(Float64(hypot(Float64(sqrt(fma(y, y, Float64(x * x))) * 30.0), Float64(z * 30.0)) - 25.0), Float64(abs(Float64(sin(Float64(30.0 * z)) + Float64(30.0 * x))) - 0.2)); else tmp = fmax(Float64(Float64(-30.0 * y) - 25.0), Float64(abs(fma(30.0, x, Float64(30.0 * z))) - 0.2)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 2e+141], N[Max[N[(N[Sqrt[N[(N[Sqrt[N[(y * y + N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 30.0), $MachinePrecision] ^ 2 + N[(z * 30.0), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] + N[(30.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x + N[(30.0 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq 2 \cdot 10^{+141}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(\sqrt{\mathsf{fma}\left(y, y, x \cdot x\right)} \cdot 30, z \cdot 30\right) - 25, \left|\sin \left(30 \cdot z\right) + 30 \cdot x\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, \left|\mathsf{fma}\left(30, x, 30 \cdot z\right)\right| - 0.2\right)\\
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 2e141Initial program 35.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.9%
Applied rewrites35.9%
Applied rewrites49.5%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f6449.3%
Applied rewrites49.3%
if 2e141 < (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) Initial program 35.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.9%
Applied rewrites35.9%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
Taylor expanded in y around -inf
lower-*.f6446.9%
Applied rewrites46.9%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
(FPCore (x y z) :precision binary64 (fmax (- (* -30.0 y) 25.0) (- (fabs (fma 30.0 x (* 30.0 z))) 0.2)))
double code(double x, double y, double z) {
return fmax(((-30.0 * y) - 25.0), (fabs(fma(30.0, x, (30.0 * z))) - 0.2));
}
function code(x, y, z) return fmax(Float64(Float64(-30.0 * y) - 25.0), Float64(abs(fma(30.0, x, Float64(30.0 * z))) - 0.2)) end
code[x_, y_, z_] := N[Max[N[(N[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x + N[(30.0 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\mathsf{max}\left(-30 \cdot y - 25, \left|\mathsf{fma}\left(30, x, 30 \cdot z\right)\right| - 0.2\right)
Initial program 35.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.9%
Applied rewrites35.9%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f6435.6%
Applied rewrites35.6%
Taylor expanded in y around -inf
lower-*.f6446.9%
Applied rewrites46.9%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
herbie shell --seed 2025322
(FPCore (x y z)
:name "Gyroid sphere"
:precision binary64
(fmax (- (sqrt (+ (+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0)) (pow (* z 30.0) 2.0))) 25.0) (- (fabs (+ (+ (* (sin (* x 30.0)) (cos (* y 30.0))) (* (sin (* y 30.0)) (cos (* z 30.0)))) (* (sin (* z 30.0)) (cos (* x 30.0))))) 0.2)))