
(FPCore (x y z)
:precision binary64
(fmax
(-
(sqrt
(+ (+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0)) (pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2)))
double code(double x, double y, double z) {
return fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = fmax((sqrt(((((x * 30.0d0) ** 2.0d0) + ((y * 30.0d0) ** 2.0d0)) + ((z * 30.0d0) ** 2.0d0))) - 25.0d0), (abs((((sin((x * 30.0d0)) * cos((y * 30.0d0))) + (sin((y * 30.0d0)) * cos((z * 30.0d0)))) + (sin((z * 30.0d0)) * cos((x * 30.0d0))))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((Math.sqrt(((Math.pow((x * 30.0), 2.0) + Math.pow((y * 30.0), 2.0)) + Math.pow((z * 30.0), 2.0))) - 25.0), (Math.abs((((Math.sin((x * 30.0)) * Math.cos((y * 30.0))) + (Math.sin((y * 30.0)) * Math.cos((z * 30.0)))) + (Math.sin((z * 30.0)) * Math.cos((x * 30.0))))) - 0.2));
}
def code(x, y, z): return fmax((math.sqrt(((math.pow((x * 30.0), 2.0) + math.pow((y * 30.0), 2.0)) + math.pow((z * 30.0), 2.0))) - 25.0), (math.fabs((((math.sin((x * 30.0)) * math.cos((y * 30.0))) + (math.sin((y * 30.0)) * math.cos((z * 30.0)))) + (math.sin((z * 30.0)) * math.cos((x * 30.0))))) - 0.2))
function code(x, y, z) return fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((sqrt(((((x * 30.0) ^ 2.0) + ((y * 30.0) ^ 2.0)) + ((z * 30.0) ^ 2.0))) - 25.0), (abs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right)
\end{array}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(fmax
(-
(sqrt
(+ (+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0)) (pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2)))
double code(double x, double y, double z) {
return fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = fmax((sqrt(((((x * 30.0d0) ** 2.0d0) + ((y * 30.0d0) ** 2.0d0)) + ((z * 30.0d0) ** 2.0d0))) - 25.0d0), (abs((((sin((x * 30.0d0)) * cos((y * 30.0d0))) + (sin((y * 30.0d0)) * cos((z * 30.0d0)))) + (sin((z * 30.0d0)) * cos((x * 30.0d0))))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((Math.sqrt(((Math.pow((x * 30.0), 2.0) + Math.pow((y * 30.0), 2.0)) + Math.pow((z * 30.0), 2.0))) - 25.0), (Math.abs((((Math.sin((x * 30.0)) * Math.cos((y * 30.0))) + (Math.sin((y * 30.0)) * Math.cos((z * 30.0)))) + (Math.sin((z * 30.0)) * Math.cos((x * 30.0))))) - 0.2));
}
def code(x, y, z): return fmax((math.sqrt(((math.pow((x * 30.0), 2.0) + math.pow((y * 30.0), 2.0)) + math.pow((z * 30.0), 2.0))) - 25.0), (math.fabs((((math.sin((x * 30.0)) * math.cos((y * 30.0))) + (math.sin((y * 30.0)) * math.cos((z * 30.0)))) + (math.sin((z * 30.0)) * math.cos((x * 30.0))))) - 0.2))
function code(x, y, z) return fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((sqrt(((((x * 30.0) ^ 2.0) + ((y * 30.0) ^ 2.0)) + ((z * 30.0) ^ 2.0))) - 25.0), (abs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right)
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0)))
(t_1
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0))
(t_2 (cos (* y 30.0)))
(t_3 (sin (* y 30.0)))
(t_4 (cos (* z 30.0)))
(t_5
(fabs
(fma (sin (* 30.0 x)) t_2 (fma t_3 t_4 (* t_0 (cos (* 30.0 x))))))))
(if (<=
(fmax
t_1
(-
(fabs
(+
(+ (* (sin (* x 30.0)) t_2) (* t_3 t_4))
(* t_0 (cos (* x 30.0)))))
0.2))
1.5e+146)
(fmax
t_1
(/ (- (pow t_5 3.0) 0.008) (+ (pow t_5 2.0) (+ 0.04 (* t_5 0.2)))))
(fmax
(- (hypot (* y 30.0) (* z 30.0)) 25.0)
(- (fabs (fma 30.0 x t_0)) 0.2)))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double t_1 = sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0;
double t_2 = cos((y * 30.0));
double t_3 = sin((y * 30.0));
double t_4 = cos((z * 30.0));
double t_5 = fabs(fma(sin((30.0 * x)), t_2, fma(t_3, t_4, (t_0 * cos((30.0 * x))))));
double tmp;
if (fmax(t_1, (fabs((((sin((x * 30.0)) * t_2) + (t_3 * t_4)) + (t_0 * cos((x * 30.0))))) - 0.2)) <= 1.5e+146) {
tmp = fmax(t_1, ((pow(t_5, 3.0) - 0.008) / (pow(t_5, 2.0) + (0.04 + (t_5 * 0.2)))));
} else {
tmp = fmax((hypot((y * 30.0), (z * 30.0)) - 25.0), (fabs(fma(30.0, x, t_0)) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) t_1 = Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0) t_2 = cos(Float64(y * 30.0)) t_3 = sin(Float64(y * 30.0)) t_4 = cos(Float64(z * 30.0)) t_5 = abs(fma(sin(Float64(30.0 * x)), t_2, fma(t_3, t_4, Float64(t_0 * cos(Float64(30.0 * x)))))) tmp = 0.0 if (fmax(t_1, Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * t_2) + Float64(t_3 * t_4)) + Float64(t_0 * cos(Float64(x * 30.0))))) - 0.2)) <= 1.5e+146) tmp = fmax(t_1, Float64(Float64((t_5 ^ 3.0) - 0.008) / Float64((t_5 ^ 2.0) + Float64(0.04 + Float64(t_5 * 0.2))))); else tmp = fmax(Float64(hypot(Float64(y * 30.0), Float64(z * 30.0)) - 25.0), Float64(abs(fma(30.0, x, t_0)) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[Abs[N[(N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] * t$95$2 + N[(t$95$3 * t$95$4 + N[(t$95$0 * N[Cos[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Max[t$95$1, N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision] + N[(t$95$3 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 1.5e+146], N[Max[t$95$1, N[(N[(N[Power[t$95$5, 3.0], $MachinePrecision] - 0.008), $MachinePrecision] / N[(N[Power[t$95$5, 2.0], $MachinePrecision] + N[(0.04 + N[(t$95$5 * 0.2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[Sqrt[N[(y * 30.0), $MachinePrecision] ^ 2 + N[(z * 30.0), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
t_1 := \sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25\\
t_2 := \cos \left(y \cdot 30\right)\\
t_3 := \sin \left(y \cdot 30\right)\\
t_4 := \cos \left(z \cdot 30\right)\\
t_5 := \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), t\_2, \mathsf{fma}\left(t\_3, t\_4, t\_0 \cdot \cos \left(30 \cdot x\right)\right)\right)\right|\\
\mathbf{if}\;\mathsf{max}\left(t\_1, \left|\left(\sin \left(x \cdot 30\right) \cdot t\_2 + t\_3 \cdot t\_4\right) + t\_0 \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq 1.5 \cdot 10^{+146}:\\
\;\;\;\;\mathsf{max}\left(t\_1, \frac{{t\_5}^{3} - 0.008}{{t\_5}^{2} + \left(0.04 + t\_5 \cdot 0.2\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(y \cdot 30, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(30, x, t\_0\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 1.50000000000000001e146Initial program 99.9%
Applied rewrites99.9%
if 1.50000000000000001e146 < (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 11.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.2
Applied rewrites67.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in x around 0
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
pow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
pow2N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-hypot.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6499.2
Applied rewrites99.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 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 (cos (* x 30.0)))))
0.2))))
(if (<= t_1 1.5e+146)
t_1
(fmax
(- (hypot (* y 30.0) (* z 30.0)) 25.0)
(- (fabs (fma 30.0 x t_0)) 0.2)))))
double code(double x, double y, double z) {
double t_0 = sin((z * 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 * cos((x * 30.0))))) - 0.2));
double tmp;
if (t_1 <= 1.5e+146) {
tmp = t_1;
} else {
tmp = fmax((hypot((y * 30.0), (z * 30.0)) - 25.0), (fabs(fma(30.0, x, t_0)) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 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)))) + Float64(t_0 * cos(Float64(x * 30.0))))) - 0.2)) tmp = 0.0 if (t_1 <= 1.5e+146) tmp = t_1; else tmp = fmax(Float64(hypot(Float64(y * 30.0), Float64(z * 30.0)) - 25.0), Float64(abs(fma(30.0, x, t_0)) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $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] + N[(t$95$0 * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 1.5e+146], t$95$1, N[Max[N[(N[Sqrt[N[(y * 30.0), $MachinePrecision] ^ 2 + N[(z * 30.0), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \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 \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right)\\
\mathbf{if}\;t\_1 \leq 1.5 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(y \cdot 30, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(30, x, t\_0\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 1.50000000000000001e146Initial program 99.9%
if 1.50000000000000001e146 < (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 11.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.2
Applied rewrites67.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in x around 0
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
pow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
pow2N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-hypot.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6499.2
Applied rewrites99.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0)))
(t_1
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0))
(t_2 (cos (* y 30.0)))
(t_3 (sin (* y 30.0))))
(if (<=
(fmax
t_1
(-
(fabs
(+
(+ (* (sin (* x 30.0)) t_2) (* t_3 (cos (* z 30.0))))
(* t_0 (cos (* x 30.0)))))
0.2))
1.5e+146)
(fmax t_1 (- (fabs (fma (sin (* 30.0 x)) t_2 t_3)) 0.2))
(fmax
(- (hypot (* y 30.0) (* z 30.0)) 25.0)
(- (fabs (fma 30.0 x t_0)) 0.2)))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double t_1 = sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0;
double t_2 = cos((y * 30.0));
double t_3 = sin((y * 30.0));
double tmp;
if (fmax(t_1, (fabs((((sin((x * 30.0)) * t_2) + (t_3 * cos((z * 30.0)))) + (t_0 * cos((x * 30.0))))) - 0.2)) <= 1.5e+146) {
tmp = fmax(t_1, (fabs(fma(sin((30.0 * x)), t_2, t_3)) - 0.2));
} else {
tmp = fmax((hypot((y * 30.0), (z * 30.0)) - 25.0), (fabs(fma(30.0, x, t_0)) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) t_1 = Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0) t_2 = cos(Float64(y * 30.0)) t_3 = sin(Float64(y * 30.0)) tmp = 0.0 if (fmax(t_1, Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * t_2) + Float64(t_3 * cos(Float64(z * 30.0)))) + Float64(t_0 * cos(Float64(x * 30.0))))) - 0.2)) <= 1.5e+146) tmp = fmax(t_1, Float64(abs(fma(sin(Float64(30.0 * x)), t_2, t_3)) - 0.2)); else tmp = fmax(Float64(hypot(Float64(y * 30.0), Float64(z * 30.0)) - 25.0), Float64(abs(fma(30.0, x, t_0)) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Max[t$95$1, N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision] + N[(t$95$3 * 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], 1.5e+146], N[Max[t$95$1, N[(N[Abs[N[(N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] * t$95$2 + t$95$3), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[Sqrt[N[(y * 30.0), $MachinePrecision] ^ 2 + N[(z * 30.0), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
t_1 := \sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25\\
t_2 := \cos \left(y \cdot 30\right)\\
t_3 := \sin \left(y \cdot 30\right)\\
\mathbf{if}\;\mathsf{max}\left(t\_1, \left|\left(\sin \left(x \cdot 30\right) \cdot t\_2 + t\_3 \cdot \cos \left(z \cdot 30\right)\right) + t\_0 \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq 1.5 \cdot 10^{+146}:\\
\;\;\;\;\mathsf{max}\left(t\_1, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), t\_2, t\_3\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(y \cdot 30, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(30, x, t\_0\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 1.50000000000000001e146Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6499.2
Applied rewrites99.2%
if 1.50000000000000001e146 < (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 11.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.2
Applied rewrites67.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6466.9
Applied rewrites66.9%
Taylor expanded in x around 0
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
pow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
pow2N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-hypot.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6499.2
Applied rewrites99.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* 30.0 x))) 0.2))
(t_1 (fmax (- (hypot (* y 30.0) (* 30.0 x)) 25.0) t_0)))
(if (<= y -8.5e+91)
t_1
(if (<= y 3.1e+15)
(fmax (- (hypot (* z 30.0) (* 30.0 x)) 25.0) t_0)
t_1))))
double code(double x, double y, double z) {
double t_0 = fabs(sin((30.0 * x))) - 0.2;
double t_1 = fmax((hypot((y * 30.0), (30.0 * x)) - 25.0), t_0);
double tmp;
if (y <= -8.5e+91) {
tmp = t_1;
} else if (y <= 3.1e+15) {
tmp = fmax((hypot((z * 30.0), (30.0 * x)) - 25.0), t_0);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = Math.abs(Math.sin((30.0 * x))) - 0.2;
double t_1 = fmax((Math.hypot((y * 30.0), (30.0 * x)) - 25.0), t_0);
double tmp;
if (y <= -8.5e+91) {
tmp = t_1;
} else if (y <= 3.1e+15) {
tmp = fmax((Math.hypot((z * 30.0), (30.0 * x)) - 25.0), t_0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((30.0 * x))) - 0.2 t_1 = fmax((math.hypot((y * 30.0), (30.0 * x)) - 25.0), t_0) tmp = 0 if y <= -8.5e+91: tmp = t_1 elif y <= 3.1e+15: tmp = fmax((math.hypot((z * 30.0), (30.0 * x)) - 25.0), t_0) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(30.0 * x))) - 0.2) t_1 = fmax(Float64(hypot(Float64(y * 30.0), Float64(30.0 * x)) - 25.0), t_0) tmp = 0.0 if (y <= -8.5e+91) tmp = t_1; elseif (y <= 3.1e+15) tmp = fmax(Float64(hypot(Float64(z * 30.0), Float64(30.0 * x)) - 25.0), t_0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(sin((30.0 * x))) - 0.2; t_1 = max((hypot((y * 30.0), (30.0 * x)) - 25.0), t_0); tmp = 0.0; if (y <= -8.5e+91) tmp = t_1; elseif (y <= 3.1e+15) tmp = max((hypot((z * 30.0), (30.0 * x)) - 25.0), t_0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, Block[{t$95$1 = N[Max[N[(N[Sqrt[N[(y * 30.0), $MachinePrecision] ^ 2 + N[(30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision]}, If[LessEqual[y, -8.5e+91], t$95$1, If[LessEqual[y, 3.1e+15], N[Max[N[(N[Sqrt[N[(z * 30.0), $MachinePrecision] ^ 2 + N[(30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot x\right)\right| - 0.2\\
t_1 := \mathsf{max}\left(\mathsf{hypot}\left(y \cdot 30, 30 \cdot x\right) - 25, t\_0\right)\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(z \cdot 30, 30 \cdot x\right) - 25, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.4999999999999995e91 or 3.1e15 < y Initial program 27.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.0
Applied rewrites38.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6437.3
Applied rewrites37.3%
Taylor expanded in z around 0
metadata-evalN/A
unpow2N/A
swap-sqrN/A
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
lift-*.f64N/A
unpow2N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-hypot.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6483.5
Applied rewrites83.5%
Taylor expanded in z around 0
lift-sin.f64N/A
lift-*.f6483.5
Applied rewrites83.5%
if -8.4999999999999995e91 < y < 3.1e15Initial program 58.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1
Applied rewrites95.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6494.3
Applied rewrites94.3%
Taylor expanded in z around 0
lift-sin.f64N/A
lift-*.f6493.8
Applied rewrites93.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(fmax
(- (hypot (* z 30.0) (* 30.0 x)) 25.0)
(- (fabs (* 30.0 x)) 0.2))))
(if (<= z -1.1e+56)
t_0
(if (<= z 3.35e-6)
(fmax
(- (hypot (* y 30.0) (* 30.0 x)) 25.0)
(- (fabs (sin (* 30.0 x))) 0.2))
t_0))))
double code(double x, double y, double z) {
double t_0 = fmax((hypot((z * 30.0), (30.0 * x)) - 25.0), (fabs((30.0 * x)) - 0.2));
double tmp;
if (z <= -1.1e+56) {
tmp = t_0;
} else if (z <= 3.35e-6) {
tmp = fmax((hypot((y * 30.0), (30.0 * x)) - 25.0), (fabs(sin((30.0 * x))) - 0.2));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = fmax((Math.hypot((z * 30.0), (30.0 * x)) - 25.0), (Math.abs((30.0 * x)) - 0.2));
double tmp;
if (z <= -1.1e+56) {
tmp = t_0;
} else if (z <= 3.35e-6) {
tmp = fmax((Math.hypot((y * 30.0), (30.0 * x)) - 25.0), (Math.abs(Math.sin((30.0 * x))) - 0.2));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = fmax((math.hypot((z * 30.0), (30.0 * x)) - 25.0), (math.fabs((30.0 * x)) - 0.2)) tmp = 0 if z <= -1.1e+56: tmp = t_0 elif z <= 3.35e-6: tmp = fmax((math.hypot((y * 30.0), (30.0 * x)) - 25.0), (math.fabs(math.sin((30.0 * x))) - 0.2)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = fmax(Float64(hypot(Float64(z * 30.0), Float64(30.0 * x)) - 25.0), Float64(abs(Float64(30.0 * x)) - 0.2)) tmp = 0.0 if (z <= -1.1e+56) tmp = t_0; elseif (z <= 3.35e-6) tmp = fmax(Float64(hypot(Float64(y * 30.0), Float64(30.0 * x)) - 25.0), Float64(abs(sin(Float64(30.0 * x))) - 0.2)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = max((hypot((z * 30.0), (30.0 * x)) - 25.0), (abs((30.0 * x)) - 0.2)); tmp = 0.0; if (z <= -1.1e+56) tmp = t_0; elseif (z <= 3.35e-6) tmp = max((hypot((y * 30.0), (30.0 * x)) - 25.0), (abs(sin((30.0 * x))) - 0.2)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[(N[Sqrt[N[(z * 30.0), $MachinePrecision] ^ 2 + N[(30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1.1e+56], t$95$0, If[LessEqual[z, 3.35e-6], N[Max[N[(N[Sqrt[N[(y * 30.0), $MachinePrecision] ^ 2 + N[(30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{max}\left(\mathsf{hypot}\left(z \cdot 30, 30 \cdot x\right) - 25, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+56}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.35 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(y \cdot 30, 30 \cdot x\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.10000000000000008e56 or 3.35e-6 < z Initial program 29.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.5
Applied rewrites80.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6480.5
Applied rewrites80.5%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6480.5
Applied rewrites80.5%
Taylor expanded in x around inf
lift-*.f6480.3
Applied rewrites80.3%
if -1.10000000000000008e56 < z < 3.35e-6Initial program 58.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6463.3
Applied rewrites63.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6461.9
Applied rewrites61.9%
Taylor expanded in z around 0
metadata-evalN/A
unpow2N/A
swap-sqrN/A
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
lift-*.f64N/A
unpow2N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-hypot.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6497.3
Applied rewrites97.3%
Taylor expanded in z around 0
lift-sin.f64N/A
lift-*.f6496.8
Applied rewrites96.8%
(FPCore (x y z) :precision binary64 (fmax (- (hypot (* y 30.0) (* z 30.0)) 25.0) (- (fabs (fma 30.0 x (sin (* z 30.0)))) 0.2)))
double code(double x, double y, double z) {
return fmax((hypot((y * 30.0), (z * 30.0)) - 25.0), (fabs(fma(30.0, x, sin((z * 30.0)))) - 0.2));
}
function code(x, y, z) return fmax(Float64(hypot(Float64(y * 30.0), Float64(z * 30.0)) - 25.0), Float64(abs(fma(30.0, x, sin(Float64(z * 30.0)))) - 0.2)) end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(y * 30.0), $MachinePrecision] ^ 2 + N[(z * 30.0), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x + N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(\mathsf{hypot}\left(y \cdot 30, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(30, x, \sin \left(z \cdot 30\right)\right)\right| - 0.2\right)
\end{array}
Initial program 45.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.1
Applied rewrites71.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6470.3
Applied rewrites70.3%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6469.9
Applied rewrites69.9%
Taylor expanded in x around 0
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
pow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
pow2N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-hypot.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6498.5
Applied rewrites98.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (fma 30.0 x (sin (* z 30.0)))) 0.2)))
(if (<= y -8.5e+91)
(fmax (* -30.0 y) t_0)
(if (<= y 3.1e+15)
(fmax (- (hypot (* z 30.0) (* 30.0 x)) 25.0) (- (fabs (* 30.0 x)) 0.2))
(fmax (* y 30.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs(fma(30.0, x, sin((z * 30.0)))) - 0.2;
double tmp;
if (y <= -8.5e+91) {
tmp = fmax((-30.0 * y), t_0);
} else if (y <= 3.1e+15) {
tmp = fmax((hypot((z * 30.0), (30.0 * x)) - 25.0), (fabs((30.0 * x)) - 0.2));
} else {
tmp = fmax((y * 30.0), t_0);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(abs(fma(30.0, x, sin(Float64(z * 30.0)))) - 0.2) tmp = 0.0 if (y <= -8.5e+91) tmp = fmax(Float64(-30.0 * y), t_0); elseif (y <= 3.1e+15) tmp = fmax(Float64(hypot(Float64(z * 30.0), Float64(30.0 * x)) - 25.0), Float64(abs(Float64(30.0 * x)) - 0.2)); else tmp = fmax(Float64(y * 30.0), t_0); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[(30.0 * x + N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[y, -8.5e+91], N[Max[N[(-30.0 * y), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[y, 3.1e+15], N[Max[N[(N[Sqrt[N[(z * 30.0), $MachinePrecision] ^ 2 + N[(30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(y * 30.0), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\mathsf{fma}\left(30, x, \sin \left(z \cdot 30\right)\right)\right| - 0.2\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+91}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, t\_0\right)\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(z \cdot 30, 30 \cdot x\right) - 25, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot 30, t\_0\right)\\
\end{array}
\end{array}
if y < -8.4999999999999995e91Initial program 22.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.0
Applied rewrites33.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6432.3
Applied rewrites32.3%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6432.3
Applied rewrites32.3%
Taylor expanded in y around -inf
lower-*.f6483.9
Applied rewrites83.9%
if -8.4999999999999995e91 < y < 3.1e15Initial program 58.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.1
Applied rewrites95.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6494.3
Applied rewrites94.3%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6493.5
Applied rewrites93.5%
Taylor expanded in x around inf
lift-*.f6493.1
Applied rewrites93.1%
if 3.1e15 < y Initial program 30.7%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.9
Applied rewrites41.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6441.0
Applied rewrites41.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6441.0
Applied rewrites41.0%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f6481.8
Applied rewrites81.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (fma 30.0 x (sin (* z 30.0)))) 0.2)))
(if (<= z -1.05e+32)
(fmax (* -30.0 z) t_0)
(if (<= z 2.3e-6) (fmax (* y 30.0) t_0) (fmax (* z 30.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs(fma(30.0, x, sin((z * 30.0)))) - 0.2;
double tmp;
if (z <= -1.05e+32) {
tmp = fmax((-30.0 * z), t_0);
} else if (z <= 2.3e-6) {
tmp = fmax((y * 30.0), t_0);
} else {
tmp = fmax((z * 30.0), t_0);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(abs(fma(30.0, x, sin(Float64(z * 30.0)))) - 0.2) tmp = 0.0 if (z <= -1.05e+32) tmp = fmax(Float64(-30.0 * z), t_0); elseif (z <= 2.3e-6) tmp = fmax(Float64(y * 30.0), t_0); else tmp = fmax(Float64(z * 30.0), t_0); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[(30.0 * x + N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[z, -1.05e+32], N[Max[N[(-30.0 * z), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[z, 2.3e-6], N[Max[N[(y * 30.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(z * 30.0), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\mathsf{fma}\left(30, x, \sin \left(z \cdot 30\right)\right)\right| - 0.2\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, t\_0\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{max}\left(y \cdot 30, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(z \cdot 30, t\_0\right)\\
\end{array}
\end{array}
if z < -1.05e32Initial program 28.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6481.1
Applied rewrites81.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6481.1
Applied rewrites81.1%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6481.1
Applied rewrites81.1%
Taylor expanded in z around -inf
lower-*.f6480.6
Applied rewrites80.6%
if -1.05e32 < z < 2.3e-6Initial program 58.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6463.2
Applied rewrites63.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6461.8
Applied rewrites61.8%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6461.0
Applied rewrites61.0%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f6457.7
Applied rewrites57.7%
if 2.3e-6 < z Initial program 32.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6478.9
Applied rewrites78.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6478.9
Applied rewrites78.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6478.8
Applied rewrites78.8%
Taylor expanded in z around inf
*-commutativeN/A
lift-*.f6477.3
Applied rewrites77.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (fma 30.0 x (sin (* z 30.0)))) 0.2)))
(if (<= y -8.6e+20)
(fmax (* -30.0 y) t_0)
(if (<= y 66000.0) (fmax (* -30.0 z) t_0) (fmax (* y 30.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs(fma(30.0, x, sin((z * 30.0)))) - 0.2;
double tmp;
if (y <= -8.6e+20) {
tmp = fmax((-30.0 * y), t_0);
} else if (y <= 66000.0) {
tmp = fmax((-30.0 * z), t_0);
} else {
tmp = fmax((y * 30.0), t_0);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(abs(fma(30.0, x, sin(Float64(z * 30.0)))) - 0.2) tmp = 0.0 if (y <= -8.6e+20) tmp = fmax(Float64(-30.0 * y), t_0); elseif (y <= 66000.0) tmp = fmax(Float64(-30.0 * z), t_0); else tmp = fmax(Float64(y * 30.0), t_0); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[(30.0 * x + N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[y, -8.6e+20], N[Max[N[(-30.0 * y), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[y, 66000.0], N[Max[N[(-30.0 * z), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(y * 30.0), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\mathsf{fma}\left(30, x, \sin \left(z \cdot 30\right)\right)\right| - 0.2\\
\mathbf{if}\;y \leq -8.6 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, t\_0\right)\\
\mathbf{elif}\;y \leq 66000:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot 30, t\_0\right)\\
\end{array}
\end{array}
if y < -8.6e20Initial program 31.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6440.9
Applied rewrites40.9%
Taylor expanded in y around -inf
lower-*.f6479.1
Applied rewrites79.1%
if -8.6e20 < y < 66000Initial program 58.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.9
Applied rewrites98.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6498.2
Applied rewrites98.2%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6497.4
Applied rewrites97.4%
Taylor expanded in z around -inf
lower-*.f6457.5
Applied rewrites57.5%
if 66000 < y Initial program 31.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6442.7
Applied rewrites42.7%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6441.8
Applied rewrites41.8%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6441.8
Applied rewrites41.8%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f6481.2
Applied rewrites81.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (fma 30.0 x (sin (* z 30.0)))) 0.2)))
(if (<= y -8.6e+20)
(fmax (* -30.0 y) t_0)
(if (<= y 96000.0)
(fmax (* -30.0 z) t_0)
(fmax (* -30.0 x) (- (fabs (fma y 30.0 (sin (* 30.0 x)))) 0.2))))))
double code(double x, double y, double z) {
double t_0 = fabs(fma(30.0, x, sin((z * 30.0)))) - 0.2;
double tmp;
if (y <= -8.6e+20) {
tmp = fmax((-30.0 * y), t_0);
} else if (y <= 96000.0) {
tmp = fmax((-30.0 * z), t_0);
} else {
tmp = fmax((-30.0 * x), (fabs(fma(y, 30.0, sin((30.0 * x)))) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(abs(fma(30.0, x, sin(Float64(z * 30.0)))) - 0.2) tmp = 0.0 if (y <= -8.6e+20) tmp = fmax(Float64(-30.0 * y), t_0); elseif (y <= 96000.0) tmp = fmax(Float64(-30.0 * z), t_0); else tmp = fmax(Float64(-30.0 * x), Float64(abs(fma(y, 30.0, sin(Float64(30.0 * x)))) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[(30.0 * x + N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[y, -8.6e+20], N[Max[N[(-30.0 * y), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[y, 96000.0], N[Max[N[(-30.0 * z), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(y * 30.0 + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\mathsf{fma}\left(30, x, \sin \left(z \cdot 30\right)\right)\right| - 0.2\\
\mathbf{if}\;y \leq -8.6 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, t\_0\right)\\
\mathbf{elif}\;y \leq 96000:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(y, 30, \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if y < -8.6e20Initial program 31.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6440.9
Applied rewrites40.9%
Taylor expanded in y around -inf
lower-*.f6479.1
Applied rewrites79.1%
if -8.6e20 < y < 96000Initial program 58.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.9
Applied rewrites98.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6498.2
Applied rewrites98.2%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6497.4
Applied rewrites97.4%
Taylor expanded in z around -inf
lower-*.f6457.5
Applied rewrites57.5%
if 96000 < y Initial program 31.9%
Taylor expanded in x around -inf
lower-*.f6414.5
Applied rewrites14.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-cos.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-sin.f6414.5
Applied rewrites14.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-*.f6471.4
Applied rewrites71.4%
(FPCore (x y z) :precision binary64 (if (<= x 2.8e-5) (fmax (* -30.0 x) (- (fabs (fma y 30.0 (sin (* 30.0 x)))) 0.2)) (fmax (* -30.0 y) (- (fabs (fma 30.0 x (sin (* z 30.0)))) 0.2))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.8e-5) {
tmp = fmax((-30.0 * x), (fabs(fma(y, 30.0, sin((30.0 * x)))) - 0.2));
} else {
tmp = fmax((-30.0 * y), (fabs(fma(30.0, x, sin((z * 30.0)))) - 0.2));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.8e-5) tmp = fmax(Float64(-30.0 * x), Float64(abs(fma(y, 30.0, sin(Float64(30.0 * x)))) - 0.2)); else tmp = fmax(Float64(-30.0 * y), Float64(abs(fma(30.0, x, sin(Float64(z * 30.0)))) - 0.2)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.8e-5], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(y * 30.0 + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * y), $MachinePrecision], N[(N[Abs[N[(30.0 * x + N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.8 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(y, 30, \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\mathsf{fma}\left(30, x, \sin \left(z \cdot 30\right)\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if x < 2.79999999999999996e-5Initial program 49.3%
Taylor expanded in x around -inf
lower-*.f6423.4
Applied rewrites23.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-cos.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-sin.f6422.9
Applied rewrites22.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-*.f6454.2
Applied rewrites54.2%
if 2.79999999999999996e-5 < x Initial program 32.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.3
Applied rewrites80.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lower-sin.f64N/A
lift-*.f6480.3
Applied rewrites80.3%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6479.4
Applied rewrites79.4%
Taylor expanded in y around -inf
lower-*.f6469.2
Applied rewrites69.2%
(FPCore (x y z) :precision binary64 (if (<= x 1.18e-8) (fmax (* -30.0 x) (- (fabs (fma y 30.0 (sin (* 30.0 x)))) 0.2)) (fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.18e-8) {
tmp = fmax((-30.0 * x), (fabs(fma(y, 30.0, sin((30.0 * x)))) - 0.2));
} else {
tmp = fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.18e-8) tmp = fmax(Float64(-30.0 * x), Float64(abs(fma(y, 30.0, sin(Float64(30.0 * x)))) - 0.2)); else tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.18e-8], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(y * 30.0 + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.18 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(y, 30, \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\
\end{array}
\end{array}
if x < 1.18e-8Initial program 49.2%
Taylor expanded in x around -inf
lower-*.f6423.5
Applied rewrites23.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-cos.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-sin.f6423.0
Applied rewrites23.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-*.f6454.3
Applied rewrites54.3%
if 1.18e-8 < x Initial program 33.5%
Taylor expanded in x around -inf
lower-*.f644.3
Applied rewrites4.3%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-cos.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-sin.f644.2
Applied rewrites4.2%
Taylor expanded in y around 0
lift-sin.f64N/A
lift-*.f644.2
Applied rewrites4.2%
Taylor expanded in x around 0
lift-*.f6458.4
Applied rewrites58.4%
(FPCore (x y z) :precision binary64 (fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2)))
double code(double x, double y, double z) {
return fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
}
def code(x, y, z): return fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2))
function code(x, y, z) return fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2)) end
function tmp = code(x, y, z) tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)
\end{array}
Initial program 45.2%
Taylor expanded in x around -inf
lower-*.f6418.7
Applied rewrites18.7%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-cos.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-sin.f6418.3
Applied rewrites18.3%
Taylor expanded in y around 0
lift-sin.f64N/A
lift-*.f6417.7
Applied rewrites17.7%
Taylor expanded in x around 0
lift-*.f6431.3
Applied rewrites31.3%
herbie shell --seed 2025093
(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)))