
(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 16 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 (* z 30.0))) (t_1 (sin (* 30.0 x))))
(if (<= x -8e+37)
(fmax
(- (hypot (* -30.0 z) (* -30.0 x)) 25.0)
(- (fabs (fma t_0 (cos (* -30.0 x)) t_1)) 0.2))
(if (<= x 9e+154)
(fmax
(- (hypot (* -30.0 z) (* -30.0 y)) 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))
(fmax (- (hypot (* -30.0 x) (* -30.0 y)) 25.0) (- (fabs t_1) 0.2))))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double t_1 = sin((30.0 * x));
double tmp;
if (x <= -8e+37) {
tmp = fmax((hypot((-30.0 * z), (-30.0 * x)) - 25.0), (fabs(fma(t_0, cos((-30.0 * x)), t_1)) - 0.2));
} else if (x <= 9e+154) {
tmp = fmax((hypot((-30.0 * z), (-30.0 * y)) - 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));
} else {
tmp = fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (fabs(t_1) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) t_1 = sin(Float64(30.0 * x)) tmp = 0.0 if (x <= -8e+37) tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * x)) - 25.0), Float64(abs(fma(t_0, cos(Float64(-30.0 * x)), t_1)) - 0.2)); elseif (x <= 9e+154) tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * y)) - 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)); else tmp = fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), Float64(abs(t_1) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -8e+37], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(t$95$0 * N[Cos[N[(-30.0 * x), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 9e+154], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $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], N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[t$95$1], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
t_1 := \sin \left(30 \cdot x\right)\\
\mathbf{if}\;x \leq -8 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\mathsf{fma}\left(t\_0, \cos \left(-30 \cdot x\right), t\_1\right)\right| - 0.2\right)\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 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)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|t\_1\right| - 0.2\right)\\
\end{array}
\end{array}
if x < -7.99999999999999963e37Initial program 28.6%
Taylor expanded in y around 0
Applied rewrites86.3%
Taylor expanded in y around 0
Applied rewrites86.3%
if -7.99999999999999963e37 < x < 9.00000000000000018e154Initial program 56.9%
Taylor expanded in x around 0
Applied rewrites95.6%
if 9.00000000000000018e154 < x Initial program 7.6%
Taylor expanded in z around 0
Applied rewrites97.2%
Taylor expanded in y around 0
Applied rewrites97.2%
Taylor expanded in z around 0
Applied rewrites97.2%
Final simplification93.6%
(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 (* 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))
50000000.0)
(fmax (- (* -30.0 x) 25.0) (- (fabs (sin (* 30.0 x))) 0.2))
(fmax (* -30.0 x) (- (fabs (* 30.0 x)) 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((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)) <= 50000000.0) {
tmp = fmax(((-30.0 * x) - 25.0), (fabs(sin((30.0 * x))) - 0.2));
} else {
tmp = fmax((-30.0 * x), (fabs((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 (fmax((sqrt(((((x * 30.0d0) ** 2.0d0) + ((y * 30.0d0) ** 2.0d0)) + ((z * 30.0d0) ** 2.0d0))) - 25.0d0), (abs(((sin((z * 30.0d0)) * cos((x * 30.0d0))) + ((sin((x * 30.0d0)) * cos((y * 30.0d0))) + (sin((y * 30.0d0)) * cos((z * 30.0d0)))))) - 0.2d0)) <= 50000000.0d0) then
tmp = fmax((((-30.0d0) * x) - 25.0d0), (abs(sin((30.0d0 * x))) - 0.2d0))
else
tmp = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
end if
code = tmp
end function
public static double code(double x, double y, double 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((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)) <= 50000000.0) {
tmp = fmax(((-30.0 * x) - 25.0), (Math.abs(Math.sin((30.0 * x))) - 0.2));
} else {
tmp = fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
}
return tmp;
}
def code(x, y, 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((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)) <= 50000000.0: tmp = fmax(((-30.0 * x) - 25.0), (math.fabs(math.sin((30.0 * x))) - 0.2)) else: tmp = fmax((-30.0 * x), (math.fabs((30.0 * x)) - 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(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)) <= 50000000.0) tmp = fmax(Float64(Float64(-30.0 * x) - 25.0), Float64(abs(sin(Float64(30.0 * x))) - 0.2)); else tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2)); end return tmp end
function tmp_2 = code(x, y, 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((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)) <= 50000000.0) tmp = max(((-30.0 * x) - 25.0), (abs(sin((30.0 * x))) - 0.2)); else tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2)); end tmp_2 = 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[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], 50000000.0], N[Max[N[(N[(-30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\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|\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) \leq 50000000:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\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))) < 5e7Initial program 99.9%
Taylor expanded in z around 0
Applied rewrites97.5%
Taylor expanded in y around 0
Applied rewrites94.0%
Taylor expanded in z around 0
Applied rewrites91.8%
Taylor expanded in x around -inf
Applied rewrites89.5%
if 5e7 < (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 34.4%
Taylor expanded in x around -inf
Applied rewrites19.2%
Taylor expanded in z around 0
Applied rewrites18.7%
Taylor expanded in y around 0
Applied rewrites18.2%
Taylor expanded in x around 0
Applied rewrites32.9%
Final simplification41.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0))))
(if (<= z -3.2e+15)
(fmax (- (hypot (* -30.0 z) (* -30.0 y)) 25.0) (- (fabs t_0) 0.2))
(if (<= z 2.25e+65)
(fmax
(- (hypot (* -30.0 x) (* -30.0 y)) 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))
(fmax
(- (hypot (* -30.0 z) (* -30.0 x)) 25.0)
(- (fabs (fma t_0 (cos (* -30.0 x)) (sin (* 30.0 x)))) 0.2))))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double tmp;
if (z <= -3.2e+15) {
tmp = fmax((hypot((-30.0 * z), (-30.0 * y)) - 25.0), (fabs(t_0) - 0.2));
} else if (z <= 2.25e+65) {
tmp = fmax((hypot((-30.0 * x), (-30.0 * y)) - 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));
} else {
tmp = fmax((hypot((-30.0 * z), (-30.0 * x)) - 25.0), (fabs(fma(t_0, cos((-30.0 * x)), sin((30.0 * x)))) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) tmp = 0.0 if (z <= -3.2e+15) tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * y)) - 25.0), Float64(abs(t_0) - 0.2)); elseif (z <= 2.25e+65) tmp = fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 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)); else tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * x)) - 25.0), Float64(abs(fma(t_0, cos(Float64(-30.0 * x)), sin(Float64(30.0 * x)))) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -3.2e+15], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2.25e+65], N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $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], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(t$95$0 * N[Cos[N[(-30.0 * x), $MachinePrecision]], $MachinePrecision] + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|t\_0\right| - 0.2\right)\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+65}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 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)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\mathsf{fma}\left(t\_0, \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if z < -3.2e15Initial program 42.1%
Taylor expanded in x around 0
Applied rewrites89.7%
Taylor expanded in y around 0
Applied rewrites89.7%
Taylor expanded in x around 0
Applied rewrites89.7%
if -3.2e15 < z < 2.25e65Initial program 53.7%
Taylor expanded in z around 0
Applied rewrites98.6%
if 2.25e65 < z Initial program 22.9%
Taylor expanded in y around 0
Applied rewrites86.0%
Taylor expanded in y around 0
Applied rewrites86.0%
Final simplification93.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0))))
(if (or (<= z -3.2e+15) (not (<= z 6.5e+83)))
(fmax (- (hypot (* -30.0 z) (* -30.0 y)) 25.0) (- (fabs t_0) 0.2))
(fmax
(- (hypot (* -30.0 x) (* -30.0 y)) 25.0)
(- (fabs (fma t_0 (cos (* -30.0 x)) (sin (* 30.0 x)))) 0.2)))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double tmp;
if ((z <= -3.2e+15) || !(z <= 6.5e+83)) {
tmp = fmax((hypot((-30.0 * z), (-30.0 * y)) - 25.0), (fabs(t_0) - 0.2));
} else {
tmp = fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (fabs(fma(t_0, cos((-30.0 * x)), sin((30.0 * x)))) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) tmp = 0.0 if ((z <= -3.2e+15) || !(z <= 6.5e+83)) tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * y)) - 25.0), Float64(abs(t_0) - 0.2)); else tmp = fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), Float64(abs(fma(t_0, cos(Float64(-30.0 * x)), sin(Float64(30.0 * x)))) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[z, -3.2e+15], N[Not[LessEqual[z, 6.5e+83]], $MachinePrecision]], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(t$95$0 * N[Cos[N[(-30.0 * x), $MachinePrecision]], $MachinePrecision] + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+15} \lor \neg \left(z \leq 6.5 \cdot 10^{+83}\right):\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|t\_0\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\mathsf{fma}\left(t\_0, \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if z < -3.2e15 or 6.5000000000000003e83 < z Initial program 32.2%
Taylor expanded in x around 0
Applied rewrites88.1%
Taylor expanded in y around 0
Applied rewrites88.1%
Taylor expanded in x around 0
Applied rewrites88.1%
if -3.2e15 < z < 6.5000000000000003e83Initial program 53.0%
Taylor expanded in z around 0
Applied rewrites97.3%
Taylor expanded in y around 0
Applied rewrites96.4%
Final simplification92.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* 30.0 x)))
(t_1 (- (fabs (fma (sin (* z 30.0)) (cos (* -30.0 x)) t_0)) 0.2)))
(if (<= x -8e+37)
(fmax (- (hypot (* -30.0 z) (* -30.0 x)) 25.0) t_1)
(if (<= x 9e+154)
(fmax (- (hypot (* -30.0 z) (* -30.0 y)) 25.0) t_1)
(fmax (- (hypot (* -30.0 x) (* -30.0 y)) 25.0) (- (fabs t_0) 0.2))))))
double code(double x, double y, double z) {
double t_0 = sin((30.0 * x));
double t_1 = fabs(fma(sin((z * 30.0)), cos((-30.0 * x)), t_0)) - 0.2;
double tmp;
if (x <= -8e+37) {
tmp = fmax((hypot((-30.0 * z), (-30.0 * x)) - 25.0), t_1);
} else if (x <= 9e+154) {
tmp = fmax((hypot((-30.0 * z), (-30.0 * y)) - 25.0), t_1);
} else {
tmp = fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (fabs(t_0) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(30.0 * x)) t_1 = Float64(abs(fma(sin(Float64(z * 30.0)), cos(Float64(-30.0 * x)), t_0)) - 0.2) tmp = 0.0 if (x <= -8e+37) tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * x)) - 25.0), t_1); elseif (x <= 9e+154) tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * y)) - 25.0), t_1); else tmp = fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), 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[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]}, If[LessEqual[x, -8e+37], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision], If[LessEqual[x, 9e+154], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision], N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], 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 := \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), t\_0\right)\right| - 0.2\\
\mathbf{if}\;x \leq -8 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, t\_1\right)\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|t\_0\right| - 0.2\right)\\
\end{array}
\end{array}
if x < -7.99999999999999963e37Initial program 28.6%
Taylor expanded in y around 0
Applied rewrites86.3%
Taylor expanded in y around 0
Applied rewrites86.3%
if -7.99999999999999963e37 < x < 9.00000000000000018e154Initial program 56.9%
Taylor expanded in x around 0
Applied rewrites95.6%
Taylor expanded in y around 0
Applied rewrites94.9%
if 9.00000000000000018e154 < x Initial program 7.6%
Taylor expanded in z around 0
Applied rewrites97.2%
Taylor expanded in y around 0
Applied rewrites97.2%
Taylor expanded in z around 0
Applied rewrites97.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0)))
(t_1 (- (fabs (fma t_0 (cos (* -30.0 x)) (sin (* 30.0 x)))) 0.2)))
(if (<= z -3.2e+15)
(fmax (- (hypot (* -30.0 z) (* -30.0 y)) 25.0) (- (fabs t_0) 0.2))
(if (<= z 2.25e+65)
(fmax (- (hypot (* -30.0 x) (* -30.0 y)) 25.0) t_1)
(fmax (- (hypot (* -30.0 z) (* -30.0 x)) 25.0) t_1)))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double t_1 = fabs(fma(t_0, cos((-30.0 * x)), sin((30.0 * x)))) - 0.2;
double tmp;
if (z <= -3.2e+15) {
tmp = fmax((hypot((-30.0 * z), (-30.0 * y)) - 25.0), (fabs(t_0) - 0.2));
} else if (z <= 2.25e+65) {
tmp = fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), t_1);
} else {
tmp = fmax((hypot((-30.0 * z), (-30.0 * x)) - 25.0), t_1);
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) t_1 = Float64(abs(fma(t_0, cos(Float64(-30.0 * x)), sin(Float64(30.0 * x)))) - 0.2) tmp = 0.0 if (z <= -3.2e+15) tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * y)) - 25.0), Float64(abs(t_0) - 0.2)); elseif (z <= 2.25e+65) tmp = fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), t_1); else tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * x)) - 25.0), t_1); end return 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[Cos[N[(-30.0 * x), $MachinePrecision]], $MachinePrecision] + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[z, -3.2e+15], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2.25e+65], N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
t_1 := \left|\mathsf{fma}\left(t\_0, \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|t\_0\right| - 0.2\right)\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+65}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, t\_1\right)\\
\end{array}
\end{array}
if z < -3.2e15Initial program 42.1%
Taylor expanded in x around 0
Applied rewrites89.7%
Taylor expanded in y around 0
Applied rewrites89.7%
Taylor expanded in x around 0
Applied rewrites89.7%
if -3.2e15 < z < 2.25e65Initial program 53.7%
Taylor expanded in z around 0
Applied rewrites98.6%
Taylor expanded in y around 0
Applied rewrites97.6%
if 2.25e65 < z Initial program 22.9%
Taylor expanded in y around 0
Applied rewrites86.0%
Taylor expanded in y around 0
Applied rewrites86.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* z 30.0))) 0.2)))
(if (or (<= z -3.2e+15) (not (<= z 6.5e+83)))
(fmax (- (hypot (* -30.0 z) (* -30.0 y)) 25.0) t_0)
(fmax (- (hypot (* -30.0 x) (* -30.0 y)) 25.0) t_0))))
double code(double x, double y, double z) {
double t_0 = fabs(sin((z * 30.0))) - 0.2;
double tmp;
if ((z <= -3.2e+15) || !(z <= 6.5e+83)) {
tmp = fmax((hypot((-30.0 * z), (-30.0 * y)) - 25.0), t_0);
} else {
tmp = fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), t_0);
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = Math.abs(Math.sin((z * 30.0))) - 0.2;
double tmp;
if ((z <= -3.2e+15) || !(z <= 6.5e+83)) {
tmp = fmax((Math.hypot((-30.0 * z), (-30.0 * y)) - 25.0), t_0);
} else {
tmp = fmax((Math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((z * 30.0))) - 0.2 tmp = 0 if (z <= -3.2e+15) or not (z <= 6.5e+83): tmp = fmax((math.hypot((-30.0 * z), (-30.0 * y)) - 25.0), t_0) else: tmp = fmax((math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(z * 30.0))) - 0.2) tmp = 0.0 if ((z <= -3.2e+15) || !(z <= 6.5e+83)) tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * y)) - 25.0), t_0); else tmp = fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(sin((z * 30.0))) - 0.2; tmp = 0.0; if ((z <= -3.2e+15) || ~((z <= 6.5e+83))) tmp = max((hypot((-30.0 * z), (-30.0 * y)) - 25.0), t_0); else tmp = max((hypot((-30.0 * x), (-30.0 * y)) - 25.0), t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[Or[LessEqual[z, -3.2e+15], N[Not[LessEqual[z, 6.5e+83]], $MachinePrecision]], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\sin \left(z \cdot 30\right)\right| - 0.2\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+15} \lor \neg \left(z \leq 6.5 \cdot 10^{+83}\right):\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, t\_0\right)\\
\end{array}
\end{array}
if z < -3.2e15 or 6.5000000000000003e83 < z Initial program 32.2%
Taylor expanded in x around 0
Applied rewrites88.1%
Taylor expanded in y around 0
Applied rewrites88.1%
Taylor expanded in x around 0
Applied rewrites88.1%
if -3.2e15 < z < 6.5000000000000003e83Initial program 53.0%
Taylor expanded in z around 0
Applied rewrites97.3%
Taylor expanded in y around 0
Applied rewrites96.4%
Taylor expanded in x around 0
Applied rewrites96.0%
Final simplification92.5%
(FPCore (x y z) :precision binary64 (fmax (- (hypot (* -30.0 x) (* -30.0 y)) 25.0) (- (fabs (sin (* z 30.0))) 0.2)))
double code(double x, double y, double z) {
return fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (fabs(sin((z * 30.0))) - 0.2));
}
public static double code(double x, double y, double z) {
return fmax((Math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), (Math.abs(Math.sin((z * 30.0))) - 0.2));
}
def code(x, y, z): return fmax((math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), (math.fabs(math.sin((z * 30.0))) - 0.2))
function code(x, y, z) return fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), Float64(abs(sin(Float64(z * 30.0))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (abs(sin((z * 30.0))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)
\end{array}
Initial program 43.8%
Taylor expanded in z around 0
Applied rewrites68.9%
Taylor expanded in y around 0
Applied rewrites68.4%
Taylor expanded in x around 0
Applied rewrites68.1%
(FPCore (x y z) :precision binary64 (fmax (- (hypot (* -30.0 x) (* -30.0 y)) 25.0) (- (fabs (sin (* 30.0 x))) 0.2)))
double code(double x, double y, double z) {
return fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (fabs(sin((30.0 * x))) - 0.2));
}
public static double code(double x, double y, double z) {
return fmax((Math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), (Math.abs(Math.sin((30.0 * x))) - 0.2));
}
def code(x, y, z): return fmax((math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), (math.fabs(math.sin((30.0 * x))) - 0.2))
function code(x, y, z) return fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), Float64(abs(sin(Float64(30.0 * x))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (abs(sin((30.0 * x))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)
\end{array}
Initial program 43.8%
Taylor expanded in z around 0
Applied rewrites68.9%
Taylor expanded in y around 0
Applied rewrites68.4%
Taylor expanded in z around 0
Applied rewrites67.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* 30.0 x))) (t_1 (- (fabs t_0) 0.2)))
(if (<= x -9.2e-74)
(fmax (* -30.0 x) (- (fabs (fma y 30.0 t_0)) 0.2))
(if (<= x -3.7e-292)
(fmax (- (* -30.0 y) 25.0) t_1)
(if (<= x 0.00295)
(fmax (- (* y 30.0) 25.0) (- (fabs (sin (* z 30.0))) 0.2))
(fmax (- (* 30.0 x) 25.0) t_1))))))
double code(double x, double y, double z) {
double t_0 = sin((30.0 * x));
double t_1 = fabs(t_0) - 0.2;
double tmp;
if (x <= -9.2e-74) {
tmp = fmax((-30.0 * x), (fabs(fma(y, 30.0, t_0)) - 0.2));
} else if (x <= -3.7e-292) {
tmp = fmax(((-30.0 * y) - 25.0), t_1);
} else if (x <= 0.00295) {
tmp = fmax(((y * 30.0) - 25.0), (fabs(sin((z * 30.0))) - 0.2));
} else {
tmp = fmax(((30.0 * x) - 25.0), t_1);
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(30.0 * x)) t_1 = Float64(abs(t_0) - 0.2) tmp = 0.0 if (x <= -9.2e-74) tmp = fmax(Float64(-30.0 * x), Float64(abs(fma(y, 30.0, t_0)) - 0.2)); elseif (x <= -3.7e-292) tmp = fmax(Float64(Float64(-30.0 * y) - 25.0), t_1); elseif (x <= 0.00295) tmp = fmax(Float64(Float64(y * 30.0) - 25.0), Float64(abs(sin(Float64(z * 30.0))) - 0.2)); else tmp = fmax(Float64(Float64(30.0 * x) - 25.0), t_1); 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[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[x, -9.2e-74], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(y * 30.0 + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -3.7e-292], N[Max[N[(N[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision], If[LessEqual[x, 0.00295], N[Max[N[(N[(y * 30.0), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[(30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(30 \cdot x\right)\\
t_1 := \left|t\_0\right| - 0.2\\
\mathbf{if}\;x \leq -9.2 \cdot 10^{-74}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(y, 30, t\_0\right)\right| - 0.2\right)\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-292}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, t\_1\right)\\
\mathbf{elif}\;x \leq 0.00295:\\
\;\;\;\;\mathsf{max}\left(y \cdot 30 - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot x - 25, t\_1\right)\\
\end{array}
\end{array}
if x < -9.19999999999999922e-74Initial program 34.0%
Taylor expanded in x around -inf
Applied rewrites42.2%
Taylor expanded in z around 0
Applied rewrites42.2%
Taylor expanded in y around 0
Applied rewrites64.1%
if -9.19999999999999922e-74 < x < -3.69999999999999997e-292Initial program 68.9%
Taylor expanded in z around 0
Applied rewrites72.8%
Taylor expanded in y around 0
Applied rewrites71.1%
Taylor expanded in z around 0
Applied rewrites69.8%
Taylor expanded in y around -inf
Applied rewrites57.2%
if -3.69999999999999997e-292 < x < 0.00294999999999999993Initial program 63.4%
Taylor expanded in z around 0
Applied rewrites61.2%
Taylor expanded in y around 0
Applied rewrites60.5%
Taylor expanded in x around 0
Applied rewrites49.1%
Taylor expanded in x around 0
Applied rewrites49.1%
if 0.00294999999999999993 < x Initial program 18.1%
Taylor expanded in z around 0
Applied rewrites75.0%
Taylor expanded in y around 0
Applied rewrites75.0%
Taylor expanded in z around 0
Applied rewrites75.0%
Taylor expanded in x around inf
Applied rewrites58.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 x))) 0.2)))
(if (<= x -1.7e+22)
(fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2))
(if (<= x -3.7e-292)
(fmax (- (* -30.0 y) 25.0) t_0)
(if (<= x 0.00295)
(fmax (- (* y 30.0) 25.0) (- (fabs (sin (* z 30.0))) 0.2))
(fmax (- (* 30.0 x) 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 (x <= -1.7e+22) {
tmp = fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
} else if (x <= -3.7e-292) {
tmp = fmax(((-30.0 * y) - 25.0), t_0);
} else if (x <= 0.00295) {
tmp = fmax(((y * 30.0) - 25.0), (fabs(sin((z * 30.0))) - 0.2));
} else {
tmp = fmax(((30.0 * x) - 25.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 (x <= (-1.7d+22)) then
tmp = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
else if (x <= (-3.7d-292)) then
tmp = fmax((((-30.0d0) * y) - 25.0d0), t_0)
else if (x <= 0.00295d0) then
tmp = fmax(((y * 30.0d0) - 25.0d0), (abs(sin((z * 30.0d0))) - 0.2d0))
else
tmp = fmax(((30.0d0 * x) - 25.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 (x <= -1.7e+22) {
tmp = fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
} else if (x <= -3.7e-292) {
tmp = fmax(((-30.0 * y) - 25.0), t_0);
} else if (x <= 0.00295) {
tmp = fmax(((y * 30.0) - 25.0), (Math.abs(Math.sin((z * 30.0))) - 0.2));
} else {
tmp = fmax(((30.0 * x) - 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 x <= -1.7e+22: tmp = fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2)) elif x <= -3.7e-292: tmp = fmax(((-30.0 * y) - 25.0), t_0) elif x <= 0.00295: tmp = fmax(((y * 30.0) - 25.0), (math.fabs(math.sin((z * 30.0))) - 0.2)) else: tmp = fmax(((30.0 * x) - 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 (x <= -1.7e+22) tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2)); elseif (x <= -3.7e-292) tmp = fmax(Float64(Float64(-30.0 * y) - 25.0), t_0); elseif (x <= 0.00295) tmp = fmax(Float64(Float64(y * 30.0) - 25.0), Float64(abs(sin(Float64(z * 30.0))) - 0.2)); else tmp = fmax(Float64(Float64(30.0 * x) - 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 (x <= -1.7e+22) tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2)); elseif (x <= -3.7e-292) tmp = max(((-30.0 * y) - 25.0), t_0); elseif (x <= 0.00295) tmp = max(((y * 30.0) - 25.0), (abs(sin((z * 30.0))) - 0.2)); else tmp = max(((30.0 * x) - 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[x, -1.7e+22], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -3.7e-292], N[Max[N[(N[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 0.00295], N[Max[N[(N[(y * 30.0), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[(30.0 * x), $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}\;x \leq -1.7 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-292}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, t\_0\right)\\
\mathbf{elif}\;x \leq 0.00295:\\
\;\;\;\;\mathsf{max}\left(y \cdot 30 - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot x - 25, t\_0\right)\\
\end{array}
\end{array}
if x < -1.7e22Initial program 29.1%
Taylor expanded in x around -inf
Applied rewrites54.9%
Taylor expanded in z around 0
Applied rewrites54.9%
Taylor expanded in y around 0
Applied rewrites54.9%
Taylor expanded in x around 0
Applied rewrites54.9%
if -1.7e22 < x < -3.69999999999999997e-292Initial program 62.0%
Taylor expanded in z around 0
Applied rewrites71.0%
Taylor expanded in y around 0
Applied rewrites69.9%
Taylor expanded in z around 0
Applied rewrites68.4%
Taylor expanded in y around -inf
Applied rewrites52.9%
if -3.69999999999999997e-292 < x < 0.00294999999999999993Initial program 63.4%
Taylor expanded in z around 0
Applied rewrites61.2%
Taylor expanded in y around 0
Applied rewrites60.5%
Taylor expanded in x around 0
Applied rewrites49.1%
Taylor expanded in x around 0
Applied rewrites49.1%
if 0.00294999999999999993 < x Initial program 18.1%
Taylor expanded in z around 0
Applied rewrites75.0%
Taylor expanded in y around 0
Applied rewrites75.0%
Taylor expanded in z around 0
Applied rewrites75.0%
Taylor expanded in x around inf
Applied rewrites58.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.7e+22) (not (<= x 700000.0))) (fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2)) (fmax (- (* -30.0 y) 25.0) (- (fabs (sin (* 30.0 x))) 0.2))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.7e+22) || !(x <= 700000.0)) {
tmp = fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
} else {
tmp = fmax(((-30.0 * y) - 25.0), (fabs(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 <= (-1.7d+22)) .or. (.not. (x <= 700000.0d0))) then
tmp = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
else
tmp = fmax((((-30.0d0) * y) - 25.0d0), (abs(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 <= -1.7e+22) || !(x <= 700000.0)) {
tmp = fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
} else {
tmp = fmax(((-30.0 * y) - 25.0), (Math.abs(Math.sin((30.0 * x))) - 0.2));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.7e+22) or not (x <= 700000.0): tmp = fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2)) else: tmp = fmax(((-30.0 * y) - 25.0), (math.fabs(math.sin((30.0 * x))) - 0.2)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.7e+22) || !(x <= 700000.0)) tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2)); else tmp = fmax(Float64(Float64(-30.0 * y) - 25.0), Float64(abs(sin(Float64(30.0 * x))) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.7e+22) || ~((x <= 700000.0))) tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2)); else tmp = max(((-30.0 * y) - 25.0), (abs(sin((30.0 * x))) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.7e+22], N[Not[LessEqual[x, 700000.0]], $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[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+22} \lor \neg \left(x \leq 700000\right):\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if x < -1.7e22 or 7e5 < x Initial program 23.9%
Taylor expanded in x around -inf
Applied rewrites30.4%
Taylor expanded in z around 0
Applied rewrites30.3%
Taylor expanded in y around 0
Applied rewrites30.4%
Taylor expanded in x around 0
Applied rewrites56.8%
if -1.7e22 < x < 7e5Initial program 62.2%
Taylor expanded in z around 0
Applied rewrites66.8%
Taylor expanded in y around 0
Applied rewrites65.8%
Taylor expanded in z around 0
Applied rewrites64.3%
Taylor expanded in y around -inf
Applied rewrites47.7%
Final simplification52.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 x))) 0.2)))
(if (<= x -1.7e+22)
(fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2))
(if (<= x 82000.0)
(fmax (- (* -30.0 y) 25.0) t_0)
(fmax (- (* 30.0 x) 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 (x <= -1.7e+22) {
tmp = fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
} else if (x <= 82000.0) {
tmp = fmax(((-30.0 * y) - 25.0), t_0);
} else {
tmp = fmax(((30.0 * x) - 25.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 (x <= (-1.7d+22)) then
tmp = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
else if (x <= 82000.0d0) then
tmp = fmax((((-30.0d0) * y) - 25.0d0), t_0)
else
tmp = fmax(((30.0d0 * x) - 25.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 (x <= -1.7e+22) {
tmp = fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
} else if (x <= 82000.0) {
tmp = fmax(((-30.0 * y) - 25.0), t_0);
} else {
tmp = fmax(((30.0 * x) - 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 x <= -1.7e+22: tmp = fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2)) elif x <= 82000.0: tmp = fmax(((-30.0 * y) - 25.0), t_0) else: tmp = fmax(((30.0 * x) - 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 (x <= -1.7e+22) tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2)); elseif (x <= 82000.0) tmp = fmax(Float64(Float64(-30.0 * y) - 25.0), t_0); else tmp = fmax(Float64(Float64(30.0 * x) - 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 (x <= -1.7e+22) tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2)); elseif (x <= 82000.0) tmp = max(((-30.0 * y) - 25.0), t_0); else tmp = max(((30.0 * x) - 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[x, -1.7e+22], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 82000.0], N[Max[N[(N[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(N[(30.0 * x), $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}\;x \leq -1.7 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{elif}\;x \leq 82000:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot x - 25, t\_0\right)\\
\end{array}
\end{array}
if x < -1.7e22Initial program 29.1%
Taylor expanded in x around -inf
Applied rewrites54.9%
Taylor expanded in z around 0
Applied rewrites54.9%
Taylor expanded in y around 0
Applied rewrites54.9%
Taylor expanded in x around 0
Applied rewrites54.9%
if -1.7e22 < x < 82000Initial program 62.2%
Taylor expanded in z around 0
Applied rewrites66.8%
Taylor expanded in y around 0
Applied rewrites65.8%
Taylor expanded in z around 0
Applied rewrites64.3%
Taylor expanded in y around -inf
Applied rewrites47.7%
if 82000 < x Initial program 18.3%
Taylor expanded in z around 0
Applied rewrites74.5%
Taylor expanded in y around 0
Applied rewrites74.5%
Taylor expanded in z around 0
Applied rewrites74.5%
Taylor expanded in x around inf
Applied rewrites59.7%
(FPCore (x y z) :precision binary64 (if (<= y -1.4e+22) (fmax (* -30.0 x) (- (fabs (fma y 30.0 (sin (* 30.0 x)))) 0.2)) (fmax (- (* y 30.0) 25.0) (- (fabs (fma 30.0 x (sin (* z 30.0)))) 0.2))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.4e+22) {
tmp = fmax((-30.0 * x), (fabs(fma(y, 30.0, sin((30.0 * x)))) - 0.2));
} else {
tmp = fmax(((y * 30.0) - 25.0), (fabs(fma(30.0, x, sin((z * 30.0)))) - 0.2));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= -1.4e+22) tmp = fmax(Float64(-30.0 * x), Float64(abs(fma(y, 30.0, sin(Float64(30.0 * x)))) - 0.2)); else tmp = fmax(Float64(Float64(y * 30.0) - 25.0), Float64(abs(fma(30.0, x, sin(Float64(z * 30.0)))) - 0.2)); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, -1.4e+22], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(y * 30.0 + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[(y * 30.0), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x + N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(y, 30, \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot 30 - 25, \left|\mathsf{fma}\left(30, x, \sin \left(z \cdot 30\right)\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if y < -1.4e22Initial program 31.6%
Taylor expanded in x around -inf
Applied rewrites11.0%
Taylor expanded in z around 0
Applied rewrites10.9%
Taylor expanded in y around 0
Applied rewrites70.6%
if -1.4e22 < y Initial program 47.6%
Taylor expanded in z around 0
Applied rewrites65.0%
Taylor expanded in y around 0
Applied rewrites64.3%
Taylor expanded in x around 0
Applied rewrites35.2%
Taylor expanded in x around 0
Applied rewrites63.1%
(FPCore (x y z) :precision binary64 (fmax (- (hypot (* -30.0 x) (* -30.0 y)) 25.0) (- (fabs (* 30.0 x)) 0.2)))
double code(double x, double y, double z) {
return fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (fabs((30.0 * x)) - 0.2));
}
public static double code(double x, double y, double z) {
return fmax((Math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), (Math.abs((30.0 * x)) - 0.2));
}
def code(x, y, z): return fmax((math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), (math.fabs((30.0 * x)) - 0.2))
function code(x, y, z) return fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), Float64(abs(Float64(30.0 * x)) - 0.2)) end
function tmp = code(x, y, z) tmp = max((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (abs((30.0 * x)) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|30 \cdot x\right| - 0.2\right)
\end{array}
Initial program 43.8%
Taylor expanded in z around 0
Applied rewrites68.9%
Taylor expanded in y around 0
Applied rewrites68.4%
Taylor expanded in z around 0
Applied rewrites67.6%
Taylor expanded in x around 0
Applied rewrites67.2%
(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 43.8%
Taylor expanded in x around -inf
Applied rewrites17.2%
Taylor expanded in z around 0
Applied rewrites16.8%
Taylor expanded in y around 0
Applied rewrites16.3%
Taylor expanded in x around 0
Applied rewrites29.0%
herbie shell --seed 2025018
(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)))