
(FPCore (x y z)
:precision binary64
(fmax
(-
(sqrt
(+ (+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0)) (pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2)))
double code(double x, double y, double z) {
return fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = fmax((sqrt(((((x * 30.0d0) ** 2.0d0) + ((y * 30.0d0) ** 2.0d0)) + ((z * 30.0d0) ** 2.0d0))) - 25.0d0), (abs((((sin((x * 30.0d0)) * cos((y * 30.0d0))) + (sin((y * 30.0d0)) * cos((z * 30.0d0)))) + (sin((z * 30.0d0)) * cos((x * 30.0d0))))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((Math.sqrt(((Math.pow((x * 30.0), 2.0) + Math.pow((y * 30.0), 2.0)) + Math.pow((z * 30.0), 2.0))) - 25.0), (Math.abs((((Math.sin((x * 30.0)) * Math.cos((y * 30.0))) + (Math.sin((y * 30.0)) * Math.cos((z * 30.0)))) + (Math.sin((z * 30.0)) * Math.cos((x * 30.0))))) - 0.2));
}
def code(x, y, z): return fmax((math.sqrt(((math.pow((x * 30.0), 2.0) + math.pow((y * 30.0), 2.0)) + math.pow((z * 30.0), 2.0))) - 25.0), (math.fabs((((math.sin((x * 30.0)) * math.cos((y * 30.0))) + (math.sin((y * 30.0)) * math.cos((z * 30.0)))) + (math.sin((z * 30.0)) * math.cos((x * 30.0))))) - 0.2))
function code(x, y, z) return fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((sqrt(((((x * 30.0) ^ 2.0) + ((y * 30.0) ^ 2.0)) + ((z * 30.0) ^ 2.0))) - 25.0), (abs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right)
\end{array}
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(fmax
(-
(sqrt
(+ (+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0)) (pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2)))
double code(double x, double y, double z) {
return fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = fmax((sqrt(((((x * 30.0d0) ** 2.0d0) + ((y * 30.0d0) ** 2.0d0)) + ((z * 30.0d0) ** 2.0d0))) - 25.0d0), (abs((((sin((x * 30.0d0)) * cos((y * 30.0d0))) + (sin((y * 30.0d0)) * cos((z * 30.0d0)))) + (sin((z * 30.0d0)) * cos((x * 30.0d0))))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((Math.sqrt(((Math.pow((x * 30.0), 2.0) + Math.pow((y * 30.0), 2.0)) + Math.pow((z * 30.0), 2.0))) - 25.0), (Math.abs((((Math.sin((x * 30.0)) * Math.cos((y * 30.0))) + (Math.sin((y * 30.0)) * Math.cos((z * 30.0)))) + (Math.sin((z * 30.0)) * Math.cos((x * 30.0))))) - 0.2));
}
def code(x, y, z): return fmax((math.sqrt(((math.pow((x * 30.0), 2.0) + math.pow((y * 30.0), 2.0)) + math.pow((z * 30.0), 2.0))) - 25.0), (math.fabs((((math.sin((x * 30.0)) * math.cos((y * 30.0))) + (math.sin((y * 30.0)) * math.cos((z * 30.0)))) + (math.sin((z * 30.0)) * math.cos((x * 30.0))))) - 0.2))
function code(x, y, z) return fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((sqrt(((((x * 30.0) ^ 2.0) + ((y * 30.0) ^ 2.0)) + ((z * 30.0) ^ 2.0))) - 25.0), (abs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right)
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* 30.0 y))))
(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 (* 900.0 x) x (fma (* 900.0 y) y (* 900.0 (* z z))))) 25.0)
(- (fabs (+ (sin (* 30.0 z)) (* (cos (* 30.0 z)) t_0))) 0.2))
(fmax
(* y (- 30.0 (* 25.0 (/ 1.0 y))))
(- (fabs (+ t_0 (* z 30.0))) 0.2)))))
double code(double x, double y, double z) {
double t_0 = sin((30.0 * y));
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((900.0 * x), x, fma((900.0 * y), y, (900.0 * (z * z))))) - 25.0), (fabs((sin((30.0 * z)) + (cos((30.0 * z)) * t_0))) - 0.2));
} else {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (fabs((t_0 + (z * 30.0))) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(30.0 * y)) 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(sqrt(fma(Float64(900.0 * x), x, fma(Float64(900.0 * y), y, Float64(900.0 * Float64(z * z))))) - 25.0), Float64(abs(Float64(sin(Float64(30.0 * z)) + Float64(cos(Float64(30.0 * z)) * t_0))) - 0.2)); else tmp = fmax(Float64(y * Float64(30.0 - Float64(25.0 * Float64(1.0 / y)))), Float64(abs(Float64(t_0 + Float64(z * 30.0))) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(30.0 * y), $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[Sqrt[N[(N[(900.0 * x), $MachinePrecision] * x + N[(N[(900.0 * y), $MachinePrecision] * y + N[(900.0 * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(y * N[(30.0 - N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(t$95$0 + N[(z * 30.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(30 \cdot y\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(900 \cdot x, x, \mathsf{fma}\left(900 \cdot y, y, 900 \cdot \left(z \cdot z\right)\right)\right)} - 25, \left|\sin \left(30 \cdot z\right) + \cos \left(30 \cdot z\right) \cdot t\_0\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - 25 \cdot \frac{1}{y}\right), \left|t\_0 + z \cdot 30\right| - 0.2\right)\\
\end{array}
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 5.0000000000000002e151Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
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
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
Applied rewrites46.5%
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.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
Taylor expanded in y around 0
Applied rewrites56.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* 30.0 y))))
(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 (* y y) 900.0 (* 900.0 (fma z z (* x x))))) 25.0)
(- (fabs (+ (sin (* 30.0 z)) (* (cos (* 30.0 z)) t_0))) 0.2))
(fmax
(* y (- 30.0 (* 25.0 (/ 1.0 y))))
(- (fabs (+ t_0 (* z 30.0))) 0.2)))))
double code(double x, double y, double z) {
double t_0 = sin((30.0 * y));
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((y * y), 900.0, (900.0 * fma(z, z, (x * x))))) - 25.0), (fabs((sin((30.0 * z)) + (cos((30.0 * z)) * t_0))) - 0.2));
} else {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (fabs((t_0 + (z * 30.0))) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(30.0 * y)) 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(sqrt(fma(Float64(y * y), 900.0, Float64(900.0 * fma(z, z, Float64(x * x))))) - 25.0), Float64(abs(Float64(sin(Float64(30.0 * z)) + Float64(cos(Float64(30.0 * z)) * t_0))) - 0.2)); else tmp = fmax(Float64(y * Float64(30.0 - Float64(25.0 * Float64(1.0 / y)))), Float64(abs(Float64(t_0 + Float64(z * 30.0))) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(30.0 * y), $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[Sqrt[N[(N[(y * y), $MachinePrecision] * 900.0 + N[(900.0 * N[(z * z + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(y * N[(30.0 - N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(t$95$0 + N[(z * 30.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(30 \cdot y\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(y \cdot y, 900, 900 \cdot \mathsf{fma}\left(z, z, x \cdot x\right)\right)} - 25, \left|\sin \left(30 \cdot z\right) + \cos \left(30 \cdot z\right) \cdot t\_0\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - 25 \cdot \frac{1}{y}\right), \left|t\_0 + z \cdot 30\right| - 0.2\right)\\
\end{array}
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 5.0000000000000002e151Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
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
+-commutativeN/A
associate-+l+N/A
Applied rewrites46.5%
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.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
Taylor expanded in y around 0
Applied rewrites56.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0))) (t_1 (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_1 (cos (* z 30.0))))
(* t_0 (cos (* x 30.0)))))
0.2))
5e+151)
(fmax
(- (sqrt (* 900.0 (fma z z (fma y y (* x x))))) 25.0)
(- (fabs (fma (cos (* -30.0 z)) t_1 t_0)) 0.2))
(fmax
(* y (- 30.0 (* 25.0 (/ 1.0 y))))
(- (fabs (+ (sin (* 30.0 y)) (* z 30.0))) 0.2)))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double t_1 = 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_1 * cos((z * 30.0)))) + (t_0 * cos((x * 30.0))))) - 0.2)) <= 5e+151) {
tmp = fmax((sqrt((900.0 * fma(z, z, fma(y, y, (x * x))))) - 25.0), (fabs(fma(cos((-30.0 * z)), t_1, t_0)) - 0.2));
} else {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (fabs((sin((30.0 * y)) + (z * 30.0))) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) t_1 = 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_1 * cos(Float64(z * 30.0)))) + Float64(t_0 * cos(Float64(x * 30.0))))) - 0.2)) <= 5e+151) 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 * z)), t_1, t_0)) - 0.2)); else tmp = fmax(Float64(y * Float64(30.0 - Float64(25.0 * Float64(1.0 / y)))), Float64(abs(Float64(sin(Float64(30.0 * y)) + Float64(z * 30.0))) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(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$1 * 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[(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 * z), $MachinePrecision]], $MachinePrecision] * t$95$1 + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(y * N[(30.0 - N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * y), $MachinePrecision]], $MachinePrecision] + N[(z * 30.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
t_1 := \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\_1 \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{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 z\right), t\_1, t\_0\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - 25 \cdot \frac{1}{y}\right), \left|\sin \left(30 \cdot y\right) + z \cdot 30\right| - 0.2\right)\\
\end{array}
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 5.0000000000000002e151Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
Applied rewrites46.5%
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.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
Taylor expanded in y around 0
Applied rewrites56.3%
(FPCore (x y z)
:precision binary64
(if (<=
(fmax
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2))
5e+151)
(fmax
(- (sqrt (fma (* 900.0 x) x (fma (* 900.0 y) y (* 900.0 (* z z))))) 25.0)
(- (fabs (sin (* 30.0 z))) 0.2))
(fmax
(* y (- 30.0 (* 25.0 (/ 1.0 y))))
(- (fabs (+ (sin (* 30.0 y)) (* z 30.0))) 0.2))))
double code(double x, double y, double z) {
double tmp;
if (fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)) <= 5e+151) {
tmp = fmax((sqrt(fma((900.0 * x), x, fma((900.0 * y), y, (900.0 * (z * z))))) - 25.0), (fabs(sin((30.0 * z))) - 0.2));
} else {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (fabs((sin((30.0 * y)) + (z * 30.0))) - 0.2));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) <= 5e+151) tmp = fmax(Float64(sqrt(fma(Float64(900.0 * x), x, fma(Float64(900.0 * y), y, Float64(900.0 * Float64(z * z))))) - 25.0), Float64(abs(sin(Float64(30.0 * z))) - 0.2)); else tmp = fmax(Float64(y * Float64(30.0 - Float64(25.0 * Float64(1.0 / y)))), Float64(abs(Float64(sin(Float64(30.0 * y)) + Float64(z * 30.0))) - 0.2)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 5e+151], N[Max[N[(N[Sqrt[N[(N[(900.0 * x), $MachinePrecision] * x + N[(N[(900.0 * y), $MachinePrecision] * y + N[(900.0 * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(y * N[(30.0 - N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * y), $MachinePrecision]], $MachinePrecision] + N[(z * 30.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq 5 \cdot 10^{+151}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\mathsf{fma}\left(900 \cdot x, x, \mathsf{fma}\left(900 \cdot y, y, 900 \cdot \left(z \cdot z\right)\right)\right)} - 25, \left|\sin \left(30 \cdot z\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - 25 \cdot \frac{1}{y}\right), \left|\sin \left(30 \cdot y\right) + z \cdot 30\right| - 0.2\right)\\
\end{array}
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 5.0000000000000002e151Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
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
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
Applied rewrites46.5%
Taylor expanded in y around 0
lower-sin.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
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.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
Taylor expanded in y around 0
Applied rewrites56.3%
(FPCore (x y z)
:precision binary64
(if (<=
(fmax
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2))
5e+151)
(fmax
(- (sqrt (fma (* x 900.0) x (* 900.0 (fma y y (* z z))))) 25.0)
(- (fabs (sin (* 30.0 z))) 0.2))
(fmax
(* y (- 30.0 (* 25.0 (/ 1.0 y))))
(- (fabs (+ (sin (* 30.0 y)) (* z 30.0))) 0.2))))
double code(double x, double y, double z) {
double tmp;
if (fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)) <= 5e+151) {
tmp = fmax((sqrt(fma((x * 900.0), x, (900.0 * fma(y, y, (z * z))))) - 25.0), (fabs(sin((30.0 * z))) - 0.2));
} else {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (fabs((sin((30.0 * y)) + (z * 30.0))) - 0.2));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) <= 5e+151) tmp = fmax(Float64(sqrt(fma(Float64(x * 900.0), x, Float64(900.0 * fma(y, y, Float64(z * z))))) - 25.0), Float64(abs(sin(Float64(30.0 * z))) - 0.2)); else tmp = fmax(Float64(y * Float64(30.0 - Float64(25.0 * Float64(1.0 / y)))), Float64(abs(Float64(sin(Float64(30.0 * y)) + Float64(z * 30.0))) - 0.2)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 5e+151], N[Max[N[(N[Sqrt[N[(N[(x * 900.0), $MachinePrecision] * x + N[(900.0 * N[(y * y + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(y * N[(30.0 - N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * y), $MachinePrecision]], $MachinePrecision] + N[(z * 30.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq 5 \cdot 10^{+151}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\mathsf{fma}\left(x \cdot 900, x, 900 \cdot \mathsf{fma}\left(y, y, z \cdot z\right)\right)} - 25, \left|\sin \left(30 \cdot z\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - 25 \cdot \frac{1}{y}\right), \left|\sin \left(30 \cdot y\right) + z \cdot 30\right| - 0.2\right)\\
\end{array}
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 5.0000000000000002e151Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
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
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
Applied rewrites46.5%
Taylor expanded in y around 0
lower-sin.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6446.2
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
unpow2N/A
lift-pow.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6446.2
Applied rewrites46.2%
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.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
Taylor expanded in y around 0
Applied rewrites56.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 z))) 0.2)))
(if (<= x -1.44e+76)
(fmax (* -30.0 x) t_0)
(if (<= x 28500.0)
(fmax
(* y (- 30.0 (* 25.0 (/ 1.0 y))))
(- (fabs (+ (sin (* 30.0 y)) (* z 30.0))) 0.2))
(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.44e+76) {
tmp = fmax((-30.0 * x), t_0);
} else if (x <= 28500.0) {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (fabs((sin((30.0 * y)) + (z * 30.0))) - 0.2));
} 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.44d+76)) then
tmp = fmax(((-30.0d0) * x), t_0)
else if (x <= 28500.0d0) then
tmp = fmax((y * (30.0d0 - (25.0d0 * (1.0d0 / y)))), (abs((sin((30.0d0 * y)) + (z * 30.0d0))) - 0.2d0))
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.44e+76) {
tmp = fmax((-30.0 * x), t_0);
} else if (x <= 28500.0) {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (Math.abs((Math.sin((30.0 * y)) + (z * 30.0))) - 0.2));
} 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.44e+76: tmp = fmax((-30.0 * x), t_0) elif x <= 28500.0: tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (math.fabs((math.sin((30.0 * y)) + (z * 30.0))) - 0.2)) 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.44e+76) tmp = fmax(Float64(-30.0 * x), t_0); elseif (x <= 28500.0) tmp = fmax(Float64(y * Float64(30.0 - Float64(25.0 * Float64(1.0 / y)))), Float64(abs(Float64(sin(Float64(30.0 * y)) + Float64(z * 30.0))) - 0.2)); 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.44e+76) tmp = max((-30.0 * x), t_0); elseif (x <= 28500.0) tmp = max((y * (30.0 - (25.0 * (1.0 / y)))), (abs((sin((30.0 * y)) + (z * 30.0))) - 0.2)); 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.44e+76], N[Max[N[(-30.0 * x), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 28500.0], N[Max[N[(y * N[(30.0 - N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * y), $MachinePrecision]], $MachinePrecision] + N[(z * 30.0), $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], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot z\right)\right| - 0.2\\
\mathbf{if}\;x \leq -1.44 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, t\_0\right)\\
\mathbf{elif}\;x \leq 28500:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - 25 \cdot \frac{1}{y}\right), \left|\sin \left(30 \cdot y\right) + z \cdot 30\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x \cdot \left(30 - 25 \cdot \frac{1}{x}\right), t\_0\right)\\
\end{array}
\end{array}
if x < -1.44e76Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
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
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
Applied rewrites46.5%
Taylor expanded in y around 0
lower-sin.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around -inf
lower-*.f6417.2
Applied rewrites17.2%
if -1.44e76 < x < 28500Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
Taylor expanded in y around 0
Applied rewrites56.3%
if 28500 < x Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
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
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
Applied rewrites46.5%
Taylor expanded in y around 0
lower-sin.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 z))) 0.2)))
(if (<= x -5.7e+75)
(fmax (* -30.0 x) t_0)
(if (<= x 33000000000.0)
(fmax
(* y (- 30.0 (* 25.0 (/ 1.0 y))))
(-
(fabs (+ (* 30.0 y) (* z (+ 30.0 (* -450.0 (* z (* 30.0 y)))))))
0.2))
(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 <= -5.7e+75) {
tmp = fmax((-30.0 * x), t_0);
} else if (x <= 33000000000.0) {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (fabs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2));
} 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 <= (-5.7d+75)) then
tmp = fmax(((-30.0d0) * x), t_0)
else if (x <= 33000000000.0d0) then
tmp = fmax((y * (30.0d0 - (25.0d0 * (1.0d0 / y)))), (abs(((30.0d0 * y) + (z * (30.0d0 + ((-450.0d0) * (z * (30.0d0 * y))))))) - 0.2d0))
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 <= -5.7e+75) {
tmp = fmax((-30.0 * x), t_0);
} else if (x <= 33000000000.0) {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (Math.abs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2));
} 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 <= -5.7e+75: tmp = fmax((-30.0 * x), t_0) elif x <= 33000000000.0: tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (math.fabs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2)) 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 <= -5.7e+75) tmp = fmax(Float64(-30.0 * x), t_0); elseif (x <= 33000000000.0) tmp = fmax(Float64(y * Float64(30.0 - Float64(25.0 * Float64(1.0 / y)))), Float64(abs(Float64(Float64(30.0 * y) + Float64(z * Float64(30.0 + Float64(-450.0 * Float64(z * Float64(30.0 * y))))))) - 0.2)); 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 <= -5.7e+75) tmp = max((-30.0 * x), t_0); elseif (x <= 33000000000.0) tmp = max((y * (30.0 - (25.0 * (1.0 / y)))), (abs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2)); 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, -5.7e+75], N[Max[N[(-30.0 * x), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 33000000000.0], N[Max[N[(y * N[(30.0 - N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(N[(30.0 * y), $MachinePrecision] + N[(z * N[(30.0 + N[(-450.0 * N[(z * N[(30.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot z\right)\right| - 0.2\\
\mathbf{if}\;x \leq -5.7 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, t\_0\right)\\
\mathbf{elif}\;x \leq 33000000000:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - 25 \cdot \frac{1}{y}\right), \left|30 \cdot y + z \cdot \left(30 + -450 \cdot \left(z \cdot \left(30 \cdot y\right)\right)\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x \cdot \left(30 - 25 \cdot \frac{1}{x}\right), t\_0\right)\\
\end{array}
\end{array}
if x < -5.7000000000000004e75Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
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
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
Applied rewrites46.5%
Taylor expanded in y around 0
lower-sin.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around -inf
lower-*.f6417.2
Applied rewrites17.2%
if -5.7000000000000004e75 < x < 3.3e10Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
Taylor expanded in y around 0
lower-*.f6446.3
Applied rewrites46.3%
Taylor expanded in y around 0
lower-*.f6441.5
Applied rewrites41.5%
if 3.3e10 < x Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
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
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
Applied rewrites46.5%
Taylor expanded in y around 0
lower-sin.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 z))) 0.2)))
(if (<= x -5.7e+75)
(fmax (* -30.0 x) t_0)
(if (<= x 4.4e+21)
(fmax
(* y (- 30.0 (* 25.0 (/ 1.0 y))))
(-
(fabs (+ (* 30.0 y) (* z (+ 30.0 (* -450.0 (* z (* 30.0 y)))))))
0.2))
(fmax (* 30.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 <= -5.7e+75) {
tmp = fmax((-30.0 * x), t_0);
} else if (x <= 4.4e+21) {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (fabs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2));
} else {
tmp = fmax((30.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 <= (-5.7d+75)) then
tmp = fmax(((-30.0d0) * x), t_0)
else if (x <= 4.4d+21) then
tmp = fmax((y * (30.0d0 - (25.0d0 * (1.0d0 / y)))), (abs(((30.0d0 * y) + (z * (30.0d0 + ((-450.0d0) * (z * (30.0d0 * y))))))) - 0.2d0))
else
tmp = fmax((30.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 <= -5.7e+75) {
tmp = fmax((-30.0 * x), t_0);
} else if (x <= 4.4e+21) {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (Math.abs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2));
} else {
tmp = fmax((30.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 <= -5.7e+75: tmp = fmax((-30.0 * x), t_0) elif x <= 4.4e+21: tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (math.fabs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2)) else: tmp = fmax((30.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 <= -5.7e+75) tmp = fmax(Float64(-30.0 * x), t_0); elseif (x <= 4.4e+21) tmp = fmax(Float64(y * Float64(30.0 - Float64(25.0 * Float64(1.0 / y)))), Float64(abs(Float64(Float64(30.0 * y) + Float64(z * Float64(30.0 + Float64(-450.0 * Float64(z * Float64(30.0 * y))))))) - 0.2)); else tmp = fmax(Float64(30.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 <= -5.7e+75) tmp = max((-30.0 * x), t_0); elseif (x <= 4.4e+21) tmp = max((y * (30.0 - (25.0 * (1.0 / y)))), (abs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2)); else tmp = max((30.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, -5.7e+75], N[Max[N[(-30.0 * x), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 4.4e+21], N[Max[N[(y * N[(30.0 - N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(N[(30.0 * y), $MachinePrecision] + N[(z * N[(30.0 + N[(-450.0 * N[(z * N[(30.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(30.0 * x), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot z\right)\right| - 0.2\\
\mathbf{if}\;x \leq -5.7 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, t\_0\right)\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+21}:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - 25 \cdot \frac{1}{y}\right), \left|30 \cdot y + z \cdot \left(30 + -450 \cdot \left(z \cdot \left(30 \cdot y\right)\right)\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot x, t\_0\right)\\
\end{array}
\end{array}
if x < -5.7000000000000004e75Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
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
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
Applied rewrites46.5%
Taylor expanded in y around 0
lower-sin.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around -inf
lower-*.f6417.2
Applied rewrites17.2%
if -5.7000000000000004e75 < x < 4.4e21Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
Taylor expanded in y around 0
lower-*.f6446.3
Applied rewrites46.3%
Taylor expanded in y around 0
lower-*.f6441.5
Applied rewrites41.5%
if 4.4e21 < x Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
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
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
Applied rewrites46.5%
Taylor expanded in y around 0
lower-sin.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around inf
lower-*.f6418.3
Applied rewrites18.3%
(FPCore (x y z)
:precision binary64
(if (<= x -5.7e+75)
(fmax (* -30.0 x) (- (fabs (sin (* 30.0 z))) 0.2))
(fmax
(* y (- 30.0 (* 25.0 (/ 1.0 y))))
(- (fabs (+ (* 30.0 y) (* z (+ 30.0 (* -450.0 (* z (* 30.0 y))))))) 0.2))))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.7e+75) {
tmp = fmax((-30.0 * x), (fabs(sin((30.0 * z))) - 0.2));
} else {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (fabs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-5.7d+75)) then
tmp = fmax(((-30.0d0) * x), (abs(sin((30.0d0 * z))) - 0.2d0))
else
tmp = fmax((y * (30.0d0 - (25.0d0 * (1.0d0 / y)))), (abs(((30.0d0 * y) + (z * (30.0d0 + ((-450.0d0) * (z * (30.0d0 * y))))))) - 0.2d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5.7e+75) {
tmp = fmax((-30.0 * x), (Math.abs(Math.sin((30.0 * z))) - 0.2));
} else {
tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (Math.abs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.7e+75: tmp = fmax((-30.0 * x), (math.fabs(math.sin((30.0 * z))) - 0.2)) else: tmp = fmax((y * (30.0 - (25.0 * (1.0 / y)))), (math.fabs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.7e+75) tmp = fmax(Float64(-30.0 * x), Float64(abs(sin(Float64(30.0 * z))) - 0.2)); else tmp = fmax(Float64(y * Float64(30.0 - Float64(25.0 * Float64(1.0 / y)))), Float64(abs(Float64(Float64(30.0 * y) + Float64(z * Float64(30.0 + Float64(-450.0 * Float64(z * Float64(30.0 * y))))))) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5.7e+75) tmp = max((-30.0 * x), (abs(sin((30.0 * z))) - 0.2)); else tmp = max((y * (30.0 - (25.0 * (1.0 / y)))), (abs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.7e+75], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(y * N[(30.0 - N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(N[(30.0 * y), $MachinePrecision] + N[(z * N[(30.0 + N[(-450.0 * N[(z * N[(30.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.7 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot z\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot \left(30 - 25 \cdot \frac{1}{y}\right), \left|30 \cdot y + z \cdot \left(30 + -450 \cdot \left(z \cdot \left(30 \cdot y\right)\right)\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if x < -5.7000000000000004e75Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
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
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
lift-*.f64N/A
swap-sqrN/A
Applied rewrites46.5%
Taylor expanded in y around 0
lower-sin.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around -inf
lower-*.f6417.2
Applied rewrites17.2%
if -5.7000000000000004e75 < x Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
Taylor expanded in y around 0
lower-*.f6446.3
Applied rewrites46.3%
Taylor expanded in y around 0
lower-*.f6441.5
Applied rewrites41.5%
(FPCore (x y z) :precision binary64 (fmax (* y (- 30.0 (* 25.0 (/ 1.0 y)))) (- (fabs (+ (* 30.0 y) (* z (+ 30.0 (* -450.0 (* z (* 30.0 y))))))) 0.2)))
double code(double x, double y, double z) {
return fmax((y * (30.0 - (25.0 * (1.0 / y)))), (fabs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 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((y * (30.0d0 - (25.0d0 * (1.0d0 / y)))), (abs(((30.0d0 * y) + (z * (30.0d0 + ((-450.0d0) * (z * (30.0d0 * y))))))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((y * (30.0 - (25.0 * (1.0 / y)))), (Math.abs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2));
}
def code(x, y, z): return fmax((y * (30.0 - (25.0 * (1.0 / y)))), (math.fabs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2))
function code(x, y, z) return fmax(Float64(y * Float64(30.0 - Float64(25.0 * Float64(1.0 / y)))), Float64(abs(Float64(Float64(30.0 * y) + Float64(z * Float64(30.0 + Float64(-450.0 * Float64(z * Float64(30.0 * y))))))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((y * (30.0 - (25.0 * (1.0 / y)))), (abs(((30.0 * y) + (z * (30.0 + (-450.0 * (z * (30.0 * y))))))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(y * N[(30.0 - N[(25.0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(N[(30.0 * y), $MachinePrecision] + N[(z * N[(30.0 + N[(-450.0 * N[(z * N[(30.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(y \cdot \left(30 - 25 \cdot \frac{1}{y}\right), \left|30 \cdot y + z \cdot \left(30 + -450 \cdot \left(z \cdot \left(30 \cdot y\right)\right)\right)\right| - 0.2\right)
\end{array}
Initial program 46.9%
Taylor expanded in x 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-*.f6446.6
Applied rewrites46.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
Taylor expanded in z around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
Taylor expanded in y around 0
lower-*.f6446.3
Applied rewrites46.3%
Taylor expanded in y around 0
lower-*.f6441.5
Applied rewrites41.5%
herbie shell --seed 2025154
(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)))