
(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 10 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 (- (* 30.0 (hypot x y)) 25.0)))
(if (<= x -2.6e+49)
(fmax t_0 (- (fabs (* 30.0 x)) 0.2))
(if (<= x 11200.0)
(fmax
(- (* 30.0 (hypot y z)) 25.0)
(-
(fabs
(+
(* (sin (* z 30.0)) (cos (* x 30.0)))
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))))
0.2))
(fmax t_0 (- (fabs (sin (* 30.0 x))) 0.2))))))
double code(double x, double y, double z) {
double t_0 = (30.0 * hypot(x, y)) - 25.0;
double tmp;
if (x <= -2.6e+49) {
tmp = fmax(t_0, (fabs((30.0 * x)) - 0.2));
} else if (x <= 11200.0) {
tmp = fmax(((30.0 * hypot(y, z)) - 25.0), (fabs(((sin((z * 30.0)) * cos((x * 30.0))) + ((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))))) - 0.2));
} else {
tmp = fmax(t_0, (fabs(sin((30.0 * x))) - 0.2));
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = (30.0 * Math.hypot(x, y)) - 25.0;
double tmp;
if (x <= -2.6e+49) {
tmp = fmax(t_0, (Math.abs((30.0 * x)) - 0.2));
} else if (x <= 11200.0) {
tmp = fmax(((30.0 * Math.hypot(y, z)) - 25.0), (Math.abs(((Math.sin((z * 30.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));
} else {
tmp = fmax(t_0, (Math.abs(Math.sin((30.0 * x))) - 0.2));
}
return tmp;
}
def code(x, y, z): t_0 = (30.0 * math.hypot(x, y)) - 25.0 tmp = 0 if x <= -2.6e+49: tmp = fmax(t_0, (math.fabs((30.0 * x)) - 0.2)) elif x <= 11200.0: tmp = fmax(((30.0 * math.hypot(y, z)) - 25.0), (math.fabs(((math.sin((z * 30.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)) else: tmp = fmax(t_0, (math.fabs(math.sin((30.0 * x))) - 0.2)) return tmp
function code(x, y, z) t_0 = Float64(Float64(30.0 * hypot(x, y)) - 25.0) tmp = 0.0 if (x <= -2.6e+49) tmp = fmax(t_0, Float64(abs(Float64(30.0 * x)) - 0.2)); elseif (x <= 11200.0) tmp = fmax(Float64(Float64(30.0 * hypot(y, z)) - 25.0), Float64(abs(Float64(Float64(sin(Float64(z * 30.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)); else tmp = fmax(t_0, Float64(abs(sin(Float64(30.0 * x))) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (30.0 * hypot(x, y)) - 25.0; tmp = 0.0; if (x <= -2.6e+49) tmp = max(t_0, (abs((30.0 * x)) - 0.2)); elseif (x <= 11200.0) tmp = max(((30.0 * hypot(y, z)) - 25.0), (abs(((sin((z * 30.0)) * cos((x * 30.0))) + ((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))))) - 0.2)); else tmp = max(t_0, (abs(sin((30.0 * x))) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(30.0 * N[Sqrt[x ^ 2 + y ^ 2], $MachinePrecision]), $MachinePrecision] - 25.0), $MachinePrecision]}, If[LessEqual[x, -2.6e+49], N[Max[t$95$0, N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 11200.0], N[Max[N[(N[(30.0 * N[Sqrt[y ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * 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], N[Max[t$95$0, N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 30 \cdot \mathsf{hypot}\left(x, y\right) - 25\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{max}\left(t\_0, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{elif}\;x \leq 11200:\\
\;\;\;\;\mathsf{max}\left(30 \cdot \mathsf{hypot}\left(y, z\right) - 25, \left|\sin \left(z \cdot 30\right) \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)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(t\_0, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if x < -2.59999999999999989e49Initial program 37.1%
Taylor expanded in z around 0
Applied rewrites89.9%
Taylor expanded in y around 0
Applied rewrites89.9%
Taylor expanded in z around 0
Applied rewrites89.9%
Taylor expanded in x around 0
Applied rewrites89.9%
if -2.59999999999999989e49 < x < 11200Initial program 55.5%
Taylor expanded in x around 0
Applied rewrites100.0%
if 11200 < x Initial program 39.4%
Taylor expanded in z around 0
Applied rewrites85.8%
Taylor expanded in y around 0
Applied rewrites85.8%
Taylor expanded in z around 0
Applied rewrites85.8%
Final simplification94.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* 30.0 x))) (t_1 (- (* 30.0 (hypot x y)) 25.0)))
(if (<= x -2.6e+49)
(fmax t_1 (- (fabs (* 30.0 x)) 0.2))
(if (<= x 11200.0)
(fmax
(- (hypot (* y 30.0) (* z 30.0)) 25.0)
(- (fabs (fma (sin (* z 30.0)) (cos (* 30.0 x)) t_0)) 0.2))
(fmax t_1 (- (fabs t_0) 0.2))))))
double code(double x, double y, double z) {
double t_0 = sin((30.0 * x));
double t_1 = (30.0 * hypot(x, y)) - 25.0;
double tmp;
if (x <= -2.6e+49) {
tmp = fmax(t_1, (fabs((30.0 * x)) - 0.2));
} else if (x <= 11200.0) {
tmp = fmax((hypot((y * 30.0), (z * 30.0)) - 25.0), (fabs(fma(sin((z * 30.0)), cos((30.0 * x)), t_0)) - 0.2));
} else {
tmp = fmax(t_1, (fabs(t_0) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(30.0 * x)) t_1 = Float64(Float64(30.0 * hypot(x, y)) - 25.0) tmp = 0.0 if (x <= -2.6e+49) tmp = fmax(t_1, Float64(abs(Float64(30.0 * x)) - 0.2)); elseif (x <= 11200.0) tmp = fmax(Float64(hypot(Float64(y * 30.0), Float64(z * 30.0)) - 25.0), Float64(abs(fma(sin(Float64(z * 30.0)), cos(Float64(30.0 * x)), t_0)) - 0.2)); else tmp = fmax(t_1, Float64(abs(t_0) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(30.0 * N[Sqrt[x ^ 2 + y ^ 2], $MachinePrecision]), $MachinePrecision] - 25.0), $MachinePrecision]}, If[LessEqual[x, -2.6e+49], N[Max[t$95$1, N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 11200.0], N[Max[N[(N[Sqrt[N[(y * 30.0), $MachinePrecision] ^ 2 + N[(z * 30.0), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[t$95$1, N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(30 \cdot x\right)\\
t_1 := 30 \cdot \mathsf{hypot}\left(x, y\right) - 25\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{max}\left(t\_1, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{elif}\;x \leq 11200:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(y \cdot 30, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(30 \cdot x\right), t\_0\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(t\_1, \left|t\_0\right| - 0.2\right)\\
\end{array}
\end{array}
if x < -2.59999999999999989e49Initial program 37.1%
Taylor expanded in z around 0
Applied rewrites89.9%
Taylor expanded in y around 0
Applied rewrites89.9%
Taylor expanded in z around 0
Applied rewrites89.9%
Taylor expanded in x around 0
Applied rewrites89.9%
if -2.59999999999999989e49 < x < 11200Initial program 55.5%
Taylor expanded in z around 0
Applied rewrites60.5%
Taylor expanded in y around 0
Applied rewrites60.2%
Taylor expanded in x around 0
Applied rewrites99.6%
if 11200 < x Initial program 39.4%
Taylor expanded in z around 0
Applied rewrites85.8%
Taylor expanded in y around 0
Applied rewrites85.8%
Taylor expanded in z around 0
Applied rewrites85.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* 30.0 (hypot x y)) 25.0))
(t_1 (- (fabs (sin (* 30.0 x))) 0.2)))
(if (<= x -2.6e+49)
(fmax t_0 (- (fabs (* 30.0 x)) 0.2))
(if (<= x 11200.0)
(fmax (- (hypot (* y 30.0) (* z 30.0)) 25.0) t_1)
(fmax t_0 t_1)))))
double code(double x, double y, double z) {
double t_0 = (30.0 * hypot(x, y)) - 25.0;
double t_1 = fabs(sin((30.0 * x))) - 0.2;
double tmp;
if (x <= -2.6e+49) {
tmp = fmax(t_0, (fabs((30.0 * x)) - 0.2));
} else if (x <= 11200.0) {
tmp = fmax((hypot((y * 30.0), (z * 30.0)) - 25.0), t_1);
} else {
tmp = fmax(t_0, t_1);
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = (30.0 * Math.hypot(x, y)) - 25.0;
double t_1 = Math.abs(Math.sin((30.0 * x))) - 0.2;
double tmp;
if (x <= -2.6e+49) {
tmp = fmax(t_0, (Math.abs((30.0 * x)) - 0.2));
} else if (x <= 11200.0) {
tmp = fmax((Math.hypot((y * 30.0), (z * 30.0)) - 25.0), t_1);
} else {
tmp = fmax(t_0, t_1);
}
return tmp;
}
def code(x, y, z): t_0 = (30.0 * math.hypot(x, y)) - 25.0 t_1 = math.fabs(math.sin((30.0 * x))) - 0.2 tmp = 0 if x <= -2.6e+49: tmp = fmax(t_0, (math.fabs((30.0 * x)) - 0.2)) elif x <= 11200.0: tmp = fmax((math.hypot((y * 30.0), (z * 30.0)) - 25.0), t_1) else: tmp = fmax(t_0, t_1) return tmp
function code(x, y, z) t_0 = Float64(Float64(30.0 * hypot(x, y)) - 25.0) t_1 = Float64(abs(sin(Float64(30.0 * x))) - 0.2) tmp = 0.0 if (x <= -2.6e+49) tmp = fmax(t_0, Float64(abs(Float64(30.0 * x)) - 0.2)); elseif (x <= 11200.0) tmp = fmax(Float64(hypot(Float64(y * 30.0), Float64(z * 30.0)) - 25.0), t_1); else tmp = fmax(t_0, t_1); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (30.0 * hypot(x, y)) - 25.0; t_1 = abs(sin((30.0 * x))) - 0.2; tmp = 0.0; if (x <= -2.6e+49) tmp = max(t_0, (abs((30.0 * x)) - 0.2)); elseif (x <= 11200.0) tmp = max((hypot((y * 30.0), (z * 30.0)) - 25.0), t_1); else tmp = max(t_0, t_1); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(30.0 * N[Sqrt[x ^ 2 + y ^ 2], $MachinePrecision]), $MachinePrecision] - 25.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[x, -2.6e+49], N[Max[t$95$0, N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 11200.0], N[Max[N[(N[Sqrt[N[(y * 30.0), $MachinePrecision] ^ 2 + N[(z * 30.0), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision], N[Max[t$95$0, t$95$1], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 30 \cdot \mathsf{hypot}\left(x, y\right) - 25\\
t_1 := \left|\sin \left(30 \cdot x\right)\right| - 0.2\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{max}\left(t\_0, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{elif}\;x \leq 11200:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(y \cdot 30, z \cdot 30\right) - 25, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(t\_0, t\_1\right)\\
\end{array}
\end{array}
if x < -2.59999999999999989e49Initial program 37.1%
Taylor expanded in z around 0
Applied rewrites89.9%
Taylor expanded in y around 0
Applied rewrites89.9%
Taylor expanded in z around 0
Applied rewrites89.9%
Taylor expanded in x around 0
Applied rewrites89.9%
if -2.59999999999999989e49 < x < 11200Initial program 55.5%
Taylor expanded in z around 0
Applied rewrites60.5%
Taylor expanded in y around 0
Applied rewrites60.2%
Taylor expanded in z around 0
Applied rewrites59.0%
Taylor expanded in x around 0
Applied rewrites99.5%
if 11200 < x Initial program 39.4%
Taylor expanded in z around 0
Applied rewrites85.8%
Taylor expanded in y around 0
Applied rewrites85.8%
Taylor expanded in z around 0
Applied rewrites85.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 x))) 0.2)))
(if (<= z -3e+186)
(fmax (* -30.0 z) t_0)
(if (<= z 1.3e+84)
(fmax (- (* 30.0 (hypot x y)) 25.0) t_0)
(fmax (- (* z 30.0) 25.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs(sin((30.0 * x))) - 0.2;
double tmp;
if (z <= -3e+186) {
tmp = fmax((-30.0 * z), t_0);
} else if (z <= 1.3e+84) {
tmp = fmax(((30.0 * hypot(x, y)) - 25.0), t_0);
} else {
tmp = fmax(((z * 30.0) - 25.0), t_0);
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = Math.abs(Math.sin((30.0 * x))) - 0.2;
double tmp;
if (z <= -3e+186) {
tmp = fmax((-30.0 * z), t_0);
} else if (z <= 1.3e+84) {
tmp = fmax(((30.0 * Math.hypot(x, y)) - 25.0), t_0);
} else {
tmp = fmax(((z * 30.0) - 25.0), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((30.0 * x))) - 0.2 tmp = 0 if z <= -3e+186: tmp = fmax((-30.0 * z), t_0) elif z <= 1.3e+84: tmp = fmax(((30.0 * math.hypot(x, y)) - 25.0), t_0) else: tmp = fmax(((z * 30.0) - 25.0), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(30.0 * x))) - 0.2) tmp = 0.0 if (z <= -3e+186) tmp = fmax(Float64(-30.0 * z), t_0); elseif (z <= 1.3e+84) tmp = fmax(Float64(Float64(30.0 * hypot(x, y)) - 25.0), t_0); else tmp = fmax(Float64(Float64(z * 30.0) - 25.0), t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(sin((30.0 * x))) - 0.2; tmp = 0.0; if (z <= -3e+186) tmp = max((-30.0 * z), t_0); elseif (z <= 1.3e+84) tmp = max(((30.0 * hypot(x, y)) - 25.0), t_0); else tmp = max(((z * 30.0) - 25.0), t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[z, -3e+186], N[Max[N[(-30.0 * z), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[z, 1.3e+84], N[Max[N[(N[(30.0 * N[Sqrt[x ^ 2 + y ^ 2], $MachinePrecision]), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(N[(z * 30.0), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot x\right)\right| - 0.2\\
\mathbf{if}\;z \leq -3 \cdot 10^{+186}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, t\_0\right)\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+84}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot \mathsf{hypot}\left(x, y\right) - 25, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(z \cdot 30 - 25, t\_0\right)\\
\end{array}
\end{array}
if z < -2.99999999999999982e186Initial program 7.6%
Taylor expanded in z around 0
Applied rewrites8.4%
Taylor expanded in y around 0
Applied rewrites8.4%
Taylor expanded in z around 0
Applied rewrites7.6%
Taylor expanded in z around -inf
Applied rewrites95.4%
if -2.99999999999999982e186 < z < 1.3000000000000001e84Initial program 56.6%
Taylor expanded in z around 0
Applied rewrites91.2%
Taylor expanded in y around 0
Applied rewrites90.9%
Taylor expanded in z around 0
Applied rewrites90.4%
if 1.3000000000000001e84 < z Initial program 27.0%
Taylor expanded in z around 0
Applied rewrites26.3%
Taylor expanded in y around 0
Applied rewrites26.3%
Taylor expanded in z around 0
Applied rewrites25.5%
Taylor expanded in z around inf
Applied rewrites78.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 x))) 0.2)))
(if (<= z -3e+186)
(fmax (* -30.0 z) t_0)
(if (<= z 1.3e+84)
(fmax (- (* 30.0 (hypot x y)) 25.0) (- (fabs (* 30.0 x)) 0.2))
(fmax (- (* z 30.0) 25.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs(sin((30.0 * x))) - 0.2;
double tmp;
if (z <= -3e+186) {
tmp = fmax((-30.0 * z), t_0);
} else if (z <= 1.3e+84) {
tmp = fmax(((30.0 * hypot(x, y)) - 25.0), (fabs((30.0 * x)) - 0.2));
} else {
tmp = fmax(((z * 30.0) - 25.0), t_0);
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = Math.abs(Math.sin((30.0 * x))) - 0.2;
double tmp;
if (z <= -3e+186) {
tmp = fmax((-30.0 * z), t_0);
} else if (z <= 1.3e+84) {
tmp = fmax(((30.0 * Math.hypot(x, y)) - 25.0), (Math.abs((30.0 * x)) - 0.2));
} else {
tmp = fmax(((z * 30.0) - 25.0), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((30.0 * x))) - 0.2 tmp = 0 if z <= -3e+186: tmp = fmax((-30.0 * z), t_0) elif z <= 1.3e+84: tmp = fmax(((30.0 * math.hypot(x, y)) - 25.0), (math.fabs((30.0 * x)) - 0.2)) else: tmp = fmax(((z * 30.0) - 25.0), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(30.0 * x))) - 0.2) tmp = 0.0 if (z <= -3e+186) tmp = fmax(Float64(-30.0 * z), t_0); elseif (z <= 1.3e+84) tmp = fmax(Float64(Float64(30.0 * hypot(x, y)) - 25.0), Float64(abs(Float64(30.0 * x)) - 0.2)); else tmp = fmax(Float64(Float64(z * 30.0) - 25.0), t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(sin((30.0 * x))) - 0.2; tmp = 0.0; if (z <= -3e+186) tmp = max((-30.0 * z), t_0); elseif (z <= 1.3e+84) tmp = max(((30.0 * hypot(x, y)) - 25.0), (abs((30.0 * x)) - 0.2)); else tmp = max(((z * 30.0) - 25.0), t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[z, -3e+186], N[Max[N[(-30.0 * z), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[z, 1.3e+84], N[Max[N[(N[(30.0 * N[Sqrt[x ^ 2 + y ^ 2], $MachinePrecision]), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[(z * 30.0), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot x\right)\right| - 0.2\\
\mathbf{if}\;z \leq -3 \cdot 10^{+186}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, t\_0\right)\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+84}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot \mathsf{hypot}\left(x, y\right) - 25, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(z \cdot 30 - 25, t\_0\right)\\
\end{array}
\end{array}
if z < -2.99999999999999982e186Initial program 7.6%
Taylor expanded in z around 0
Applied rewrites8.4%
Taylor expanded in y around 0
Applied rewrites8.4%
Taylor expanded in z around 0
Applied rewrites7.6%
Taylor expanded in z around -inf
Applied rewrites95.4%
if -2.99999999999999982e186 < z < 1.3000000000000001e84Initial program 56.6%
Taylor expanded in z around 0
Applied rewrites91.2%
Taylor expanded in y around 0
Applied rewrites90.9%
Taylor expanded in z around 0
Applied rewrites90.4%
Taylor expanded in x around 0
Applied rewrites90.1%
if 1.3000000000000001e84 < z Initial program 27.0%
Taylor expanded in z around 0
Applied rewrites26.3%
Taylor expanded in y around 0
Applied rewrites26.3%
Taylor expanded in z around 0
Applied rewrites25.5%
Taylor expanded in z around inf
Applied rewrites78.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 x))) 0.2)))
(if (<= y -5.6e+91)
(fmax (* -30.0 y) t_0)
(if (<= y 7.5e+76)
(fmax (- (sqrt (* (* x x) 900.0)) 25.0) (- (fabs (* z 30.0)) 0.2))
(fmax (* y 30.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs(sin((30.0 * x))) - 0.2;
double tmp;
if (y <= -5.6e+91) {
tmp = fmax((-30.0 * y), t_0);
} else if (y <= 7.5e+76) {
tmp = fmax((sqrt(((x * x) * 900.0)) - 25.0), (fabs((z * 30.0)) - 0.2));
} else {
tmp = fmax((y * 30.0), t_0);
}
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) :: tmp
t_0 = abs(sin((30.0d0 * x))) - 0.2d0
if (y <= (-5.6d+91)) then
tmp = fmax(((-30.0d0) * y), t_0)
else if (y <= 7.5d+76) then
tmp = fmax((sqrt(((x * x) * 900.0d0)) - 25.0d0), (abs((z * 30.0d0)) - 0.2d0))
else
tmp = fmax((y * 30.0d0), t_0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs(Math.sin((30.0 * x))) - 0.2;
double tmp;
if (y <= -5.6e+91) {
tmp = fmax((-30.0 * y), t_0);
} else if (y <= 7.5e+76) {
tmp = fmax((Math.sqrt(((x * x) * 900.0)) - 25.0), (Math.abs((z * 30.0)) - 0.2));
} else {
tmp = fmax((y * 30.0), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((30.0 * x))) - 0.2 tmp = 0 if y <= -5.6e+91: tmp = fmax((-30.0 * y), t_0) elif y <= 7.5e+76: tmp = fmax((math.sqrt(((x * x) * 900.0)) - 25.0), (math.fabs((z * 30.0)) - 0.2)) else: tmp = fmax((y * 30.0), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(30.0 * x))) - 0.2) tmp = 0.0 if (y <= -5.6e+91) tmp = fmax(Float64(-30.0 * y), t_0); elseif (y <= 7.5e+76) tmp = fmax(Float64(sqrt(Float64(Float64(x * x) * 900.0)) - 25.0), Float64(abs(Float64(z * 30.0)) - 0.2)); else tmp = fmax(Float64(y * 30.0), t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(sin((30.0 * x))) - 0.2; tmp = 0.0; if (y <= -5.6e+91) tmp = max((-30.0 * y), t_0); elseif (y <= 7.5e+76) tmp = max((sqrt(((x * x) * 900.0)) - 25.0), (abs((z * 30.0)) - 0.2)); else tmp = max((y * 30.0), t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[y, -5.6e+91], N[Max[N[(-30.0 * y), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[y, 7.5e+76], N[Max[N[(N[Sqrt[N[(N[(x * x), $MachinePrecision] * 900.0), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(y * 30.0), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot x\right)\right| - 0.2\\
\mathbf{if}\;y \leq -5.6 \cdot 10^{+91}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, t\_0\right)\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\left(x \cdot x\right) \cdot 900} - 25, \left|z \cdot 30\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot 30, t\_0\right)\\
\end{array}
\end{array}
if y < -5.5999999999999997e91Initial program 31.1%
Taylor expanded in z around 0
Applied rewrites91.4%
Taylor expanded in y around 0
Applied rewrites91.4%
Taylor expanded in z around 0
Applied rewrites91.4%
Taylor expanded in y around -inf
Applied rewrites80.0%
if -5.5999999999999997e91 < y < 7.4999999999999995e76Initial program 57.4%
Taylor expanded in x around 0
Applied rewrites57.2%
Taylor expanded in x around inf
Applied rewrites37.5%
Taylor expanded in z around 0
Applied rewrites71.9%
Taylor expanded in y around 0
Applied rewrites71.3%
if 7.4999999999999995e76 < y Initial program 31.5%
Taylor expanded in z around 0
Applied rewrites92.0%
Taylor expanded in y around 0
Applied rewrites92.0%
Taylor expanded in z around 0
Applied rewrites92.0%
Taylor expanded in y around inf
Applied rewrites76.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (sqrt (* (* x x) 900.0)) 25.0)))
(if (<= y -5.6e+91)
(fmax (* -30.0 y) (- (fabs (sin (* 30.0 x))) 0.2))
(if (<= y 8.2e+70)
(fmax t_0 (- (fabs (* z 30.0)) 0.2))
(fmax t_0 (- (fabs (* y 30.0)) 0.2))))))
double code(double x, double y, double z) {
double t_0 = sqrt(((x * x) * 900.0)) - 25.0;
double tmp;
if (y <= -5.6e+91) {
tmp = fmax((-30.0 * y), (fabs(sin((30.0 * x))) - 0.2));
} else if (y <= 8.2e+70) {
tmp = fmax(t_0, (fabs((z * 30.0)) - 0.2));
} else {
tmp = fmax(t_0, (fabs((y * 30.0)) - 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) :: t_0
real(8) :: tmp
t_0 = sqrt(((x * x) * 900.0d0)) - 25.0d0
if (y <= (-5.6d+91)) then
tmp = fmax(((-30.0d0) * y), (abs(sin((30.0d0 * x))) - 0.2d0))
else if (y <= 8.2d+70) then
tmp = fmax(t_0, (abs((z * 30.0d0)) - 0.2d0))
else
tmp = fmax(t_0, (abs((y * 30.0d0)) - 0.2d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.sqrt(((x * x) * 900.0)) - 25.0;
double tmp;
if (y <= -5.6e+91) {
tmp = fmax((-30.0 * y), (Math.abs(Math.sin((30.0 * x))) - 0.2));
} else if (y <= 8.2e+70) {
tmp = fmax(t_0, (Math.abs((z * 30.0)) - 0.2));
} else {
tmp = fmax(t_0, (Math.abs((y * 30.0)) - 0.2));
}
return tmp;
}
def code(x, y, z): t_0 = math.sqrt(((x * x) * 900.0)) - 25.0 tmp = 0 if y <= -5.6e+91: tmp = fmax((-30.0 * y), (math.fabs(math.sin((30.0 * x))) - 0.2)) elif y <= 8.2e+70: tmp = fmax(t_0, (math.fabs((z * 30.0)) - 0.2)) else: tmp = fmax(t_0, (math.fabs((y * 30.0)) - 0.2)) return tmp
function code(x, y, z) t_0 = Float64(sqrt(Float64(Float64(x * x) * 900.0)) - 25.0) tmp = 0.0 if (y <= -5.6e+91) tmp = fmax(Float64(-30.0 * y), Float64(abs(sin(Float64(30.0 * x))) - 0.2)); elseif (y <= 8.2e+70) tmp = fmax(t_0, Float64(abs(Float64(z * 30.0)) - 0.2)); else tmp = fmax(t_0, Float64(abs(Float64(y * 30.0)) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = sqrt(((x * x) * 900.0)) - 25.0; tmp = 0.0; if (y <= -5.6e+91) tmp = max((-30.0 * y), (abs(sin((30.0 * x))) - 0.2)); elseif (y <= 8.2e+70) tmp = max(t_0, (abs((z * 30.0)) - 0.2)); else tmp = max(t_0, (abs((y * 30.0)) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sqrt[N[(N[(x * x), $MachinePrecision] * 900.0), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision]}, If[LessEqual[y, -5.6e+91], N[Max[N[(-30.0 * y), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 8.2e+70], N[Max[t$95$0, N[(N[Abs[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[t$95$0, N[(N[Abs[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\left(x \cdot x\right) \cdot 900} - 25\\
\mathbf{if}\;y \leq -5.6 \cdot 10^{+91}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{max}\left(t\_0, \left|z \cdot 30\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(t\_0, \left|y \cdot 30\right| - 0.2\right)\\
\end{array}
\end{array}
if y < -5.5999999999999997e91Initial program 31.1%
Taylor expanded in z around 0
Applied rewrites91.4%
Taylor expanded in y around 0
Applied rewrites91.4%
Taylor expanded in z around 0
Applied rewrites91.4%
Taylor expanded in y around -inf
Applied rewrites80.0%
if -5.5999999999999997e91 < y < 8.2000000000000004e70Initial program 57.8%
Taylor expanded in x around 0
Applied rewrites57.5%
Taylor expanded in x around inf
Applied rewrites37.7%
Taylor expanded in z around 0
Applied rewrites72.4%
Taylor expanded in y around 0
Applied rewrites71.7%
if 8.2000000000000004e70 < y Initial program 31.1%
Taylor expanded in x around 0
Applied rewrites31.1%
Taylor expanded in x around inf
Applied rewrites6.9%
Taylor expanded in z around 0
Applied rewrites6.9%
Taylor expanded in y around 0
Applied rewrites71.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (sqrt (* (* x x) 900.0)) 25.0)))
(if (or (<= y -7e+41) (not (<= y 8.2e+70)))
(fmax t_0 (- (fabs (* y 30.0)) 0.2))
(fmax t_0 (- (fabs (* z 30.0)) 0.2)))))
double code(double x, double y, double z) {
double t_0 = sqrt(((x * x) * 900.0)) - 25.0;
double tmp;
if ((y <= -7e+41) || !(y <= 8.2e+70)) {
tmp = fmax(t_0, (fabs((y * 30.0)) - 0.2));
} else {
tmp = fmax(t_0, (fabs((z * 30.0)) - 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) :: t_0
real(8) :: tmp
t_0 = sqrt(((x * x) * 900.0d0)) - 25.0d0
if ((y <= (-7d+41)) .or. (.not. (y <= 8.2d+70))) then
tmp = fmax(t_0, (abs((y * 30.0d0)) - 0.2d0))
else
tmp = fmax(t_0, (abs((z * 30.0d0)) - 0.2d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.sqrt(((x * x) * 900.0)) - 25.0;
double tmp;
if ((y <= -7e+41) || !(y <= 8.2e+70)) {
tmp = fmax(t_0, (Math.abs((y * 30.0)) - 0.2));
} else {
tmp = fmax(t_0, (Math.abs((z * 30.0)) - 0.2));
}
return tmp;
}
def code(x, y, z): t_0 = math.sqrt(((x * x) * 900.0)) - 25.0 tmp = 0 if (y <= -7e+41) or not (y <= 8.2e+70): tmp = fmax(t_0, (math.fabs((y * 30.0)) - 0.2)) else: tmp = fmax(t_0, (math.fabs((z * 30.0)) - 0.2)) return tmp
function code(x, y, z) t_0 = Float64(sqrt(Float64(Float64(x * x) * 900.0)) - 25.0) tmp = 0.0 if ((y <= -7e+41) || !(y <= 8.2e+70)) tmp = fmax(t_0, Float64(abs(Float64(y * 30.0)) - 0.2)); else tmp = fmax(t_0, Float64(abs(Float64(z * 30.0)) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = sqrt(((x * x) * 900.0)) - 25.0; tmp = 0.0; if ((y <= -7e+41) || ~((y <= 8.2e+70))) tmp = max(t_0, (abs((y * 30.0)) - 0.2)); else tmp = max(t_0, (abs((z * 30.0)) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sqrt[N[(N[(x * x), $MachinePrecision] * 900.0), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision]}, If[Or[LessEqual[y, -7e+41], N[Not[LessEqual[y, 8.2e+70]], $MachinePrecision]], N[Max[t$95$0, N[(N[Abs[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[t$95$0, N[(N[Abs[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\left(x \cdot x\right) \cdot 900} - 25\\
\mathbf{if}\;y \leq -7 \cdot 10^{+41} \lor \neg \left(y \leq 8.2 \cdot 10^{+70}\right):\\
\;\;\;\;\mathsf{max}\left(t\_0, \left|y \cdot 30\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(t\_0, \left|z \cdot 30\right| - 0.2\right)\\
\end{array}
\end{array}
if y < -6.9999999999999998e41 or 8.2000000000000004e70 < y Initial program 34.4%
Taylor expanded in x around 0
Applied rewrites34.4%
Taylor expanded in x around inf
Applied rewrites8.8%
Taylor expanded in z around 0
Applied rewrites8.9%
Taylor expanded in y around 0
Applied rewrites71.8%
if -6.9999999999999998e41 < y < 8.2000000000000004e70Initial program 57.4%
Taylor expanded in x around 0
Applied rewrites57.1%
Taylor expanded in x around inf
Applied rewrites38.3%
Taylor expanded in z around 0
Applied rewrites74.5%
Taylor expanded in y around 0
Applied rewrites74.0%
Final simplification73.1%
(FPCore (x y z) :precision binary64 (if (or (<= x -4.5e+152) (not (<= x 4.5e+152))) (fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2)) (fmax (- (sqrt (* (* x x) 900.0)) 25.0) (- (fabs (* y 30.0)) 0.2))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -4.5e+152) || !(x <= 4.5e+152)) {
tmp = fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
} else {
tmp = fmax((sqrt(((x * x) * 900.0)) - 25.0), (fabs((y * 30.0)) - 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 <= (-4.5d+152)) .or. (.not. (x <= 4.5d+152))) then
tmp = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
else
tmp = fmax((sqrt(((x * x) * 900.0d0)) - 25.0d0), (abs((y * 30.0d0)) - 0.2d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -4.5e+152) || !(x <= 4.5e+152)) {
tmp = fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
} else {
tmp = fmax((Math.sqrt(((x * x) * 900.0)) - 25.0), (Math.abs((y * 30.0)) - 0.2));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -4.5e+152) or not (x <= 4.5e+152): tmp = fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2)) else: tmp = fmax((math.sqrt(((x * x) * 900.0)) - 25.0), (math.fabs((y * 30.0)) - 0.2)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -4.5e+152) || !(x <= 4.5e+152)) tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2)); else tmp = fmax(Float64(sqrt(Float64(Float64(x * x) * 900.0)) - 25.0), Float64(abs(Float64(y * 30.0)) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -4.5e+152) || ~((x <= 4.5e+152))) tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2)); else tmp = max((sqrt(((x * x) * 900.0)) - 25.0), (abs((y * 30.0)) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -4.5e+152], N[Not[LessEqual[x, 4.5e+152]], $MachinePrecision]], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[Sqrt[N[(N[(x * x), $MachinePrecision] * 900.0), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+152} \lor \neg \left(x \leq 4.5 \cdot 10^{+152}\right):\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\left(x \cdot x\right) \cdot 900} - 25, \left|y \cdot 30\right| - 0.2\right)\\
\end{array}
\end{array}
if x < -4.5000000000000001e152 or 4.5000000000000001e152 < x Initial program 9.2%
Taylor expanded in x around -inf
Applied rewrites38.7%
Taylor expanded in y around 0
Applied rewrites38.7%
Taylor expanded in z around 0
Applied rewrites38.7%
Taylor expanded in x around 0
Applied rewrites79.3%
if -4.5000000000000001e152 < x < 4.5000000000000001e152Initial program 58.8%
Taylor expanded in x around 0
Applied rewrites58.6%
Taylor expanded in x around inf
Applied rewrites30.5%
Taylor expanded in z around 0
Applied rewrites29.7%
Taylor expanded in y around 0
Applied rewrites66.8%
Final simplification69.7%
(FPCore (x y z) :precision binary64 (fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2)))
double code(double x, double y, double z) {
return fmax((-30.0 * x), (fabs((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((30.0d0 * x)) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
}
def code(x, y, z): return fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2))
function code(x, y, z) return fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2)) end
function tmp = code(x, y, z) tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)
\end{array}
Initial program 47.5%
Taylor expanded in x around -inf
Applied rewrites17.4%
Taylor expanded in y around 0
Applied rewrites17.1%
Taylor expanded in z around 0
Applied rewrites16.5%
Taylor expanded in x around 0
Applied rewrites33.1%
herbie shell --seed 2025042 -o generate:proofs
(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)))