
(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));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
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]
\begin{array}{l}
\\
\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)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 4 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));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
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]
\begin{array}{l}
\\
\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)
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* 30.0 x))) (t_1 (- (fabs (+ (sin (* z 30.0)) t_0)) 0.2)))
(if (<= y -4.5e+152)
(fmax (* -30.0 y) t_1)
(if (<= y 4.5e+152)
(fmax
(- (sqrt (* 900.0 (+ (* x x) (* y y)))) 25.0)
(- (fabs (+ (* (* z 30.0) 1.0) t_0)) 0.2))
(fmax (* y 30.0) t_1)))))
double code(double x, double y, double z) {
double t_0 = sin((30.0 * x));
double t_1 = fabs((sin((z * 30.0)) + t_0)) - 0.2;
double tmp;
if (y <= -4.5e+152) {
tmp = fmax((-30.0 * y), t_1);
} else if (y <= 4.5e+152) {
tmp = fmax((sqrt((900.0 * ((x * x) + (y * y)))) - 25.0), (fabs((((z * 30.0) * 1.0) + t_0)) - 0.2));
} else {
tmp = fmax((y * 30.0), t_1);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
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
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sin((30.0d0 * x))
t_1 = abs((sin((z * 30.0d0)) + t_0)) - 0.2d0
if (y <= (-4.5d+152)) then
tmp = fmax(((-30.0d0) * y), t_1)
else if (y <= 4.5d+152) then
tmp = fmax((sqrt((900.0d0 * ((x * x) + (y * y)))) - 25.0d0), (abs((((z * 30.0d0) * 1.0d0) + t_0)) - 0.2d0))
else
tmp = fmax((y * 30.0d0), t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.sin((30.0 * x));
double t_1 = Math.abs((Math.sin((z * 30.0)) + t_0)) - 0.2;
double tmp;
if (y <= -4.5e+152) {
tmp = fmax((-30.0 * y), t_1);
} else if (y <= 4.5e+152) {
tmp = fmax((Math.sqrt((900.0 * ((x * x) + (y * y)))) - 25.0), (Math.abs((((z * 30.0) * 1.0) + t_0)) - 0.2));
} else {
tmp = fmax((y * 30.0), t_1);
}
return tmp;
}
def code(x, y, z): t_0 = math.sin((30.0 * x)) t_1 = math.fabs((math.sin((z * 30.0)) + t_0)) - 0.2 tmp = 0 if y <= -4.5e+152: tmp = fmax((-30.0 * y), t_1) elif y <= 4.5e+152: tmp = fmax((math.sqrt((900.0 * ((x * x) + (y * y)))) - 25.0), (math.fabs((((z * 30.0) * 1.0) + t_0)) - 0.2)) else: tmp = fmax((y * 30.0), t_1) return tmp
function code(x, y, z) t_0 = sin(Float64(30.0 * x)) t_1 = Float64(abs(Float64(sin(Float64(z * 30.0)) + t_0)) - 0.2) tmp = 0.0 if (y <= -4.5e+152) tmp = fmax(Float64(-30.0 * y), t_1); elseif (y <= 4.5e+152) tmp = fmax(Float64(sqrt(Float64(900.0 * Float64(Float64(x * x) + Float64(y * y)))) - 25.0), Float64(abs(Float64(Float64(Float64(z * 30.0) * 1.0) + t_0)) - 0.2)); else tmp = fmax(Float64(y * 30.0), t_1); end return tmp end
function tmp_2 = code(x, y, z) t_0 = sin((30.0 * x)); t_1 = abs((sin((z * 30.0)) + t_0)) - 0.2; tmp = 0.0; if (y <= -4.5e+152) tmp = max((-30.0 * y), t_1); elseif (y <= 4.5e+152) tmp = max((sqrt((900.0 * ((x * x) + (y * y)))) - 25.0), (abs((((z * 30.0) * 1.0) + t_0)) - 0.2)); else tmp = max((y * 30.0), t_1); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[y, -4.5e+152], N[Max[N[(-30.0 * y), $MachinePrecision], t$95$1], $MachinePrecision], If[LessEqual[y, 4.5e+152], N[Max[N[(N[Sqrt[N[(900.0 * N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(z * 30.0), $MachinePrecision] * 1.0), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(y * 30.0), $MachinePrecision], t$95$1], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(30 \cdot x\right)\\
t_1 := \left|\sin \left(z \cdot 30\right) + t\_0\right| - 0.2\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{+152}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, t\_1\right)\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+152}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{900 \cdot \left(x \cdot x + y \cdot y\right)} - 25, \left|\left(z \cdot 30\right) \cdot 1 + t\_0\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot 30, t\_1\right)\\
\end{array}
\end{array}
if y < -4.5000000000000001e152Initial program 9.9%
Taylor expanded in z around 0
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f649.9
Applied rewrites9.9%
Taylor expanded in y around 0
lower-sin.f64N/A
lift-*.f649.9
Applied rewrites9.9%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f649.9
Applied rewrites9.9%
Taylor expanded in y around -inf
lift-*.f6476.6
Applied rewrites76.6%
if -4.5000000000000001e152 < y < 4.5000000000000001e152Initial program 67.6%
Taylor expanded in z around 0
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6453.9
Applied rewrites53.9%
Taylor expanded in y around 0
lower-sin.f64N/A
lift-*.f6452.9
Applied rewrites52.9%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f6474.6
Applied rewrites74.6%
Taylor expanded in x around 0
Applied rewrites79.3%
if 4.5000000000000001e152 < y Initial program 6.8%
Taylor expanded in z around 0
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f646.8
Applied rewrites6.8%
Taylor expanded in y around 0
lower-sin.f64N/A
lift-*.f646.8
Applied rewrites6.8%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f646.8
Applied rewrites6.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6479.7
Applied rewrites79.7%
Final simplification79.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0))) (t_1 (- (fabs (+ t_0 (* 30.0 x))) 0.2)))
(if (<=
(fmax
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(* t_0 (cos (* x 30.0)))
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))))
0.2))
5e+152)
(fmax (- (sqrt (* 900.0 (+ (* x x) (* y y)))) 25.0) t_1)
(fmax (* -30.0 x) t_1))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double t_1 = fabs((t_0 + (30.0 * x))) - 0.2;
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(((t_0 * cos((x * 30.0))) + ((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))))) - 0.2)) <= 5e+152) {
tmp = fmax((sqrt((900.0 * ((x * x) + (y * y)))) - 25.0), t_1);
} else {
tmp = fmax((-30.0 * x), t_1);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
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
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sin((z * 30.0d0))
t_1 = abs((t_0 + (30.0d0 * x))) - 0.2d0
if (fmax((sqrt(((((x * 30.0d0) ** 2.0d0) + ((y * 30.0d0) ** 2.0d0)) + ((z * 30.0d0) ** 2.0d0))) - 25.0d0), (abs(((t_0 * cos((x * 30.0d0))) + ((sin((x * 30.0d0)) * cos((y * 30.0d0))) + (sin((y * 30.0d0)) * cos((z * 30.0d0)))))) - 0.2d0)) <= 5d+152) then
tmp = fmax((sqrt((900.0d0 * ((x * x) + (y * y)))) - 25.0d0), t_1)
else
tmp = fmax(((-30.0d0) * x), t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.sin((z * 30.0));
double t_1 = Math.abs((t_0 + (30.0 * x))) - 0.2;
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(((t_0 * Math.cos((x * 30.0))) + ((Math.sin((x * 30.0)) * Math.cos((y * 30.0))) + (Math.sin((y * 30.0)) * Math.cos((z * 30.0)))))) - 0.2)) <= 5e+152) {
tmp = fmax((Math.sqrt((900.0 * ((x * x) + (y * y)))) - 25.0), t_1);
} else {
tmp = fmax((-30.0 * x), t_1);
}
return tmp;
}
def code(x, y, z): t_0 = math.sin((z * 30.0)) t_1 = math.fabs((t_0 + (30.0 * x))) - 0.2 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(((t_0 * math.cos((x * 30.0))) + ((math.sin((x * 30.0)) * math.cos((y * 30.0))) + (math.sin((y * 30.0)) * math.cos((z * 30.0)))))) - 0.2)) <= 5e+152: tmp = fmax((math.sqrt((900.0 * ((x * x) + (y * y)))) - 25.0), t_1) else: tmp = fmax((-30.0 * x), t_1) return tmp
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) t_1 = Float64(abs(Float64(t_0 + Float64(30.0 * x))) - 0.2) 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(t_0 * cos(Float64(x * 30.0))) + Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))))) - 0.2)) <= 5e+152) tmp = fmax(Float64(sqrt(Float64(900.0 * Float64(Float64(x * x) + Float64(y * y)))) - 25.0), t_1); else tmp = fmax(Float64(-30.0 * x), t_1); end return tmp end
function tmp_2 = code(x, y, z) t_0 = sin((z * 30.0)); t_1 = abs((t_0 + (30.0 * x))) - 0.2; tmp = 0.0; if (max((sqrt(((((x * 30.0) ^ 2.0) + ((y * 30.0) ^ 2.0)) + ((z * 30.0) ^ 2.0))) - 25.0), (abs(((t_0 * cos((x * 30.0))) + ((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))))) - 0.2)) <= 5e+152) tmp = max((sqrt((900.0 * ((x * x) + (y * y)))) - 25.0), t_1); else tmp = max((-30.0 * x), t_1); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[N[(t$95$0 + N[(30.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $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[(t$95$0 * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 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]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 5e+152], N[Max[N[(N[Sqrt[N[(900.0 * N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision], N[Max[N[(-30.0 * x), $MachinePrecision], t$95$1], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
t_1 := \left|t\_0 + 30 \cdot x\right| - 0.2\\
\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|t\_0 \cdot \cos \left(x \cdot 30\right) + \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)\right| - 0.2\right) \leq 5 \cdot 10^{+152}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{900 \cdot \left(x \cdot x + y \cdot y\right)} - 25, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, t\_1\right)\\
\end{array}
\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))) < 5e152Initial program 99.9%
Taylor expanded in z around 0
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.9
Applied rewrites78.9%
Taylor expanded in y around 0
lower-sin.f64N/A
lift-*.f6477.4
Applied rewrites77.4%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6477.0
Applied rewrites77.0%
Taylor expanded in x around 0
lift-*.f6475.8
Applied rewrites75.8%
if 5e152 < (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 9.4%
Taylor expanded in x around -inf
lower-*.f6418.2
Applied rewrites18.2%
Taylor expanded in y around 0
lower-sin.f64N/A
lift-*.f6418.0
Applied rewrites18.0%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6418.0
Applied rewrites18.0%
Taylor expanded in x around 0
lift-*.f6434.2
Applied rewrites34.2%
Final simplification53.8%
(FPCore (x y z)
:precision binary64
(if (or (<= x -6.2e+145) (not (<= x 5.3e+96)))
(fmax (* -30.0 x) (- (fabs (+ (sin (* z 30.0)) (* 30.0 x))) 0.2))
(fmax
(- (sqrt (* 900.0 (+ (* x x) (* y y)))) 25.0)
(- (fabs (+ (* (* z 30.0) 1.0) (sin (* 30.0 x)))) 0.2))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -6.2e+145) || !(x <= 5.3e+96)) {
tmp = fmax((-30.0 * x), (fabs((sin((z * 30.0)) + (30.0 * x))) - 0.2));
} else {
tmp = fmax((sqrt((900.0 * ((x * x) + (y * y)))) - 25.0), (fabs((((z * 30.0) * 1.0) + sin((30.0 * x)))) - 0.2));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
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
real(8) :: tmp
if ((x <= (-6.2d+145)) .or. (.not. (x <= 5.3d+96))) then
tmp = fmax(((-30.0d0) * x), (abs((sin((z * 30.0d0)) + (30.0d0 * x))) - 0.2d0))
else
tmp = fmax((sqrt((900.0d0 * ((x * x) + (y * y)))) - 25.0d0), (abs((((z * 30.0d0) * 1.0d0) + sin((30.0d0 * x)))) - 0.2d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -6.2e+145) || !(x <= 5.3e+96)) {
tmp = fmax((-30.0 * x), (Math.abs((Math.sin((z * 30.0)) + (30.0 * x))) - 0.2));
} else {
tmp = fmax((Math.sqrt((900.0 * ((x * x) + (y * y)))) - 25.0), (Math.abs((((z * 30.0) * 1.0) + Math.sin((30.0 * x)))) - 0.2));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -6.2e+145) or not (x <= 5.3e+96): tmp = fmax((-30.0 * x), (math.fabs((math.sin((z * 30.0)) + (30.0 * x))) - 0.2)) else: tmp = fmax((math.sqrt((900.0 * ((x * x) + (y * y)))) - 25.0), (math.fabs((((z * 30.0) * 1.0) + math.sin((30.0 * x)))) - 0.2)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -6.2e+145) || !(x <= 5.3e+96)) tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(sin(Float64(z * 30.0)) + Float64(30.0 * x))) - 0.2)); else tmp = fmax(Float64(sqrt(Float64(900.0 * Float64(Float64(x * x) + Float64(y * y)))) - 25.0), Float64(abs(Float64(Float64(Float64(z * 30.0) * 1.0) + sin(Float64(30.0 * x)))) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -6.2e+145) || ~((x <= 5.3e+96))) tmp = max((-30.0 * x), (abs((sin((z * 30.0)) + (30.0 * x))) - 0.2)); else tmp = max((sqrt((900.0 * ((x * x) + (y * y)))) - 25.0), (abs((((z * 30.0) * 1.0) + sin((30.0 * x)))) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -6.2e+145], N[Not[LessEqual[x, 5.3e+96]], $MachinePrecision]], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] + N[(30.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[Sqrt[N[(900.0 * N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(z * 30.0), $MachinePrecision] * 1.0), $MachinePrecision] + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+145} \lor \neg \left(x \leq 5.3 \cdot 10^{+96}\right):\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|\sin \left(z \cdot 30\right) + 30 \cdot x\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{900 \cdot \left(x \cdot x + y \cdot y\right)} - 25, \left|\left(z \cdot 30\right) \cdot 1 + \sin \left(30 \cdot x\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if x < -6.19999999999999977e145 or 5.29999999999999971e96 < x Initial program 19.4%
Taylor expanded in x around -inf
lower-*.f6436.4
Applied rewrites36.4%
Taylor expanded in y around 0
lower-sin.f64N/A
lift-*.f6436.4
Applied rewrites36.4%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6436.2
Applied rewrites36.2%
Taylor expanded in x around 0
lift-*.f6475.0
Applied rewrites75.0%
if -6.19999999999999977e145 < x < 5.29999999999999971e96Initial program 63.6%
Taylor expanded in z around 0
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6449.9
Applied rewrites49.9%
Taylor expanded in y around 0
lower-sin.f64N/A
lift-*.f6449.0
Applied rewrites49.0%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f6470.5
Applied rewrites70.5%
Taylor expanded in x around 0
Applied rewrites75.2%
Final simplification75.2%
(FPCore (x y z) :precision binary64 (fmax (* -30.0 x) (- (fabs (+ (sin (* z 30.0)) (* 30.0 x))) 0.2)))
double code(double x, double y, double z) {
return fmax((-30.0 * x), (fabs((sin((z * 30.0)) + (30.0 * x))) - 0.2));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
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(((-30.0d0) * x), (abs((sin((z * 30.0d0)) + (30.0d0 * x))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((-30.0 * x), (Math.abs((Math.sin((z * 30.0)) + (30.0 * x))) - 0.2));
}
def code(x, y, z): return fmax((-30.0 * x), (math.fabs((math.sin((z * 30.0)) + (30.0 * x))) - 0.2))
function code(x, y, z) return fmax(Float64(-30.0 * x), Float64(abs(Float64(sin(Float64(z * 30.0)) + Float64(30.0 * x))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((-30.0 * x), (abs((sin((z * 30.0)) + (30.0 * x))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] + N[(30.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(-30 \cdot x, \left|\sin \left(z \cdot 30\right) + 30 \cdot x\right| - 0.2\right)
\end{array}
Initial program 52.2%
Taylor expanded in x around -inf
lower-*.f6418.6
Applied rewrites18.6%
Taylor expanded in y around 0
lower-sin.f64N/A
lift-*.f6417.9
Applied rewrites17.9%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6417.8
Applied rewrites17.8%
Taylor expanded in x around 0
lift-*.f6430.1
Applied rewrites30.1%
Final simplification30.1%
herbie shell --seed 2025058
(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)))