
(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}
Herbie found 13 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
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)))
(if (<=
(fmax
t_1
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* t_0 (cos (* x 30.0)))))
0.2))
5e+150)
(fmax t_1 (- (fabs (fma t_0 (cos (* 30.0 x)) (sin (* 30.0 x)))) 0.2))
(fmax (* -30.0 z) (- (fabs (fma 30.0 x (sin (* 30.0 z)))) 0.2)))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double t_1 = sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0;
double tmp;
if (fmax(t_1, (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (t_0 * cos((x * 30.0))))) - 0.2)) <= 5e+150) {
tmp = fmax(t_1, (fabs(fma(t_0, cos((30.0 * x)), sin((30.0 * x)))) - 0.2));
} else {
tmp = fmax((-30.0 * z), (fabs(fma(30.0, x, sin((30.0 * z)))) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) t_1 = Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0) tmp = 0.0 if (fmax(t_1, Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(t_0 * cos(Float64(x * 30.0))))) - 0.2)) <= 5e+150) tmp = fmax(t_1, Float64(abs(fma(t_0, cos(Float64(30.0 * x)), sin(Float64(30.0 * x)))) - 0.2)); else tmp = fmax(Float64(-30.0 * z), Float64(abs(fma(30.0, x, sin(Float64(30.0 * z)))) - 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[(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]}, If[LessEqual[N[Max[t$95$1, N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 5e+150], N[Max[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]], $MachinePrecision], N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x + N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
t_1 := \sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25\\
\mathbf{if}\;\mathsf{max}\left(t\_1, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + t\_0 \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq 5 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{max}\left(t\_1, \left|\mathsf{fma}\left(t\_0, \cos \left(30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|\mathsf{fma}\left(30, x, \sin \left(30 \cdot z\right)\right)\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))) < 5.00000000000000009e150Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6499.0
Applied rewrites99.0%
if 5.00000000000000009e150 < (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) Initial program 9.6%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f649.6
Applied rewrites9.6%
Taylor expanded in z around -inf
lower-*.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6451.4
Applied rewrites51.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0))))
(if (<=
(fmax
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* t_0 (cos (* x 30.0)))))
0.2))
5e+150)
(fmax
(- (sqrt (fma (* z z) 900.0 (* 900.0 (fma x x (* y y))))) 25.0)
(- (fabs (fma t_0 (cos (* 30.0 x)) (sin (* 30.0 x)))) 0.2))
(fmax (* -30.0 z) (- (fabs (fma 30.0 x (sin (* 30.0 z)))) 0.2)))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double tmp;
if (fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (t_0 * cos((x * 30.0))))) - 0.2)) <= 5e+150) {
tmp = fmax((sqrt(fma((z * z), 900.0, (900.0 * fma(x, x, (y * y))))) - 25.0), (fabs(fma(t_0, cos((30.0 * x)), sin((30.0 * x)))) - 0.2));
} else {
tmp = fmax((-30.0 * z), (fabs(fma(30.0, x, sin((30.0 * z)))) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) tmp = 0.0 if (fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(t_0 * cos(Float64(x * 30.0))))) - 0.2)) <= 5e+150) tmp = fmax(Float64(sqrt(fma(Float64(z * z), 900.0, Float64(900.0 * fma(x, x, Float64(y * y))))) - 25.0), Float64(abs(fma(t_0, cos(Float64(30.0 * x)), sin(Float64(30.0 * x)))) - 0.2)); else tmp = fmax(Float64(-30.0 * z), Float64(abs(fma(30.0, x, sin(Float64(30.0 * z)))) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 5e+150], N[Max[N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] * 900.0 + N[(900.0 * N[(x * x + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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], N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x + N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
\mathbf{if}\;\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + t\_0 \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq 5 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\mathsf{fma}\left(z \cdot z, 900, 900 \cdot \mathsf{fma}\left(x, x, y \cdot y\right)\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)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|\mathsf{fma}\left(30, x, \sin \left(30 \cdot z\right)\right)\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))) < 5.00000000000000009e150Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6499.0
Applied rewrites99.0%
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
+-commutativeN/A
unpow-prod-downN/A
metadata-evalN/A
unpow-prod-downN/A
metadata-evalN/A
unpow-prod-downN/A
metadata-evalN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.9%
if 5.00000000000000009e150 < (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) Initial program 9.6%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f649.6
Applied rewrites9.6%
Taylor expanded in z around -inf
lower-*.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6451.4
Applied rewrites51.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0)))
(t_1
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)))
(if (<=
(fmax
t_1
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* t_0 (cos (* x 30.0)))))
0.2))
5e+150)
(fmax t_1 (- (fabs t_0) 0.2))
(fmax (* -30.0 z) (- (fabs (fma 30.0 x (sin (* 30.0 z)))) 0.2)))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double t_1 = sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0;
double tmp;
if (fmax(t_1, (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (t_0 * cos((x * 30.0))))) - 0.2)) <= 5e+150) {
tmp = fmax(t_1, (fabs(t_0) - 0.2));
} else {
tmp = fmax((-30.0 * z), (fabs(fma(30.0, x, sin((30.0 * z)))) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) t_1 = Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0) tmp = 0.0 if (fmax(t_1, Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(t_0 * cos(Float64(x * 30.0))))) - 0.2)) <= 5e+150) tmp = fmax(t_1, Float64(abs(t_0) - 0.2)); else tmp = fmax(Float64(-30.0 * z), Float64(abs(fma(30.0, x, sin(Float64(30.0 * z)))) - 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[(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]}, If[LessEqual[N[Max[t$95$1, N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 5e+150], N[Max[t$95$1, N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x + N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
t_1 := \sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25\\
\mathbf{if}\;\mathsf{max}\left(t\_1, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + t\_0 \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq 5 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{max}\left(t\_1, \left|t\_0\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|\mathsf{fma}\left(30, x, \sin \left(30 \cdot z\right)\right)\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))) < 5.00000000000000009e150Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6499.0
Applied rewrites99.0%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6498.0
Applied rewrites98.0%
if 5.00000000000000009e150 < (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) Initial program 9.6%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f649.6
Applied rewrites9.6%
Taylor expanded in z around -inf
lower-*.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6451.4
Applied rewrites51.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* 30.0 z))))
(if (<=
(fmax
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2))
5e+150)
(fmax
(- (sqrt (fma (* z z) 900.0 (* 900.0 (fma x x (* y y))))) 25.0)
(- (fabs t_0) 0.2))
(fmax (* -30.0 z) (- (fabs (fma 30.0 x t_0)) 0.2)))))
double code(double x, double y, double z) {
double t_0 = sin((30.0 * z));
double tmp;
if (fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)) <= 5e+150) {
tmp = fmax((sqrt(fma((z * z), 900.0, (900.0 * fma(x, x, (y * y))))) - 25.0), (fabs(t_0) - 0.2));
} else {
tmp = fmax((-30.0 * z), (fabs(fma(30.0, x, t_0)) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(30.0 * z)) tmp = 0.0 if (fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) <= 5e+150) tmp = fmax(Float64(sqrt(fma(Float64(z * z), 900.0, Float64(900.0 * fma(x, x, Float64(y * y))))) - 25.0), Float64(abs(t_0) - 0.2)); else tmp = fmax(Float64(-30.0 * z), Float64(abs(fma(30.0, x, t_0)) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 5e+150], N[Max[N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] * 900.0 + N[(900.0 * N[(x * x + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(30 \cdot z\right)\\
\mathbf{if}\;\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq 5 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\mathsf{fma}\left(z \cdot z, 900, 900 \cdot \mathsf{fma}\left(x, x, y \cdot y\right)\right)} - 25, \left|t\_0\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|\mathsf{fma}\left(30, x, t\_0\right)\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))) < 5.00000000000000009e150Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6499.0
Applied rewrites99.0%
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
+-commutativeN/A
unpow-prod-downN/A
metadata-evalN/A
unpow-prod-downN/A
metadata-evalN/A
unpow-prod-downN/A
metadata-evalN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.9%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6497.8
Applied rewrites97.8%
if 5.00000000000000009e150 < (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) Initial program 9.6%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f649.6
Applied rewrites9.6%
Taylor expanded in z around -inf
lower-*.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6451.4
Applied rewrites51.4%
(FPCore (x y z)
:precision binary64
(if (<=
(fmax
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2))
5e+150)
(fmax
(- (sqrt (* 900.0 (+ (fma y y (* x x)) (* z z)))) 25.0)
(- (fabs (sin (* 30.0 x))) 0.2))
(fmax (* -30.0 z) (- (fabs (fma 30.0 x (sin (* 30.0 z)))) 0.2))))
double code(double x, double y, double z) {
double tmp;
if (fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)) <= 5e+150) {
tmp = fmax((sqrt((900.0 * (fma(y, y, (x * x)) + (z * z)))) - 25.0), (fabs(sin((30.0 * x))) - 0.2));
} else {
tmp = fmax((-30.0 * z), (fabs(fma(30.0, x, sin((30.0 * z)))) - 0.2));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) <= 5e+150) tmp = fmax(Float64(sqrt(Float64(900.0 * Float64(fma(y, y, Float64(x * x)) + Float64(z * z)))) - 25.0), Float64(abs(sin(Float64(30.0 * x))) - 0.2)); else tmp = fmax(Float64(-30.0 * z), Float64(abs(fma(30.0, x, sin(Float64(30.0 * z)))) - 0.2)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 5e+150], N[Max[N[(N[Sqrt[N[(900.0 * N[(N[(y * y + N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x + N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $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|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq 5 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{900 \cdot \left(\mathsf{fma}\left(y, y, x \cdot x\right) + z \cdot z\right)} - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|\mathsf{fma}\left(30, x, \sin \left(30 \cdot z\right)\right)\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))) < 5.00000000000000009e150Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6499.0
Applied rewrites99.0%
Taylor expanded in z around 0
lift-sin.f64N/A
lift-*.f6498.1
Applied rewrites98.1%
Applied rewrites98.0%
if 5.00000000000000009e150 < (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) Initial program 9.6%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f649.6
Applied rewrites9.6%
Taylor expanded in z around -inf
lower-*.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6451.4
Applied rewrites51.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* 30.0 z)))
(t_1 (fmax (* -30.0 z) (- (fabs (fma 30.0 x t_0)) 0.2))))
(if (<= z -5.5e-25)
t_1
(if (<= z 42000000.0)
(fmax
(- (sqrt (* (fma y y (* x x)) 900.0)) 25.0)
(- (fabs (sin (* 30.0 x))) 0.2))
(if (<= z 5.8e+76) t_1 (fmax (* 30.0 z) (- (fabs t_0) 0.2)))))))
double code(double x, double y, double z) {
double t_0 = sin((30.0 * z));
double t_1 = fmax((-30.0 * z), (fabs(fma(30.0, x, t_0)) - 0.2));
double tmp;
if (z <= -5.5e-25) {
tmp = t_1;
} else if (z <= 42000000.0) {
tmp = fmax((sqrt((fma(y, y, (x * x)) * 900.0)) - 25.0), (fabs(sin((30.0 * x))) - 0.2));
} else if (z <= 5.8e+76) {
tmp = t_1;
} else {
tmp = fmax((30.0 * z), (fabs(t_0) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(30.0 * z)) t_1 = fmax(Float64(-30.0 * z), Float64(abs(fma(30.0, x, t_0)) - 0.2)) tmp = 0.0 if (z <= -5.5e-25) tmp = t_1; elseif (z <= 42000000.0) tmp = fmax(Float64(sqrt(Float64(fma(y, y, Float64(x * x)) * 900.0)) - 25.0), Float64(abs(sin(Float64(30.0 * x))) - 0.2)); elseif (z <= 5.8e+76) tmp = t_1; else tmp = fmax(Float64(30.0 * z), Float64(abs(t_0) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -5.5e-25], t$95$1, If[LessEqual[z, 42000000.0], N[Max[N[(N[Sqrt[N[(N[(y * y + N[(x * x), $MachinePrecision]), $MachinePrecision] * 900.0), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 5.8e+76], t$95$1, N[Max[N[(30.0 * z), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(30 \cdot z\right)\\
t_1 := \mathsf{max}\left(-30 \cdot z, \left|\mathsf{fma}\left(30, x, t\_0\right)\right| - 0.2\right)\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 42000000:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\mathsf{fma}\left(y, y, x \cdot x\right) \cdot 900} - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot z, \left|t\_0\right| - 0.2\right)\\
\end{array}
\end{array}
if z < -5.50000000000000004e-25 or 4.2e7 < z < 5.8000000000000003e76Initial program 39.6%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6439.5
Applied rewrites39.5%
Taylor expanded in z around -inf
lower-*.f6446.7
Applied rewrites46.7%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6468.3
Applied rewrites68.3%
if -5.50000000000000004e-25 < z < 4.2e7Initial program 59.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6459.3
Applied rewrites59.3%
Taylor expanded in z around 0
lift-sin.f64N/A
lift-*.f6459.0
Applied rewrites59.0%
Taylor expanded in z around 0
lower-sqrt.f64N/A
distribute-lft-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lower-*.f6458.5
Applied rewrites58.5%
if 5.8000000000000003e76 < z Initial program 39.6%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6439.5
Applied rewrites39.5%
Taylor expanded in z around -inf
lower-*.f6446.7
Applied rewrites46.7%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6446.7
Applied rewrites46.7%
Taylor expanded in z around inf
lift-*.f649.8
Applied rewrites9.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* 30.0 z))) (t_1 (- (fabs t_0) 0.2)))
(if (<= z -2.45e-207)
(fmax (* -30.0 z) (- (fabs (* 30.0 x)) 0.2))
(if (<= z 2.55e-77)
(fmax (- (sqrt (* (* y y) 900.0)) 25.0) t_1)
(if (<= z 5.8e+76)
(fmax (* -30.0 z) (- (fabs (fma 30.0 x t_0)) 0.2))
(fmax (* 30.0 z) t_1))))))
double code(double x, double y, double z) {
double t_0 = sin((30.0 * z));
double t_1 = fabs(t_0) - 0.2;
double tmp;
if (z <= -2.45e-207) {
tmp = fmax((-30.0 * z), (fabs((30.0 * x)) - 0.2));
} else if (z <= 2.55e-77) {
tmp = fmax((sqrt(((y * y) * 900.0)) - 25.0), t_1);
} else if (z <= 5.8e+76) {
tmp = fmax((-30.0 * z), (fabs(fma(30.0, x, t_0)) - 0.2));
} else {
tmp = fmax((30.0 * z), t_1);
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(30.0 * z)) t_1 = Float64(abs(t_0) - 0.2) tmp = 0.0 if (z <= -2.45e-207) tmp = fmax(Float64(-30.0 * z), Float64(abs(Float64(30.0 * x)) - 0.2)); elseif (z <= 2.55e-77) tmp = fmax(Float64(sqrt(Float64(Float64(y * y) * 900.0)) - 25.0), t_1); elseif (z <= 5.8e+76) tmp = fmax(Float64(-30.0 * z), Float64(abs(fma(30.0, x, t_0)) - 0.2)); else tmp = fmax(Float64(30.0 * z), t_1); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[z, -2.45e-207], N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2.55e-77], N[Max[N[(N[Sqrt[N[(N[(y * y), $MachinePrecision] * 900.0), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision], If[LessEqual[z, 5.8e+76], N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(30.0 * z), $MachinePrecision], t$95$1], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(30 \cdot z\right)\\
t_1 := \left|t\_0\right| - 0.2\\
\mathbf{if}\;z \leq -2.45 \cdot 10^{-207}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-77}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\left(y \cdot y\right) \cdot 900} - 25, t\_1\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|\mathsf{fma}\left(30, x, t\_0\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot z, t\_1\right)\\
\end{array}
\end{array}
if z < -2.45e-207Initial program 44.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6444.0
Applied rewrites44.0%
Taylor expanded in z around -inf
lower-*.f6436.9
Applied rewrites36.9%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Taylor expanded in z around 0
lift-*.f6462.5
Applied rewrites62.5%
if -2.45e-207 < z < 2.55000000000000016e-77Initial program 60.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6459.3
Applied rewrites59.3%
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
+-commutativeN/A
unpow-prod-downN/A
metadata-evalN/A
unpow-prod-downN/A
metadata-evalN/A
unpow-prod-downN/A
metadata-evalN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites59.2%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6458.5
Applied rewrites58.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6443.3
Applied rewrites43.3%
if 2.55000000000000016e-77 < z < 5.8000000000000003e76Initial program 59.4%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6459.1
Applied rewrites59.1%
Taylor expanded in z around -inf
lower-*.f645.4
Applied rewrites5.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6437.9
Applied rewrites37.9%
if 5.8000000000000003e76 < z Initial program 25.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6425.3
Applied rewrites25.3%
Taylor expanded in z around -inf
lower-*.f643.6
Applied rewrites3.6%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f643.6
Applied rewrites3.6%
Taylor expanded in z around inf
lift-*.f6469.6
Applied rewrites69.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* 30.0 z))) (t_1 (- (fabs t_0) 0.2)))
(if (<= z -5.8e-207)
(fmax (* -30.0 z) (- (fabs (* 30.0 x)) 0.2))
(if (<= z 2.55e-77)
(fmax (- (* -30.0 y) 25.0) t_1)
(if (<= z 5.8e+76)
(fmax (* -30.0 z) (- (fabs (fma 30.0 x t_0)) 0.2))
(fmax (* 30.0 z) t_1))))))
double code(double x, double y, double z) {
double t_0 = sin((30.0 * z));
double t_1 = fabs(t_0) - 0.2;
double tmp;
if (z <= -5.8e-207) {
tmp = fmax((-30.0 * z), (fabs((30.0 * x)) - 0.2));
} else if (z <= 2.55e-77) {
tmp = fmax(((-30.0 * y) - 25.0), t_1);
} else if (z <= 5.8e+76) {
tmp = fmax((-30.0 * z), (fabs(fma(30.0, x, t_0)) - 0.2));
} else {
tmp = fmax((30.0 * z), t_1);
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(30.0 * z)) t_1 = Float64(abs(t_0) - 0.2) tmp = 0.0 if (z <= -5.8e-207) tmp = fmax(Float64(-30.0 * z), Float64(abs(Float64(30.0 * x)) - 0.2)); elseif (z <= 2.55e-77) tmp = fmax(Float64(Float64(-30.0 * y) - 25.0), t_1); elseif (z <= 5.8e+76) tmp = fmax(Float64(-30.0 * z), Float64(abs(fma(30.0, x, t_0)) - 0.2)); else tmp = fmax(Float64(30.0 * z), t_1); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[z, -5.8e-207], N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2.55e-77], N[Max[N[(N[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision], If[LessEqual[z, 5.8e+76], N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(30.0 * z), $MachinePrecision], t$95$1], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(30 \cdot z\right)\\
t_1 := \left|t\_0\right| - 0.2\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{-207}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-77}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, t\_1\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|\mathsf{fma}\left(30, x, t\_0\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot z, t\_1\right)\\
\end{array}
\end{array}
if z < -5.80000000000000022e-207Initial program 44.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6444.0
Applied rewrites44.0%
Taylor expanded in z around -inf
lower-*.f6437.0
Applied rewrites37.0%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Taylor expanded in z around 0
lift-*.f6462.5
Applied rewrites62.5%
if -5.80000000000000022e-207 < z < 2.55000000000000016e-77Initial program 60.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6459.3
Applied rewrites59.3%
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
+-commutativeN/A
unpow-prod-downN/A
metadata-evalN/A
unpow-prod-downN/A
metadata-evalN/A
unpow-prod-downN/A
metadata-evalN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites59.2%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6458.5
Applied rewrites58.5%
Taylor expanded in y around -inf
lower-*.f6445.0
Applied rewrites45.0%
if 2.55000000000000016e-77 < z < 5.8000000000000003e76Initial program 59.4%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6459.1
Applied rewrites59.1%
Taylor expanded in z around -inf
lower-*.f645.4
Applied rewrites5.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6437.9
Applied rewrites37.9%
if 5.8000000000000003e76 < z Initial program 25.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6425.3
Applied rewrites25.3%
Taylor expanded in z around -inf
lower-*.f643.6
Applied rewrites3.6%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f643.6
Applied rewrites3.6%
Taylor expanded in z around inf
lift-*.f6469.6
Applied rewrites69.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fmax (* -30.0 z) (- (fabs (* 30.0 x)) 0.2)))
(t_1 (- (fabs (sin (* 30.0 z))) 0.2)))
(if (<= z -5.8e-207)
t_0
(if (<= z 2.55e-77)
(fmax (- (* -30.0 y) 25.0) t_1)
(if (<= z 2.55e+73) t_0 (fmax (* 30.0 z) t_1))))))
double code(double x, double y, double z) {
double t_0 = fmax((-30.0 * z), (fabs((30.0 * x)) - 0.2));
double t_1 = fabs(sin((30.0 * z))) - 0.2;
double tmp;
if (z <= -5.8e-207) {
tmp = t_0;
} else if (z <= 2.55e-77) {
tmp = fmax(((-30.0 * y) - 25.0), t_1);
} else if (z <= 2.55e+73) {
tmp = t_0;
} else {
tmp = fmax((30.0 * z), t_1);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = fmax(((-30.0d0) * z), (abs((30.0d0 * x)) - 0.2d0))
t_1 = abs(sin((30.0d0 * z))) - 0.2d0
if (z <= (-5.8d-207)) then
tmp = t_0
else if (z <= 2.55d-77) then
tmp = fmax((((-30.0d0) * y) - 25.0d0), t_1)
else if (z <= 2.55d+73) then
tmp = t_0
else
tmp = fmax((30.0d0 * z), t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = fmax((-30.0 * z), (Math.abs((30.0 * x)) - 0.2));
double t_1 = Math.abs(Math.sin((30.0 * z))) - 0.2;
double tmp;
if (z <= -5.8e-207) {
tmp = t_0;
} else if (z <= 2.55e-77) {
tmp = fmax(((-30.0 * y) - 25.0), t_1);
} else if (z <= 2.55e+73) {
tmp = t_0;
} else {
tmp = fmax((30.0 * z), t_1);
}
return tmp;
}
def code(x, y, z): t_0 = fmax((-30.0 * z), (math.fabs((30.0 * x)) - 0.2)) t_1 = math.fabs(math.sin((30.0 * z))) - 0.2 tmp = 0 if z <= -5.8e-207: tmp = t_0 elif z <= 2.55e-77: tmp = fmax(((-30.0 * y) - 25.0), t_1) elif z <= 2.55e+73: tmp = t_0 else: tmp = fmax((30.0 * z), t_1) return tmp
function code(x, y, z) t_0 = fmax(Float64(-30.0 * z), Float64(abs(Float64(30.0 * x)) - 0.2)) t_1 = Float64(abs(sin(Float64(30.0 * z))) - 0.2) tmp = 0.0 if (z <= -5.8e-207) tmp = t_0; elseif (z <= 2.55e-77) tmp = fmax(Float64(Float64(-30.0 * y) - 25.0), t_1); elseif (z <= 2.55e+73) tmp = t_0; else tmp = fmax(Float64(30.0 * z), t_1); end return tmp end
function tmp_2 = code(x, y, z) t_0 = max((-30.0 * z), (abs((30.0 * x)) - 0.2)); t_1 = abs(sin((30.0 * z))) - 0.2; tmp = 0.0; if (z <= -5.8e-207) tmp = t_0; elseif (z <= 2.55e-77) tmp = max(((-30.0 * y) - 25.0), t_1); elseif (z <= 2.55e+73) tmp = t_0; else tmp = max((30.0 * z), t_1); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[z, -5.8e-207], t$95$0, If[LessEqual[z, 2.55e-77], N[Max[N[(N[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision], If[LessEqual[z, 2.55e+73], t$95$0, N[Max[N[(30.0 * z), $MachinePrecision], t$95$1], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{max}\left(-30 \cdot z, \left|30 \cdot x\right| - 0.2\right)\\
t_1 := \left|\sin \left(30 \cdot z\right)\right| - 0.2\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{-207}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-77}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, t\_1\right)\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{+73}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot z, t\_1\right)\\
\end{array}
\end{array}
if z < -5.80000000000000022e-207 or 2.55000000000000016e-77 < z < 2.55000000000000012e73Initial program 47.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6447.6
Applied rewrites47.6%
Taylor expanded in z around -inf
lower-*.f6429.7
Applied rewrites29.7%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6429.7
Applied rewrites29.7%
Taylor expanded in z around 0
lift-*.f6456.5
Applied rewrites56.5%
if -5.80000000000000022e-207 < z < 2.55000000000000016e-77Initial program 60.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6459.3
Applied rewrites59.3%
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
+-commutativeN/A
unpow-prod-downN/A
metadata-evalN/A
unpow-prod-downN/A
metadata-evalN/A
unpow-prod-downN/A
metadata-evalN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites59.2%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6458.5
Applied rewrites58.5%
Taylor expanded in y around -inf
lower-*.f6445.0
Applied rewrites45.0%
if 2.55000000000000012e73 < z Initial program 47.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6447.6
Applied rewrites47.6%
Taylor expanded in z around -inf
lower-*.f6429.7
Applied rewrites29.7%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6429.2
Applied rewrites29.2%
Taylor expanded in z around inf
lift-*.f646.9
Applied rewrites6.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 z))) 0.2)))
(if (<= y -53.0)
(fmax (* -30.0 y) t_0)
(if (<= y 1.55e+88)
(fmax (* -30.0 z) (- (fabs (* 30.0 x)) 0.2))
(fmax (* 30.0 y) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs(sin((30.0 * z))) - 0.2;
double tmp;
if (y <= -53.0) {
tmp = fmax((-30.0 * y), t_0);
} else if (y <= 1.55e+88) {
tmp = fmax((-30.0 * z), (fabs((30.0 * x)) - 0.2));
} else {
tmp = fmax((30.0 * y), 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 * z))) - 0.2d0
if (y <= (-53.0d0)) then
tmp = fmax(((-30.0d0) * y), t_0)
else if (y <= 1.55d+88) then
tmp = fmax(((-30.0d0) * z), (abs((30.0d0 * x)) - 0.2d0))
else
tmp = fmax((30.0d0 * y), 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 * z))) - 0.2;
double tmp;
if (y <= -53.0) {
tmp = fmax((-30.0 * y), t_0);
} else if (y <= 1.55e+88) {
tmp = fmax((-30.0 * z), (Math.abs((30.0 * x)) - 0.2));
} else {
tmp = fmax((30.0 * y), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((30.0 * z))) - 0.2 tmp = 0 if y <= -53.0: tmp = fmax((-30.0 * y), t_0) elif y <= 1.55e+88: tmp = fmax((-30.0 * z), (math.fabs((30.0 * x)) - 0.2)) else: tmp = fmax((30.0 * y), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(30.0 * z))) - 0.2) tmp = 0.0 if (y <= -53.0) tmp = fmax(Float64(-30.0 * y), t_0); elseif (y <= 1.55e+88) tmp = fmax(Float64(-30.0 * z), Float64(abs(Float64(30.0 * x)) - 0.2)); else tmp = fmax(Float64(30.0 * y), t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(sin((30.0 * z))) - 0.2; tmp = 0.0; if (y <= -53.0) tmp = max((-30.0 * y), t_0); elseif (y <= 1.55e+88) tmp = max((-30.0 * z), (abs((30.0 * x)) - 0.2)); else tmp = max((30.0 * y), t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[y, -53.0], N[Max[N[(-30.0 * y), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[y, 1.55e+88], N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(30.0 * y), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot z\right)\right| - 0.2\\
\mathbf{if}\;y \leq -53:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, t\_0\right)\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+88}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot y, t\_0\right)\\
\end{array}
\end{array}
if y < -53Initial program 33.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6433.3
Applied rewrites33.3%
Taylor expanded in z around -inf
lower-*.f6413.0
Applied rewrites13.0%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6412.5
Applied rewrites12.5%
Taylor expanded in y around -inf
lower-*.f6460.7
Applied rewrites60.7%
if -53 < y < 1.5500000000000001e88Initial program 59.6%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6458.9
Applied rewrites58.9%
Taylor expanded in z around -inf
lower-*.f6421.8
Applied rewrites21.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6430.2
Applied rewrites30.2%
Taylor expanded in z around 0
lift-*.f6454.7
Applied rewrites54.7%
if 1.5500000000000001e88 < y Initial program 23.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6423.8
Applied rewrites23.8%
Taylor expanded in z around -inf
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6410.8
Applied rewrites10.8%
Taylor expanded in y around inf
lower-*.f6469.8
Applied rewrites69.8%
(FPCore (x y z) :precision binary64 (if (<= y -53.0) (fmax (* -30.0 y) (- (fabs (sin (* 30.0 z))) 0.2)) (fmax (* -30.0 z) (- (fabs (* 30.0 x)) 0.2))))
double code(double x, double y, double z) {
double tmp;
if (y <= -53.0) {
tmp = fmax((-30.0 * y), (fabs(sin((30.0 * z))) - 0.2));
} else {
tmp = fmax((-30.0 * z), (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 (y <= (-53.0d0)) then
tmp = fmax(((-30.0d0) * y), (abs(sin((30.0d0 * z))) - 0.2d0))
else
tmp = fmax(((-30.0d0) * z), (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 (y <= -53.0) {
tmp = fmax((-30.0 * y), (Math.abs(Math.sin((30.0 * z))) - 0.2));
} else {
tmp = fmax((-30.0 * z), (Math.abs((30.0 * x)) - 0.2));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -53.0: tmp = fmax((-30.0 * y), (math.fabs(math.sin((30.0 * z))) - 0.2)) else: tmp = fmax((-30.0 * z), (math.fabs((30.0 * x)) - 0.2)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -53.0) tmp = fmax(Float64(-30.0 * y), Float64(abs(sin(Float64(30.0 * z))) - 0.2)); else tmp = fmax(Float64(-30.0 * z), Float64(abs(Float64(30.0 * x)) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -53.0) tmp = max((-30.0 * y), (abs(sin((30.0 * z))) - 0.2)); else tmp = max((-30.0 * z), (abs((30.0 * x)) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -53.0], N[Max[N[(-30.0 * y), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -53:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\sin \left(30 \cdot z\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|30 \cdot x\right| - 0.2\right)\\
\end{array}
\end{array}
if y < -53Initial program 33.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6433.3
Applied rewrites33.3%
Taylor expanded in z around -inf
lower-*.f6413.0
Applied rewrites13.0%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6412.5
Applied rewrites12.5%
Taylor expanded in y around -inf
lower-*.f6460.7
Applied rewrites60.7%
if -53 < y Initial program 51.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6450.8
Applied rewrites50.8%
Taylor expanded in z around -inf
lower-*.f6419.4
Applied rewrites19.4%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6426.2
Applied rewrites26.2%
Taylor expanded in z around 0
lift-*.f6448.3
Applied rewrites48.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fmax (* -30.0 z) (- (fabs (* 30.0 x)) 0.2))))
(if (<= x -700.0)
t_0
(if (<= x 2.9e+37)
(fmax
(* -30.0 z)
(- (fabs (fma (fma -13500.0 (* x x) 30.0) z (* 30.0 x))) 0.2))
t_0))))
double code(double x, double y, double z) {
double t_0 = fmax((-30.0 * z), (fabs((30.0 * x)) - 0.2));
double tmp;
if (x <= -700.0) {
tmp = t_0;
} else if (x <= 2.9e+37) {
tmp = fmax((-30.0 * z), (fabs(fma(fma(-13500.0, (x * x), 30.0), z, (30.0 * x))) - 0.2));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = fmax(Float64(-30.0 * z), Float64(abs(Float64(30.0 * x)) - 0.2)) tmp = 0.0 if (x <= -700.0) tmp = t_0; elseif (x <= 2.9e+37) tmp = fmax(Float64(-30.0 * z), Float64(abs(fma(fma(-13500.0, Float64(x * x), 30.0), z, Float64(30.0 * x))) - 0.2)); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -700.0], t$95$0, If[LessEqual[x, 2.9e+37], N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(N[(-13500.0 * N[(x * x), $MachinePrecision] + 30.0), $MachinePrecision] * z + N[(30.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{max}\left(-30 \cdot z, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{if}\;x \leq -700:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|\mathsf{fma}\left(\mathsf{fma}\left(-13500, x \cdot x, 30\right), z, 30 \cdot x\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -700 or 2.89999999999999978e37 < x Initial program 31.7%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6431.7
Applied rewrites31.7%
Taylor expanded in z around -inf
lower-*.f6413.4
Applied rewrites13.4%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6425.4
Applied rewrites25.4%
Taylor expanded in z around 0
lift-*.f6470.0
Applied rewrites70.0%
if -700 < x < 2.89999999999999978e37Initial program 60.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6459.3
Applied rewrites59.3%
Taylor expanded in z around -inf
lower-*.f6421.7
Applied rewrites21.7%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6438.3
Applied rewrites38.3%
(FPCore (x y z) :precision binary64 (fmax (* -30.0 z) (- (fabs (* 30.0 x)) 0.2)))
double code(double x, double y, double z) {
return fmax((-30.0 * z), (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) * z), (abs((30.0d0 * x)) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((-30.0 * z), (Math.abs((30.0 * x)) - 0.2));
}
def code(x, y, z): return fmax((-30.0 * z), (math.fabs((30.0 * x)) - 0.2))
function code(x, y, z) return fmax(Float64(-30.0 * z), Float64(abs(Float64(30.0 * x)) - 0.2)) end
function tmp = code(x, y, z) tmp = max((-30.0 * z), (abs((30.0 * x)) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(-30 \cdot z, \left|30 \cdot x\right| - 0.2\right)
\end{array}
Initial program 46.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around -inf
lower-*.f6417.8
Applied rewrites17.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f6423.8
Applied rewrites23.8%
Taylor expanded in z around 0
lift-*.f6444.3
Applied rewrites44.3%
herbie shell --seed 2025117
(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)))