
(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]
\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right)
Herbie found 19 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]
\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right)
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (sin (* z 30.0)) (cos (* x 30.0))))
(t_1
(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))
0.2))))
(if (<= t_1 1e+152)
t_1
(fmax
(* -30.0 y)
(- (fabs (+ (fma 30.0 x (* 30.0 (* y (cos (* 30.0 z))))) t_0)) 0.2)))))double code(double x, double y, double z) {
double t_0 = sin((z * 30.0)) * cos((x * 30.0));
double t_1 = 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)) - 0.2));
double tmp;
if (t_1 <= 1e+152) {
tmp = t_1;
} else {
tmp = fmax((-30.0 * y), (fabs((fma(30.0, x, (30.0 * (y * cos((30.0 * z))))) + t_0)) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))) t_1 = 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)))) + t_0)) - 0.2)) tmp = 0.0 if (t_1 <= 1e+152) tmp = t_1; else tmp = fmax(Float64(-30.0 * y), Float64(abs(Float64(fma(30.0, x, Float64(30.0 * Float64(y * cos(Float64(30.0 * z))))) + t_0)) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 1e+152], t$95$1, N[Max[N[(-30.0 * y), $MachinePrecision], N[(N[Abs[N[(N[(30.0 * x + N[(30.0 * N[(y * N[Cos[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\\
t_1 := \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\right| - 0.2\right)\\
\mathbf{if}\;t\_1 \leq 10^{+152}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\mathsf{fma}\left(30, x, 30 \cdot \left(y \cdot \cos \left(30 \cdot z\right)\right)\right) + t\_0\right| - 0.2\right)\\
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 1e152Initial program 46.2%
if 1e152 < (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 46.2%
Taylor expanded in y around -inf
lower-*.f6417.9%
Applied rewrites17.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6437.3%
Applied rewrites37.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0)))
(t_1 (* t_0 (cos (* x 30.0))))
(t_2 (sin (* y 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))) (* t_2 (cos (* z 30.0))))
t_1))
0.2))
4e+143)
(fmax
(-
(fabs
(fma
(cos (* -30.0 x))
t_0
(fma (cos (* -30.0 z)) t_2 (* (cos (* -30.0 y)) (sin (* 30.0 x))))))
0.2)
(-
(sqrt (fma (* z z) 900.0 (fma (* x x) 900.0 (* (* y y) 900.0))))
25.0))
(fmax
(* -30.0 y)
(- (fabs (+ (fma 30.0 x (* 30.0 (* y (cos (* 30.0 z))))) t_1)) 0.2)))))double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double t_1 = t_0 * cos((x * 30.0));
double t_2 = sin((y * 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))) + (t_2 * cos((z * 30.0)))) + t_1)) - 0.2)) <= 4e+143) {
tmp = fmax((fabs(fma(cos((-30.0 * x)), t_0, fma(cos((-30.0 * z)), t_2, (cos((-30.0 * y)) * sin((30.0 * x)))))) - 0.2), (sqrt(fma((z * z), 900.0, fma((x * x), 900.0, ((y * y) * 900.0)))) - 25.0));
} else {
tmp = fmax((-30.0 * y), (fabs((fma(30.0, x, (30.0 * (y * cos((30.0 * z))))) + t_1)) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) t_1 = Float64(t_0 * cos(Float64(x * 30.0))) t_2 = sin(Float64(y * 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(t_2 * cos(Float64(z * 30.0)))) + t_1)) - 0.2)) <= 4e+143) tmp = fmax(Float64(abs(fma(cos(Float64(-30.0 * x)), t_0, fma(cos(Float64(-30.0 * z)), t_2, Float64(cos(Float64(-30.0 * y)) * sin(Float64(30.0 * x)))))) - 0.2), Float64(sqrt(fma(Float64(z * z), 900.0, fma(Float64(x * x), 900.0, Float64(Float64(y * y) * 900.0)))) - 25.0)); else tmp = fmax(Float64(-30.0 * y), Float64(abs(Float64(fma(30.0, x, Float64(30.0 * Float64(y * cos(Float64(30.0 * z))))) + 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[(t$95$0 * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(y * 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[(t$95$2 * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 4e+143], N[Max[N[(N[Abs[N[(N[Cos[N[(-30.0 * x), $MachinePrecision]], $MachinePrecision] * t$95$0 + N[(N[Cos[N[(-30.0 * z), $MachinePrecision]], $MachinePrecision] * t$95$2 + N[(N[Cos[N[(-30.0 * y), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision], N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] * 900.0 + N[(N[(x * x), $MachinePrecision] * 900.0 + N[(N[(y * y), $MachinePrecision] * 900.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * y), $MachinePrecision], N[(N[Abs[N[(N[(30.0 * x + N[(30.0 * N[(y * N[Cos[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
t_1 := t\_0 \cdot \cos \left(x \cdot 30\right)\\
t_2 := \sin \left(y \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) + t\_2 \cdot \cos \left(z \cdot 30\right)\right) + t\_1\right| - 0.2\right) \leq 4 \cdot 10^{+143}:\\
\;\;\;\;\mathsf{max}\left(\left|\mathsf{fma}\left(\cos \left(-30 \cdot x\right), t\_0, \mathsf{fma}\left(\cos \left(-30 \cdot z\right), t\_2, \cos \left(-30 \cdot y\right) \cdot \sin \left(30 \cdot x\right)\right)\right)\right| - 0.2, \sqrt{\mathsf{fma}\left(z \cdot z, 900, \mathsf{fma}\left(x \cdot x, 900, \left(y \cdot y\right) \cdot 900\right)\right)} - 25\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\mathsf{fma}\left(30, x, 30 \cdot \left(y \cdot \cos \left(30 \cdot z\right)\right)\right) + t\_1\right| - 0.2\right)\\
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 4.0000000000000001e143Initial program 46.2%
Applied rewrites46.1%
if 4.0000000000000001e143 < (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 46.2%
Taylor expanded in y around -inf
lower-*.f6417.9%
Applied rewrites17.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6437.3%
Applied rewrites37.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (sin (* z 30.0)) (cos (* x 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))
0.2))
1e+152)
(fmax
t_1
(-
(fabs (+ (sin (* 30.0 y)) (* (cos (* 30.0 y)) (sin (* 30.0 x)))))
0.2))
(fmax
(* -30.0 y)
(- (fabs (+ (fma 30.0 x (* 30.0 (* y (cos (* 30.0 z))))) t_0)) 0.2)))))double code(double x, double y, double z) {
double t_0 = sin((z * 30.0)) * cos((x * 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)) - 0.2)) <= 1e+152) {
tmp = fmax(t_1, (fabs((sin((30.0 * y)) + (cos((30.0 * y)) * sin((30.0 * x))))) - 0.2));
} else {
tmp = fmax((-30.0 * y), (fabs((fma(30.0, x, (30.0 * (y * cos((30.0 * z))))) + t_0)) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 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)))) + t_0)) - 0.2)) <= 1e+152) tmp = fmax(t_1, Float64(abs(Float64(sin(Float64(30.0 * y)) + Float64(cos(Float64(30.0 * y)) * sin(Float64(30.0 * x))))) - 0.2)); else tmp = fmax(Float64(-30.0 * y), Float64(abs(Float64(fma(30.0, x, Float64(30.0 * Float64(y * cos(Float64(30.0 * z))))) + t_0)) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $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] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 1e+152], N[Max[t$95$1, N[(N[Abs[N[(N[Sin[N[(30.0 * y), $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(30.0 * y), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * y), $MachinePrecision], N[(N[Abs[N[(N[(30.0 * x + N[(30.0 * N[(y * N[Cos[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right) \cdot \cos \left(x \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\right| - 0.2\right) \leq 10^{+152}:\\
\;\;\;\;\mathsf{max}\left(t\_1, \left|\sin \left(30 \cdot y\right) + \cos \left(30 \cdot y\right) \cdot \sin \left(30 \cdot x\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\mathsf{fma}\left(30, x, 30 \cdot \left(y \cdot \cos \left(30 \cdot z\right)\right)\right) + t\_0\right| - 0.2\right)\\
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 1e152Initial program 46.2%
Taylor expanded in z around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
if 1e152 < (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 46.2%
Taylor expanded in y around -inf
lower-*.f6417.9%
Applied rewrites17.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6437.3%
Applied rewrites37.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (sin (* z 30.0)) (cos (* x 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))
0.2))
1e+152)
(fmax
t_1
(-
(fabs (+ (sin (* 30.0 x)) (* (cos (* 30.0 x)) (sin (* 30.0 z)))))
0.2))
(fmax
(* -30.0 y)
(- (fabs (+ (fma 30.0 x (* 30.0 (* y (cos (* 30.0 z))))) t_0)) 0.2)))))double code(double x, double y, double z) {
double t_0 = sin((z * 30.0)) * cos((x * 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)) - 0.2)) <= 1e+152) {
tmp = fmax(t_1, (fabs((sin((30.0 * x)) + (cos((30.0 * x)) * sin((30.0 * z))))) - 0.2));
} else {
tmp = fmax((-30.0 * y), (fabs((fma(30.0, x, (30.0 * (y * cos((30.0 * z))))) + t_0)) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 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)))) + t_0)) - 0.2)) <= 1e+152) tmp = fmax(t_1, Float64(abs(Float64(sin(Float64(30.0 * x)) + Float64(cos(Float64(30.0 * x)) * sin(Float64(30.0 * z))))) - 0.2)); else tmp = fmax(Float64(-30.0 * y), Float64(abs(Float64(fma(30.0, x, Float64(30.0 * Float64(y * cos(Float64(30.0 * z))))) + t_0)) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $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] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 1e+152], N[Max[t$95$1, N[(N[Abs[N[(N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * y), $MachinePrecision], N[(N[Abs[N[(N[(30.0 * x + N[(30.0 * N[(y * N[Cos[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right) \cdot \cos \left(x \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\right| - 0.2\right) \leq 10^{+152}:\\
\;\;\;\;\mathsf{max}\left(t\_1, \left|\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\mathsf{fma}\left(30, x, 30 \cdot \left(y \cdot \cos \left(30 \cdot z\right)\right)\right) + t\_0\right| - 0.2\right)\\
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 1e152Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
if 1e152 < (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 46.2%
Taylor expanded in y around -inf
lower-*.f6417.9%
Applied rewrites17.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6437.3%
Applied rewrites37.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (sin (* z 30.0)) (cos (* x 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))
0.2))
4e+143)
(fmax
(- (sqrt (fma (fma y y (* x x)) 900.0 (* 900.0 (* z z)))) 25.0)
(-
(fabs (+ (sin (* 30.0 x)) (* (cos (* 30.0 x)) (sin (* 30.0 z)))))
0.2))
(fmax
(* -30.0 y)
(- (fabs (+ (fma 30.0 x (* 30.0 (* y (cos (* 30.0 z))))) t_0)) 0.2)))))double code(double x, double y, double z) {
double t_0 = sin((z * 30.0)) * cos((x * 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)) - 0.2)) <= 4e+143) {
tmp = fmax((sqrt(fma(fma(y, y, (x * x)), 900.0, (900.0 * (z * z)))) - 25.0), (fabs((sin((30.0 * x)) + (cos((30.0 * x)) * sin((30.0 * z))))) - 0.2));
} else {
tmp = fmax((-30.0 * y), (fabs((fma(30.0, x, (30.0 * (y * cos((30.0 * z))))) + t_0)) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 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)))) + t_0)) - 0.2)) <= 4e+143) tmp = fmax(Float64(sqrt(fma(fma(y, y, Float64(x * x)), 900.0, Float64(900.0 * Float64(z * z)))) - 25.0), Float64(abs(Float64(sin(Float64(30.0 * x)) + Float64(cos(Float64(30.0 * x)) * sin(Float64(30.0 * z))))) - 0.2)); else tmp = fmax(Float64(-30.0 * y), Float64(abs(Float64(fma(30.0, x, Float64(30.0 * Float64(y * cos(Float64(30.0 * z))))) + t_0)) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $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] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 4e+143], N[Max[N[(N[Sqrt[N[(N[(y * y + N[(x * x), $MachinePrecision]), $MachinePrecision] * 900.0 + N[(900.0 * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * y), $MachinePrecision], N[(N[Abs[N[(N[(30.0 * x + N[(30.0 * N[(y * N[Cos[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right) \cdot \cos \left(x \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\right| - 0.2\right) \leq 4 \cdot 10^{+143}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(y, y, x \cdot x\right), 900, 900 \cdot \left(z \cdot z\right)\right)} - 25, \left|\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\mathsf{fma}\left(30, x, 30 \cdot \left(y \cdot \cos \left(30 \cdot z\right)\right)\right) + t\_0\right| - 0.2\right)\\
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 4.0000000000000001e143Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
lift-*.f64N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
lift-*.f64N/A
metadata-evalN/A
associate-+l+N/A
Applied rewrites45.8%
if 4.0000000000000001e143 < (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 46.2%
Taylor expanded in y around -inf
lower-*.f6417.9%
Applied rewrites17.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6437.3%
Applied rewrites37.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0))) (t_1 (* t_0 (cos (* x 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_1))
0.2))
4e+143)
(fmax
(- (sqrt (* 900.0 (fma z z (fma y y (* x x))))) 25.0)
(- (fabs (fma (cos (* -30.0 x)) t_0 (sin (* 30.0 x)))) 0.2))
(fmax
(* -30.0 y)
(- (fabs (+ (fma 30.0 x (* 30.0 (* y (cos (* 30.0 z))))) t_1)) 0.2)))))double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double t_1 = t_0 * cos((x * 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_1)) - 0.2)) <= 4e+143) {
tmp = fmax((sqrt((900.0 * fma(z, z, fma(y, y, (x * x))))) - 25.0), (fabs(fma(cos((-30.0 * x)), t_0, sin((30.0 * x)))) - 0.2));
} else {
tmp = fmax((-30.0 * y), (fabs((fma(30.0, x, (30.0 * (y * cos((30.0 * z))))) + t_1)) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) t_1 = Float64(t_0 * cos(Float64(x * 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)))) + t_1)) - 0.2)) <= 4e+143) tmp = fmax(Float64(sqrt(Float64(900.0 * fma(z, z, fma(y, y, Float64(x * x))))) - 25.0), Float64(abs(fma(cos(Float64(-30.0 * x)), t_0, sin(Float64(30.0 * x)))) - 0.2)); else tmp = fmax(Float64(-30.0 * y), Float64(abs(Float64(fma(30.0, x, Float64(30.0 * Float64(y * cos(Float64(30.0 * z))))) + 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[(t$95$0 * N[Cos[N[(x * 30.0), $MachinePrecision]], $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] + t$95$1), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 4e+143], N[Max[N[(N[Sqrt[N[(900.0 * N[(z * z + N[(y * y + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[Cos[N[(-30.0 * x), $MachinePrecision]], $MachinePrecision] * t$95$0 + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * y), $MachinePrecision], N[(N[Abs[N[(N[(30.0 * x + N[(30.0 * N[(y * N[Cos[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
t_1 := t\_0 \cdot \cos \left(x \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\_1\right| - 0.2\right) \leq 4 \cdot 10^{+143}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{900 \cdot \mathsf{fma}\left(z, z, \mathsf{fma}\left(y, y, x \cdot x\right)\right)} - 25, \left|\mathsf{fma}\left(\cos \left(-30 \cdot x\right), t\_0, \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\mathsf{fma}\left(30, x, 30 \cdot \left(y \cdot \cos \left(30 \cdot z\right)\right)\right) + t\_1\right| - 0.2\right)\\
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 4.0000000000000001e143Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Applied rewrites45.8%
if 4.0000000000000001e143 < (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 46.2%
Taylor expanded in y around -inf
lower-*.f6417.9%
Applied rewrites17.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6437.3%
Applied rewrites37.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (sin (* z 30.0)) (cos (* x 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))
0.2))
1e+152)
(fmax t_1 (- (fabs (+ (sin (* 30.0 z)) (* 30.0 x))) 0.2))
(fmax
(* -30.0 y)
(- (fabs (+ (fma 30.0 x (* 30.0 (* y (cos (* 30.0 z))))) t_0)) 0.2)))))double code(double x, double y, double z) {
double t_0 = sin((z * 30.0)) * cos((x * 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)) - 0.2)) <= 1e+152) {
tmp = fmax(t_1, (fabs((sin((30.0 * z)) + (30.0 * x))) - 0.2));
} else {
tmp = fmax((-30.0 * y), (fabs((fma(30.0, x, (30.0 * (y * cos((30.0 * z))))) + t_0)) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 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)))) + t_0)) - 0.2)) <= 1e+152) tmp = fmax(t_1, Float64(abs(Float64(sin(Float64(30.0 * z)) + Float64(30.0 * x))) - 0.2)); else tmp = fmax(Float64(-30.0 * y), Float64(abs(Float64(fma(30.0, x, Float64(30.0 * Float64(y * cos(Float64(30.0 * z))))) + t_0)) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $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] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 1e+152], N[Max[t$95$1, N[(N[Abs[N[(N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] + N[(30.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * y), $MachinePrecision], N[(N[Abs[N[(N[(30.0 * x + N[(30.0 * N[(y * N[Cos[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right) \cdot \cos \left(x \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\right| - 0.2\right) \leq 10^{+152}:\\
\;\;\;\;\mathsf{max}\left(t\_1, \left|\sin \left(30 \cdot z\right) + 30 \cdot x\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\mathsf{fma}\left(30, x, 30 \cdot \left(y \cdot \cos \left(30 \cdot z\right)\right)\right) + t\_0\right| - 0.2\right)\\
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 1e152Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f6445.3%
Applied rewrites45.3%
if 1e152 < (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 46.2%
Taylor expanded in y around -inf
lower-*.f6417.9%
Applied rewrites17.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6437.3%
Applied rewrites37.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6454.8%
Applied rewrites54.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* 30.0 z)))
(t_1 (- (fabs t_0) 0.2))
(t_2
(fmax
(* z (- 30.0 (* 25.0 (/ 1.0 z))))
(- (fabs (+ (sin (* 30.0 x)) (* 30.0 (* z (cos (* 30.0 x)))))) 0.2)))
(t_3 (* 25.0 (/ 1.0 y))))
(if (<= y -1.4e+35)
(fmax (* -1.0 (* y (+ 30.0 t_3))) t_1)
(if (<= y -9.2e-63)
t_2
(if (<= y 9e-101)
(fmax
(* x (- 30.0 (* 25.0 (/ 1.0 x))))
(- (fabs (+ t_0 (* 30.0 x))) 0.2))
(if (<= y 2.7e+14) t_2 (fmax (* y (- 30.0 t_3)) 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 t_2 = fmax((z * (30.0 - (25.0 * (1.0 / z)))), (fabs((sin((30.0 * x)) + (30.0 * (z * cos((30.0 * x)))))) - 0.2));
double t_3 = 25.0 * (1.0 / y);
double tmp;
if (y <= -1.4e+35) {
tmp = fmax((-1.0 * (y * (30.0 + t_3))), t_1);
} else if (y <= -9.2e-63) {
tmp = t_2;
} else if (y <= 9e-101) {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (fabs((t_0 + (30.0 * x))) - 0.2));
} else if (y <= 2.7e+14) {
tmp = t_2;
} else {
tmp = fmax((y * (30.0 - t_3)), 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = sin((30.0d0 * z))
t_1 = abs(t_0) - 0.2d0
t_2 = fmax((z * (30.0d0 - (25.0d0 * (1.0d0 / z)))), (abs((sin((30.0d0 * x)) + (30.0d0 * (z * cos((30.0d0 * x)))))) - 0.2d0))
t_3 = 25.0d0 * (1.0d0 / y)
if (y <= (-1.4d+35)) then
tmp = fmax(((-1.0d0) * (y * (30.0d0 + t_3))), t_1)
else if (y <= (-9.2d-63)) then
tmp = t_2
else if (y <= 9d-101) then
tmp = fmax((x * (30.0d0 - (25.0d0 * (1.0d0 / x)))), (abs((t_0 + (30.0d0 * x))) - 0.2d0))
else if (y <= 2.7d+14) then
tmp = t_2
else
tmp = fmax((y * (30.0d0 - t_3)), t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.sin((30.0 * z));
double t_1 = Math.abs(t_0) - 0.2;
double t_2 = fmax((z * (30.0 - (25.0 * (1.0 / z)))), (Math.abs((Math.sin((30.0 * x)) + (30.0 * (z * Math.cos((30.0 * x)))))) - 0.2));
double t_3 = 25.0 * (1.0 / y);
double tmp;
if (y <= -1.4e+35) {
tmp = fmax((-1.0 * (y * (30.0 + t_3))), t_1);
} else if (y <= -9.2e-63) {
tmp = t_2;
} else if (y <= 9e-101) {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (Math.abs((t_0 + (30.0 * x))) - 0.2));
} else if (y <= 2.7e+14) {
tmp = t_2;
} else {
tmp = fmax((y * (30.0 - t_3)), t_1);
}
return tmp;
}
def code(x, y, z): t_0 = math.sin((30.0 * z)) t_1 = math.fabs(t_0) - 0.2 t_2 = fmax((z * (30.0 - (25.0 * (1.0 / z)))), (math.fabs((math.sin((30.0 * x)) + (30.0 * (z * math.cos((30.0 * x)))))) - 0.2)) t_3 = 25.0 * (1.0 / y) tmp = 0 if y <= -1.4e+35: tmp = fmax((-1.0 * (y * (30.0 + t_3))), t_1) elif y <= -9.2e-63: tmp = t_2 elif y <= 9e-101: tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (math.fabs((t_0 + (30.0 * x))) - 0.2)) elif y <= 2.7e+14: tmp = t_2 else: tmp = fmax((y * (30.0 - t_3)), t_1) return tmp
function code(x, y, z) t_0 = sin(Float64(30.0 * z)) t_1 = Float64(abs(t_0) - 0.2) t_2 = fmax(Float64(z * Float64(30.0 - Float64(25.0 * Float64(1.0 / z)))), Float64(abs(Float64(sin(Float64(30.0 * x)) + Float64(30.0 * Float64(z * cos(Float64(30.0 * x)))))) - 0.2)) t_3 = Float64(25.0 * Float64(1.0 / y)) tmp = 0.0 if (y <= -1.4e+35) tmp = fmax(Float64(-1.0 * Float64(y * Float64(30.0 + t_3))), t_1); elseif (y <= -9.2e-63) tmp = t_2; elseif (y <= 9e-101) tmp = fmax(Float64(x * Float64(30.0 - Float64(25.0 * Float64(1.0 / x)))), Float64(abs(Float64(t_0 + Float64(30.0 * x))) - 0.2)); elseif (y <= 2.7e+14) tmp = t_2; else tmp = fmax(Float64(y * Float64(30.0 - t_3)), t_1); end return tmp end
function tmp_2 = code(x, y, z) t_0 = sin((30.0 * z)); t_1 = abs(t_0) - 0.2; t_2 = max((z * (30.0 - (25.0 * (1.0 / z)))), (abs((sin((30.0 * x)) + (30.0 * (z * cos((30.0 * x)))))) - 0.2)); t_3 = 25.0 * (1.0 / y); tmp = 0.0; if (y <= -1.4e+35) tmp = max((-1.0 * (y * (30.0 + t_3))), t_1); elseif (y <= -9.2e-63) tmp = t_2; elseif (y <= 9e-101) tmp = max((x * (30.0 - (25.0 * (1.0 / x)))), (abs((t_0 + (30.0 * x))) - 0.2)); elseif (y <= 2.7e+14) tmp = t_2; else tmp = max((y * (30.0 - t_3)), t_1); end tmp_2 = 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]}, Block[{t$95$2 = N[Max[N[(z * N[(30.0 - N[(25.0 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] + N[(30.0 * N[(z * N[Cos[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+35], N[Max[N[(-1.0 * N[(y * N[(30.0 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1], $MachinePrecision], If[LessEqual[y, -9.2e-63], t$95$2, If[LessEqual[y, 9e-101], N[Max[N[(x * N[(30.0 - N[(25.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(t$95$0 + N[(30.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 2.7e+14], t$95$2, N[Max[N[(y * N[(30.0 - t$95$3), $MachinePrecision]), $MachinePrecision], t$95$1], $MachinePrecision]]]]]]]]]
\begin{array}{l}
t_0 := \sin \left(30 \cdot z\right)\\
t_1 := \left|t\_0\right| - 0.2\\
t_2 := \mathsf{max}\left(z \cdot \left(30 - 25 \cdot \frac{1}{z}\right), \left|\sin \left(30 \cdot x\right) + 30 \cdot \left(z \cdot \cos \left(30 \cdot x\right)\right)\right| - 0.2\right)\\
t_3 := 25 \cdot \frac{1}{y}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{max}\left(-1 \cdot \left(y \cdot \left(30 + t\_3\right)\right), t\_1\right)\\
\mathbf{elif}\;y \leq -9.2 \cdot 10^{-63}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-101}:\\
\;\;\;\;\mathsf{max}\left(x \cdot \left(30 - 25 \cdot \frac{1}{x}\right), \left|t\_0 + 30 \cdot x\right| - 0.2\right)\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+14}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - t\_3\right), t\_1\right)\\
\end{array}
if y < -1.39999999999999999e35Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6427.8%
Applied rewrites27.8%
if -1.39999999999999999e35 < y < -9.2e-63 or 8.9999999999999997e-101 < y < 2.7e14Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6429.2%
Applied rewrites29.2%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
if -9.2e-63 < y < 8.9999999999999997e-101Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.9%
Applied rewrites28.9%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f6443.3%
Applied rewrites43.3%
if 2.7e14 < y Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.0%
Applied rewrites28.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* 30.0 z)))
(t_1 (- (fabs t_0) 0.2))
(t_2 (* 25.0 (/ 1.0 y))))
(if (<= y -2.5e+35)
(fmax (* -1.0 (* y (+ 30.0 t_2))) t_1)
(if (<= y 2.7e+14)
(fmax
(* x (- 30.0 (* 25.0 (/ 1.0 x))))
(- (fabs (+ t_0 (* 30.0 x))) 0.2))
(fmax (* y (- 30.0 t_2)) 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 t_2 = 25.0 * (1.0 / y);
double tmp;
if (y <= -2.5e+35) {
tmp = fmax((-1.0 * (y * (30.0 + t_2))), t_1);
} else if (y <= 2.7e+14) {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (fabs((t_0 + (30.0 * x))) - 0.2));
} else {
tmp = fmax((y * (30.0 - t_2)), 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) :: t_2
real(8) :: tmp
t_0 = sin((30.0d0 * z))
t_1 = abs(t_0) - 0.2d0
t_2 = 25.0d0 * (1.0d0 / y)
if (y <= (-2.5d+35)) then
tmp = fmax(((-1.0d0) * (y * (30.0d0 + t_2))), t_1)
else if (y <= 2.7d+14) then
tmp = fmax((x * (30.0d0 - (25.0d0 * (1.0d0 / x)))), (abs((t_0 + (30.0d0 * x))) - 0.2d0))
else
tmp = fmax((y * (30.0d0 - t_2)), t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.sin((30.0 * z));
double t_1 = Math.abs(t_0) - 0.2;
double t_2 = 25.0 * (1.0 / y);
double tmp;
if (y <= -2.5e+35) {
tmp = fmax((-1.0 * (y * (30.0 + t_2))), t_1);
} else if (y <= 2.7e+14) {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (Math.abs((t_0 + (30.0 * x))) - 0.2));
} else {
tmp = fmax((y * (30.0 - t_2)), t_1);
}
return tmp;
}
def code(x, y, z): t_0 = math.sin((30.0 * z)) t_1 = math.fabs(t_0) - 0.2 t_2 = 25.0 * (1.0 / y) tmp = 0 if y <= -2.5e+35: tmp = fmax((-1.0 * (y * (30.0 + t_2))), t_1) elif y <= 2.7e+14: tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (math.fabs((t_0 + (30.0 * x))) - 0.2)) else: tmp = fmax((y * (30.0 - t_2)), t_1) return tmp
function code(x, y, z) t_0 = sin(Float64(30.0 * z)) t_1 = Float64(abs(t_0) - 0.2) t_2 = Float64(25.0 * Float64(1.0 / y)) tmp = 0.0 if (y <= -2.5e+35) tmp = fmax(Float64(-1.0 * Float64(y * Float64(30.0 + t_2))), t_1); elseif (y <= 2.7e+14) tmp = fmax(Float64(x * Float64(30.0 - Float64(25.0 * Float64(1.0 / x)))), Float64(abs(Float64(t_0 + Float64(30.0 * x))) - 0.2)); else tmp = fmax(Float64(y * Float64(30.0 - t_2)), t_1); end return tmp end
function tmp_2 = code(x, y, z) t_0 = sin((30.0 * z)); t_1 = abs(t_0) - 0.2; t_2 = 25.0 * (1.0 / y); tmp = 0.0; if (y <= -2.5e+35) tmp = max((-1.0 * (y * (30.0 + t_2))), t_1); elseif (y <= 2.7e+14) tmp = max((x * (30.0 - (25.0 * (1.0 / x)))), (abs((t_0 + (30.0 * x))) - 0.2)); else tmp = max((y * (30.0 - t_2)), t_1); end tmp_2 = 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]}, Block[{t$95$2 = N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.5e+35], N[Max[N[(-1.0 * N[(y * N[(30.0 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1], $MachinePrecision], If[LessEqual[y, 2.7e+14], N[Max[N[(x * N[(30.0 - N[(25.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(t$95$0 + N[(30.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(y * N[(30.0 - t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1], $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \sin \left(30 \cdot z\right)\\
t_1 := \left|t\_0\right| - 0.2\\
t_2 := 25 \cdot \frac{1}{y}\\
\mathbf{if}\;y \leq -2.5 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{max}\left(-1 \cdot \left(y \cdot \left(30 + t\_2\right)\right), t\_1\right)\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+14}:\\
\;\;\;\;\mathsf{max}\left(x \cdot \left(30 - 25 \cdot \frac{1}{x}\right), \left|t\_0 + 30 \cdot x\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - t\_2\right), t\_1\right)\\
\end{array}
if y < -2.50000000000000011e35Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6427.8%
Applied rewrites27.8%
if -2.50000000000000011e35 < y < 2.7e14Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.9%
Applied rewrites28.9%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f6443.3%
Applied rewrites43.3%
if 2.7e14 < y Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.0%
Applied rewrites28.0%
(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+151)
(fmax
(- (* (sqrt (fma z z (fma y y (* x x)))) (sqrt 900.0)) 25.0)
(- (fabs t_0) 0.2))
(fmax
(* x (- 30.0 (* 25.0 (/ 1.0 x))))
(- (fabs (+ t_0 (* 30.0 x))) 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+151) {
tmp = fmax(((sqrt(fma(z, z, fma(y, y, (x * x)))) * sqrt(900.0)) - 25.0), (fabs(t_0) - 0.2));
} else {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (fabs((t_0 + (30.0 * x))) - 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+151) tmp = fmax(Float64(Float64(sqrt(fma(z, z, fma(y, y, Float64(x * x)))) * sqrt(900.0)) - 25.0), Float64(abs(t_0) - 0.2)); else tmp = fmax(Float64(x * Float64(30.0 - Float64(25.0 * Float64(1.0 / x)))), Float64(abs(Float64(t_0 + Float64(30.0 * x))) - 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+151], N[Max[N[(N[(N[Sqrt[N[(z * z + N[(y * y + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[900.0], $MachinePrecision]), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(x * N[(30.0 - N[(25.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(t$95$0 + N[(30.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]
\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^{+151}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\mathsf{fma}\left(z, z, \mathsf{fma}\left(y, y, x \cdot x\right)\right)} \cdot \sqrt{900} - 25, \left|t\_0\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x \cdot \left(30 - 25 \cdot \frac{1}{x}\right), \left|t\_0 + 30 \cdot x\right| - 0.2\right)\\
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 5.0000000000000002e151Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
lift-sqrt.f64N/A
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
lift-*.f64N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
metadata-evalN/A
distribute-rgt-inN/A
+-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
Applied rewrites45.8%
if 5.0000000000000002e151 < (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 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.9%
Applied rewrites28.9%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f6443.3%
Applied rewrites43.3%
(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+151)
(fmax
(- (sqrt (* (fma z z (fma y y (* x x))) 900.0)) 25.0)
(- (fabs t_0) 0.2))
(fmax
(* x (- 30.0 (* 25.0 (/ 1.0 x))))
(- (fabs (+ (sin (* 30.0 z)) (* 30.0 x))) 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+151) {
tmp = fmax((sqrt((fma(z, z, fma(y, y, (x * x))) * 900.0)) - 25.0), (fabs(t_0) - 0.2));
} else {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (fabs((sin((30.0 * z)) + (30.0 * x))) - 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+151) tmp = fmax(Float64(sqrt(Float64(fma(z, z, fma(y, y, Float64(x * x))) * 900.0)) - 25.0), Float64(abs(t_0) - 0.2)); else tmp = fmax(Float64(x * Float64(30.0 - Float64(25.0 * Float64(1.0 / x)))), Float64(abs(Float64(sin(Float64(30.0 * z)) + 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[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+151], N[Max[N[(N[Sqrt[N[(N[(z * z + N[(y * y + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 900.0), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(x * N[(30.0 - N[(25.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] + N[(30.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
\mathbf{if}\;\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + t\_0 \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq 5 \cdot 10^{+151}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\mathsf{fma}\left(z, z, \mathsf{fma}\left(y, y, x \cdot x\right)\right) \cdot 900} - 25, \left|t\_0\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x \cdot \left(30 - 25 \cdot \frac{1}{x}\right), \left|\sin \left(30 \cdot z\right) + 30 \cdot x\right| - 0.2\right)\\
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 5.0000000000000002e151Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Applied rewrites45.4%
if 5.0000000000000002e151 < (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 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.9%
Applied rewrites28.9%
Taylor expanded in x around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f6443.3%
Applied rewrites43.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 z))) 0.2)) (t_1 (* 25.0 (/ 1.0 x))))
(if (<= x -1.52e+46)
(fmax (* -1.0 (* x (+ 30.0 t_1))) t_0)
(if (<= x 1.8e-132)
(fmax (* z (- 30.0 (* 25.0 (/ 1.0 z)))) t_0)
(if (<= x 1.02e-15)
(fmax (* y (- 30.0 (* 25.0 (/ 1.0 y)))) t_0)
(fmax (* x (- 30.0 t_1)) t_0))))))double code(double x, double y, double z) {
double t_0 = fabs(sin((30.0 * z))) - 0.2;
double t_1 = 25.0 * (1.0 / x);
double tmp;
if (x <= -1.52e+46) {
tmp = fmax((-1.0 * (x * (30.0 + t_1))), t_0);
} else if (x <= 1.8e-132) {
tmp = fmax((z * (30.0 - (25.0 * (1.0 / z)))), t_0);
} else if (x <= 1.02e-15) {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), t_0);
} else {
tmp = fmax((x * (30.0 - t_1)), 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) :: t_1
real(8) :: tmp
t_0 = abs(sin((30.0d0 * z))) - 0.2d0
t_1 = 25.0d0 * (1.0d0 / x)
if (x <= (-1.52d+46)) then
tmp = fmax(((-1.0d0) * (x * (30.0d0 + t_1))), t_0)
else if (x <= 1.8d-132) then
tmp = fmax((z * (30.0d0 - (25.0d0 * (1.0d0 / z)))), t_0)
else if (x <= 1.02d-15) then
tmp = fmax((y * (30.0d0 - (25.0d0 * (1.0d0 / y)))), t_0)
else
tmp = fmax((x * (30.0d0 - t_1)), 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 t_1 = 25.0 * (1.0 / x);
double tmp;
if (x <= -1.52e+46) {
tmp = fmax((-1.0 * (x * (30.0 + t_1))), t_0);
} else if (x <= 1.8e-132) {
tmp = fmax((z * (30.0 - (25.0 * (1.0 / z)))), t_0);
} else if (x <= 1.02e-15) {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), t_0);
} else {
tmp = fmax((x * (30.0 - t_1)), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((30.0 * z))) - 0.2 t_1 = 25.0 * (1.0 / x) tmp = 0 if x <= -1.52e+46: tmp = fmax((-1.0 * (x * (30.0 + t_1))), t_0) elif x <= 1.8e-132: tmp = fmax((z * (30.0 - (25.0 * (1.0 / z)))), t_0) elif x <= 1.02e-15: tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), t_0) else: tmp = fmax((x * (30.0 - t_1)), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(30.0 * z))) - 0.2) t_1 = Float64(25.0 * Float64(1.0 / x)) tmp = 0.0 if (x <= -1.52e+46) tmp = fmax(Float64(-1.0 * Float64(x * Float64(30.0 + t_1))), t_0); elseif (x <= 1.8e-132) tmp = fmax(Float64(z * Float64(30.0 - Float64(25.0 * Float64(1.0 / z)))), t_0); elseif (x <= 1.02e-15) tmp = fmax(Float64(y * Float64(30.0 - Float64(25.0 * Float64(1.0 / y)))), t_0); else tmp = fmax(Float64(x * Float64(30.0 - t_1)), t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(sin((30.0 * z))) - 0.2; t_1 = 25.0 * (1.0 / x); tmp = 0.0; if (x <= -1.52e+46) tmp = max((-1.0 * (x * (30.0 + t_1))), t_0); elseif (x <= 1.8e-132) tmp = max((z * (30.0 - (25.0 * (1.0 / z)))), t_0); elseif (x <= 1.02e-15) tmp = max((y * (30.0 - (25.0 * (1.0 / y)))), t_0); else tmp = max((x * (30.0 - t_1)), 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]}, Block[{t$95$1 = N[(25.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.52e+46], N[Max[N[(-1.0 * N[(x * N[(30.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 1.8e-132], N[Max[N[(z * N[(30.0 - N[(25.0 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 1.02e-15], N[Max[N[(y * N[(30.0 - N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(x * N[(30.0 - t$95$1), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot z\right)\right| - 0.2\\
t_1 := 25 \cdot \frac{1}{x}\\
\mathbf{if}\;x \leq -1.52 \cdot 10^{+46}:\\
\;\;\;\;\mathsf{max}\left(-1 \cdot \left(x \cdot \left(30 + t\_1\right)\right), t\_0\right)\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-132}:\\
\;\;\;\;\mathsf{max}\left(z \cdot \left(30 - 25 \cdot \frac{1}{z}\right), t\_0\right)\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - 25 \cdot \frac{1}{y}\right), t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x \cdot \left(30 - t\_1\right), t\_0\right)\\
\end{array}
if x < -1.5200000000000001e46Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6428.1%
Applied rewrites28.1%
if -1.5200000000000001e46 < x < 1.80000000000000004e-132Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6427.9%
Applied rewrites27.9%
if 1.80000000000000004e-132 < x < 1.02e-15Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.0%
Applied rewrites28.0%
if 1.02e-15 < x Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.9%
Applied rewrites28.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 z))) 0.2)))
(if (<= z -6800000.0)
(fmax (- (* -30.0 z) 25.0) t_0)
(if (<= z -3.9e-259)
(fmax (* y (- 30.0 (* 25.0 (/ 1.0 y)))) t_0)
(if (<= z 3.6e+27)
(fmax
(* x (- 30.0 (* 25.0 (/ 1.0 x))))
(- (fabs (* z (+ 30.0 (* -4500.0 (pow z 2.0))))) 0.2))
(fmax (* z (- 30.0 (* 25.0 (/ 1.0 z)))) t_0))))))double code(double x, double y, double z) {
double t_0 = fabs(sin((30.0 * z))) - 0.2;
double tmp;
if (z <= -6800000.0) {
tmp = fmax(((-30.0 * z) - 25.0), t_0);
} else if (z <= -3.9e-259) {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), t_0);
} else if (z <= 3.6e+27) {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (fabs((z * (30.0 + (-4500.0 * pow(z, 2.0))))) - 0.2));
} else {
tmp = fmax((z * (30.0 - (25.0 * (1.0 / z)))), 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 (z <= (-6800000.0d0)) then
tmp = fmax((((-30.0d0) * z) - 25.0d0), t_0)
else if (z <= (-3.9d-259)) then
tmp = fmax((y * (30.0d0 - (25.0d0 * (1.0d0 / y)))), t_0)
else if (z <= 3.6d+27) then
tmp = fmax((x * (30.0d0 - (25.0d0 * (1.0d0 / x)))), (abs((z * (30.0d0 + ((-4500.0d0) * (z ** 2.0d0))))) - 0.2d0))
else
tmp = fmax((z * (30.0d0 - (25.0d0 * (1.0d0 / z)))), 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 (z <= -6800000.0) {
tmp = fmax(((-30.0 * z) - 25.0), t_0);
} else if (z <= -3.9e-259) {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), t_0);
} else if (z <= 3.6e+27) {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (Math.abs((z * (30.0 + (-4500.0 * Math.pow(z, 2.0))))) - 0.2));
} else {
tmp = fmax((z * (30.0 - (25.0 * (1.0 / z)))), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((30.0 * z))) - 0.2 tmp = 0 if z <= -6800000.0: tmp = fmax(((-30.0 * z) - 25.0), t_0) elif z <= -3.9e-259: tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), t_0) elif z <= 3.6e+27: tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (math.fabs((z * (30.0 + (-4500.0 * math.pow(z, 2.0))))) - 0.2)) else: tmp = fmax((z * (30.0 - (25.0 * (1.0 / z)))), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(30.0 * z))) - 0.2) tmp = 0.0 if (z <= -6800000.0) tmp = fmax(Float64(Float64(-30.0 * z) - 25.0), t_0); elseif (z <= -3.9e-259) tmp = fmax(Float64(y * Float64(30.0 - Float64(25.0 * Float64(1.0 / y)))), t_0); elseif (z <= 3.6e+27) tmp = fmax(Float64(x * Float64(30.0 - Float64(25.0 * Float64(1.0 / x)))), Float64(abs(Float64(z * Float64(30.0 + Float64(-4500.0 * (z ^ 2.0))))) - 0.2)); else tmp = fmax(Float64(z * Float64(30.0 - Float64(25.0 * Float64(1.0 / z)))), 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 (z <= -6800000.0) tmp = max(((-30.0 * z) - 25.0), t_0); elseif (z <= -3.9e-259) tmp = max((y * (30.0 - (25.0 * (1.0 / y)))), t_0); elseif (z <= 3.6e+27) tmp = max((x * (30.0 - (25.0 * (1.0 / x)))), (abs((z * (30.0 + (-4500.0 * (z ^ 2.0))))) - 0.2)); else tmp = max((z * (30.0 - (25.0 * (1.0 / z)))), 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[z, -6800000.0], N[Max[N[(N[(-30.0 * z), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[z, -3.9e-259], N[Max[N[(y * N[(30.0 - N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[z, 3.6e+27], N[Max[N[(x * N[(30.0 - N[(25.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(z * N[(30.0 + N[(-4500.0 * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(z * N[(30.0 - N[(25.0 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot z\right)\right| - 0.2\\
\mathbf{if}\;z \leq -6800000:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z - 25, t\_0\right)\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{-259}:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - 25 \cdot \frac{1}{y}\right), t\_0\right)\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{max}\left(x \cdot \left(30 - 25 \cdot \frac{1}{x}\right), \left|z \cdot \left(30 + -4500 \cdot {z}^{2}\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(z \cdot \left(30 - 25 \cdot \frac{1}{z}\right), t\_0\right)\\
\end{array}
if z < -6.8e6Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6427.8%
Applied rewrites27.8%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f6427.8%
Applied rewrites27.8%
if -6.8e6 < z < -3.90000000000000016e-259Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.0%
Applied rewrites28.0%
if -3.90000000000000016e-259 < z < 3.59999999999999983e27Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.9%
Applied rewrites28.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6426.8%
Applied rewrites26.8%
if 3.59999999999999983e27 < z Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6427.9%
Applied rewrites27.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 z))) 0.2)))
(if (<= x -1.05e-278)
(fmax (- (* -30.0 z) 25.0) t_0)
(if (<= x 1.02e-15)
(fmax (* y (- 30.0 (* 25.0 (/ 1.0 y)))) t_0)
(fmax (* x (- 30.0 (* 25.0 (/ 1.0 x)))) t_0)))))double code(double x, double y, double z) {
double t_0 = fabs(sin((30.0 * z))) - 0.2;
double tmp;
if (x <= -1.05e-278) {
tmp = fmax(((-30.0 * z) - 25.0), t_0);
} else if (x <= 1.02e-15) {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), t_0);
} else {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), 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 (x <= (-1.05d-278)) then
tmp = fmax((((-30.0d0) * z) - 25.0d0), t_0)
else if (x <= 1.02d-15) then
tmp = fmax((y * (30.0d0 - (25.0d0 * (1.0d0 / y)))), t_0)
else
tmp = fmax((x * (30.0d0 - (25.0d0 * (1.0d0 / x)))), 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 (x <= -1.05e-278) {
tmp = fmax(((-30.0 * z) - 25.0), t_0);
} else if (x <= 1.02e-15) {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), t_0);
} else {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((30.0 * z))) - 0.2 tmp = 0 if x <= -1.05e-278: tmp = fmax(((-30.0 * z) - 25.0), t_0) elif x <= 1.02e-15: tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), t_0) else: tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(30.0 * z))) - 0.2) tmp = 0.0 if (x <= -1.05e-278) tmp = fmax(Float64(Float64(-30.0 * z) - 25.0), t_0); elseif (x <= 1.02e-15) tmp = fmax(Float64(y * Float64(30.0 - Float64(25.0 * Float64(1.0 / y)))), t_0); else tmp = fmax(Float64(x * Float64(30.0 - Float64(25.0 * Float64(1.0 / x)))), 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 (x <= -1.05e-278) tmp = max(((-30.0 * z) - 25.0), t_0); elseif (x <= 1.02e-15) tmp = max((y * (30.0 - (25.0 * (1.0 / y)))), t_0); else tmp = max((x * (30.0 - (25.0 * (1.0 / x)))), 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[x, -1.05e-278], N[Max[N[(N[(-30.0 * z), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 1.02e-15], N[Max[N[(y * N[(30.0 - N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(x * N[(30.0 - N[(25.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot z\right)\right| - 0.2\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{-278}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z - 25, t\_0\right)\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - 25 \cdot \frac{1}{y}\right), t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x \cdot \left(30 - 25 \cdot \frac{1}{x}\right), t\_0\right)\\
\end{array}
if x < -1.05000000000000007e-278Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6427.8%
Applied rewrites27.8%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f6427.8%
Applied rewrites27.8%
if -1.05000000000000007e-278 < x < 1.02e-15Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.0%
Applied rewrites28.0%
if 1.02e-15 < x Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.9%
Applied rewrites28.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 z))) 0.2)))
(if (<= x 0.0155)
(fmax (- (* -30.0 z) 25.0) t_0)
(fmax (* x (- 30.0 (* 25.0 (/ 1.0 x)))) t_0))))double code(double x, double y, double z) {
double t_0 = fabs(sin((30.0 * z))) - 0.2;
double tmp;
if (x <= 0.0155) {
tmp = fmax(((-30.0 * z) - 25.0), t_0);
} else {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), 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 (x <= 0.0155d0) then
tmp = fmax((((-30.0d0) * z) - 25.0d0), t_0)
else
tmp = fmax((x * (30.0d0 - (25.0d0 * (1.0d0 / x)))), 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 (x <= 0.0155) {
tmp = fmax(((-30.0 * z) - 25.0), t_0);
} else {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((30.0 * z))) - 0.2 tmp = 0 if x <= 0.0155: tmp = fmax(((-30.0 * z) - 25.0), t_0) else: tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(30.0 * z))) - 0.2) tmp = 0.0 if (x <= 0.0155) tmp = fmax(Float64(Float64(-30.0 * z) - 25.0), t_0); else tmp = fmax(Float64(x * Float64(30.0 - Float64(25.0 * Float64(1.0 / x)))), 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 (x <= 0.0155) tmp = max(((-30.0 * z) - 25.0), t_0); else tmp = max((x * (30.0 - (25.0 * (1.0 / x)))), 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[x, 0.0155], N[Max[N[(N[(-30.0 * z), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(x * N[(30.0 - N[(25.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot z\right)\right| - 0.2\\
\mathbf{if}\;x \leq 0.0155:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z - 25, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x \cdot \left(30 - 25 \cdot \frac{1}{x}\right), t\_0\right)\\
\end{array}
if x < 0.0155Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6427.8%
Applied rewrites27.8%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f6427.8%
Applied rewrites27.8%
if 0.0155 < x Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.9%
Applied rewrites28.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- (fabs (sin (* 30.0 z))) 0.2))) (if (<= x 0.0155) (fmax (- (* -30.0 z) 25.0) t_0) (fmax (* x 30.0) t_0))))
double code(double x, double y, double z) {
double t_0 = fabs(sin((30.0 * z))) - 0.2;
double tmp;
if (x <= 0.0155) {
tmp = fmax(((-30.0 * z) - 25.0), t_0);
} else {
tmp = fmax((x * 30.0), t_0);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs(sin((30.0d0 * z))) - 0.2d0
if (x <= 0.0155d0) then
tmp = fmax((((-30.0d0) * z) - 25.0d0), t_0)
else
tmp = fmax((x * 30.0d0), t_0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs(Math.sin((30.0 * z))) - 0.2;
double tmp;
if (x <= 0.0155) {
tmp = fmax(((-30.0 * z) - 25.0), t_0);
} else {
tmp = fmax((x * 30.0), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((30.0 * z))) - 0.2 tmp = 0 if x <= 0.0155: tmp = fmax(((-30.0 * z) - 25.0), t_0) else: tmp = fmax((x * 30.0), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(30.0 * z))) - 0.2) tmp = 0.0 if (x <= 0.0155) tmp = fmax(Float64(Float64(-30.0 * z) - 25.0), t_0); else tmp = fmax(Float64(x * 30.0), 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 (x <= 0.0155) tmp = max(((-30.0 * z) - 25.0), t_0); else tmp = max((x * 30.0), t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[x, 0.0155], N[Max[N[(N[(-30.0 * z), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(x * 30.0), $MachinePrecision], t$95$0], $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot z\right)\right| - 0.2\\
\mathbf{if}\;x \leq 0.0155:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z - 25, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x \cdot 30, t\_0\right)\\
\end{array}
if x < 0.0155Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6427.8%
Applied rewrites27.8%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f6427.8%
Applied rewrites27.8%
if 0.0155 < x Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.9%
Applied rewrites28.9%
Taylor expanded in x around inf
Applied rewrites18.1%
(FPCore (x y z)
:precision binary64
(if (<= z -1.22e+45)
(fmax (* -30.0 z) (- (fabs (sin (* 30.0 z))) 0.2))
(fmax
(* x (- 30.0 (* 25.0 (/ 1.0 x))))
(- (fabs (* z (+ 30.0 (* -4500.0 (pow z 2.0))))) 0.2))))double code(double x, double y, double z) {
double tmp;
if (z <= -1.22e+45) {
tmp = fmax((-30.0 * z), (fabs(sin((30.0 * z))) - 0.2));
} else {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (fabs((z * (30.0 + (-4500.0 * pow(z, 2.0))))) - 0.2));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.22d+45)) then
tmp = fmax(((-30.0d0) * z), (abs(sin((30.0d0 * z))) - 0.2d0))
else
tmp = fmax((x * (30.0d0 - (25.0d0 * (1.0d0 / x)))), (abs((z * (30.0d0 + ((-4500.0d0) * (z ** 2.0d0))))) - 0.2d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.22e+45) {
tmp = fmax((-30.0 * z), (Math.abs(Math.sin((30.0 * z))) - 0.2));
} else {
tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (Math.abs((z * (30.0 + (-4500.0 * Math.pow(z, 2.0))))) - 0.2));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.22e+45: tmp = fmax((-30.0 * z), (math.fabs(math.sin((30.0 * z))) - 0.2)) else: tmp = fmax((x * (30.0 - (25.0 * (1.0 / x)))), (math.fabs((z * (30.0 + (-4500.0 * math.pow(z, 2.0))))) - 0.2)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.22e+45) tmp = fmax(Float64(-30.0 * z), Float64(abs(sin(Float64(30.0 * z))) - 0.2)); else tmp = fmax(Float64(x * Float64(30.0 - Float64(25.0 * Float64(1.0 / x)))), Float64(abs(Float64(z * Float64(30.0 + Float64(-4500.0 * (z ^ 2.0))))) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.22e+45) tmp = max((-30.0 * z), (abs(sin((30.0 * z))) - 0.2)); else tmp = max((x * (30.0 - (25.0 * (1.0 / x)))), (abs((z * (30.0 + (-4500.0 * (z ^ 2.0))))) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.22e+45], N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(x * N[(30.0 - N[(25.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(z * N[(30.0 + N[(-4500.0 * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+45}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|\sin \left(30 \cdot z\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x \cdot \left(30 - 25 \cdot \frac{1}{x}\right), \left|z \cdot \left(30 + -4500 \cdot {z}^{2}\right)\right| - 0.2\right)\\
\end{array}
if z < -1.21999999999999997e45Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6427.8%
Applied rewrites27.8%
Taylor expanded in z around inf
lower-*.f6417.3%
Applied rewrites17.3%
if -1.21999999999999997e45 < z Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.9%
Applied rewrites28.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6426.8%
Applied rewrites26.8%
(FPCore (x y z) :precision binary64 (fmax (* x (- 30.0 (* 25.0 (/ 1.0 x)))) (- (fabs (* z (+ 30.0 (* -4500.0 (pow z 2.0))))) 0.2)))
double code(double x, double y, double z) {
return fmax((x * (30.0 - (25.0 * (1.0 / x)))), (fabs((z * (30.0 + (-4500.0 * pow(z, 2.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((x * (30.0d0 - (25.0d0 * (1.0d0 / x)))), (abs((z * (30.0d0 + ((-4500.0d0) * (z ** 2.0d0))))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((x * (30.0 - (25.0 * (1.0 / x)))), (Math.abs((z * (30.0 + (-4500.0 * Math.pow(z, 2.0))))) - 0.2));
}
def code(x, y, z): return fmax((x * (30.0 - (25.0 * (1.0 / x)))), (math.fabs((z * (30.0 + (-4500.0 * math.pow(z, 2.0))))) - 0.2))
function code(x, y, z) return fmax(Float64(x * Float64(30.0 - Float64(25.0 * Float64(1.0 / x)))), Float64(abs(Float64(z * Float64(30.0 + Float64(-4500.0 * (z ^ 2.0))))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((x * (30.0 - (25.0 * (1.0 / x)))), (abs((z * (30.0 + (-4500.0 * (z ^ 2.0))))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(x * N[(30.0 - N[(25.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(z * N[(30.0 + N[(-4500.0 * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\mathsf{max}\left(x \cdot \left(30 - 25 \cdot \frac{1}{x}\right), \left|z \cdot \left(30 + -4500 \cdot {z}^{2}\right)\right| - 0.2\right)
Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.9%
Applied rewrites28.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6426.8%
Applied rewrites26.8%
(FPCore (x y z) :precision binary64 (fmax -25.0 (- (fabs (sin (* 30.0 z))) 0.2)))
double code(double x, double y, double z) {
return fmax(-25.0, (fabs(sin((30.0 * z))) - 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((-25.0d0), (abs(sin((30.0d0 * z))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax(-25.0, (Math.abs(Math.sin((30.0 * z))) - 0.2));
}
def code(x, y, z): return fmax(-25.0, (math.fabs(math.sin((30.0 * z))) - 0.2))
function code(x, y, z) return fmax(-25.0, Float64(abs(sin(Float64(30.0 * z))) - 0.2)) end
function tmp = code(x, y, z) tmp = max(-25.0, (abs(sin((30.0 * z))) - 0.2)); end
code[x_, y_, z_] := N[Max[-25.0, N[(N[Abs[N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\mathsf{max}\left(-25, \left|\sin \left(30 \cdot z\right)\right| - 0.2\right)
Initial program 46.2%
Taylor expanded in y around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6445.8%
Applied rewrites45.8%
Taylor expanded in x around 0
lower-sin.f64N/A
lower-*.f6445.4%
Applied rewrites45.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6428.9%
Applied rewrites28.9%
Taylor expanded in x around 0
Applied rewrites13.7%
herbie shell --seed 2025183
(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)))