
(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 (* 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 (sin (* y 30.0)))
(t_3 (cos (* z 30.0))))
(if (<=
(fmax
t_1
(-
(fabs
(+
(+ (* (sin (* x 30.0)) (cos (* y 30.0))) (* t_2 t_3))
(* t_0 (cos (* x 30.0)))))
0.2))
4e+145)
(fmax t_1 (- (fabs (fma t_2 t_3 t_0)) 0.2))
(fmax
(- (hypot (* z 30.0) (* 30.0 x)) 25.0)
(- (fabs (fma (* t_3 y) 30.0 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 = sin((y * 30.0));
double t_3 = cos((z * 30.0));
double tmp;
if (fmax(t_1, (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (t_2 * t_3)) + (t_0 * cos((x * 30.0))))) - 0.2)) <= 4e+145) {
tmp = fmax(t_1, (fabs(fma(t_2, t_3, t_0)) - 0.2));
} else {
tmp = fmax((hypot((z * 30.0), (30.0 * x)) - 25.0), (fabs(fma((t_3 * y), 30.0, 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 = sin(Float64(y * 30.0)) t_3 = cos(Float64(z * 30.0)) tmp = 0.0 if (fmax(t_1, Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(t_2 * t_3)) + Float64(t_0 * cos(Float64(x * 30.0))))) - 0.2)) <= 4e+145) tmp = fmax(t_1, Float64(abs(fma(t_2, t_3, t_0)) - 0.2)); else tmp = fmax(Float64(hypot(Float64(z * 30.0), Float64(30.0 * x)) - 25.0), Float64(abs(fma(Float64(t_3 * y), 30.0, 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[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(z * 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] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 4e+145], N[Max[t$95$1, N[(N[Abs[N[(t$95$2 * t$95$3 + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 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[(N[(t$95$3 * y), $MachinePrecision] * 30.0 + 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 := \sin \left(y \cdot 30\right)\\
t_3 := \cos \left(z \cdot 30\right)\\
\mathbf{if}\;\mathsf{max}\left(t\_1, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + t\_2 \cdot t\_3\right) + t\_0 \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq 4 \cdot 10^{+145}:\\
\;\;\;\;\mathsf{max}\left(t\_1, \left|\mathsf{fma}\left(t\_2, t\_3, t\_0\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(z \cdot 30, 30 \cdot x\right) - 25, \left|\mathsf{fma}\left(t\_3 \cdot y, 30, 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))) < 4e145Initial program 46.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
if 4e145 < (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.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in y around 0
lower-sqrt.f64N/A
distribute-lft-outN/A
pow2N/A
pow2N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
pow2N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lower-*.f6436.8
Applied rewrites36.8%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
pow2N/A
pow2N/A
+-commutativeN/A
distribute-lft-outN/A
+-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
pow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.4
Applied rewrites71.4%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6490.6
Applied rewrites90.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0)))
(t_1 (fma 900.0 (fma x x (* y y)) (* (* z z) 900.0)))
(t_2 (sin (* y 30.0)))
(t_3 (cos (* z 30.0))))
(if (<=
(fmax
(-
(sqrt
(+
(+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
(pow (* z 30.0) 2.0)))
25.0)
(-
(fabs
(+
(+ (* (sin (* x 30.0)) (cos (* y 30.0))) (* t_2 t_3))
(* t_0 (cos (* x 30.0)))))
0.2))
4e+145)
(fmax
(/ (- (pow t_1 1.0) 625.0) (+ (sqrt t_1) 25.0))
(- (fabs (fma t_2 t_3 t_0)) 0.2))
(fmax
(- (hypot (* z 30.0) (* 30.0 x)) 25.0)
(- (fabs (fma (* t_3 y) 30.0 t_0)) 0.2)))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double t_1 = fma(900.0, fma(x, x, (y * y)), ((z * z) * 900.0));
double t_2 = sin((y * 30.0));
double t_3 = cos((z * 30.0));
double tmp;
if (fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (t_2 * t_3)) + (t_0 * cos((x * 30.0))))) - 0.2)) <= 4e+145) {
tmp = fmax(((pow(t_1, 1.0) - 625.0) / (sqrt(t_1) + 25.0)), (fabs(fma(t_2, t_3, t_0)) - 0.2));
} else {
tmp = fmax((hypot((z * 30.0), (30.0 * x)) - 25.0), (fabs(fma((t_3 * y), 30.0, t_0)) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) t_1 = fma(900.0, fma(x, x, Float64(y * y)), Float64(Float64(z * z) * 900.0)) t_2 = sin(Float64(y * 30.0)) t_3 = cos(Float64(z * 30.0)) tmp = 0.0 if (fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(t_2 * t_3)) + Float64(t_0 * cos(Float64(x * 30.0))))) - 0.2)) <= 4e+145) tmp = fmax(Float64(Float64((t_1 ^ 1.0) - 625.0) / Float64(sqrt(t_1) + 25.0)), Float64(abs(fma(t_2, t_3, t_0)) - 0.2)); else tmp = fmax(Float64(hypot(Float64(z * 30.0), Float64(30.0 * x)) - 25.0), Float64(abs(fma(Float64(t_3 * y), 30.0, 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[(900.0 * N[(x * x + N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] * 900.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 4e+145], N[Max[N[(N[(N[Power[t$95$1, 1.0], $MachinePrecision] - 625.0), $MachinePrecision] / N[(N[Sqrt[t$95$1], $MachinePrecision] + 25.0), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(t$95$2 * t$95$3 + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 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[(N[(t$95$3 * y), $MachinePrecision] * 30.0 + 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{fma}\left(900, \mathsf{fma}\left(x, x, y \cdot y\right), \left(z \cdot z\right) \cdot 900\right)\\
t_2 := \sin \left(y \cdot 30\right)\\
t_3 := \cos \left(z \cdot 30\right)\\
\mathbf{if}\;\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + t\_2 \cdot t\_3\right) + t\_0 \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \leq 4 \cdot 10^{+145}:\\
\;\;\;\;\mathsf{max}\left(\frac{{t\_1}^{1} - 625}{\sqrt{t\_1} + 25}, \left|\mathsf{fma}\left(t\_2, t\_3, t\_0\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(z \cdot 30, 30 \cdot x\right) - 25, \left|\mathsf{fma}\left(t\_3 \cdot y, 30, 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))) < 4e145Initial program 46.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Applied rewrites43.3%
if 4e145 < (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.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in y around 0
lower-sqrt.f64N/A
distribute-lft-outN/A
pow2N/A
pow2N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
pow2N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lower-*.f6436.8
Applied rewrites36.8%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
pow2N/A
pow2N/A
+-commutativeN/A
distribute-lft-outN/A
+-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
pow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.4
Applied rewrites71.4%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6490.6
Applied rewrites90.6%
(FPCore (x y z)
:precision binary64
(if (<= y 7.8e+102)
(fmax
(- (hypot (* z 30.0) (* 30.0 x)) 25.0)
(- (fabs (fma (* (cos (* z 30.0)) y) 30.0 (sin (* z 30.0)))) 0.2))
(fmax (* -30.0 x) (- (fabs (* 30.0 (+ y z))) 0.2))))
double code(double x, double y, double z) {
double tmp;
if (y <= 7.8e+102) {
tmp = fmax((hypot((z * 30.0), (30.0 * x)) - 25.0), (fabs(fma((cos((z * 30.0)) * y), 30.0, sin((z * 30.0)))) - 0.2));
} else {
tmp = fmax((-30.0 * x), (fabs((30.0 * (y + z))) - 0.2));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= 7.8e+102) tmp = fmax(Float64(hypot(Float64(z * 30.0), Float64(30.0 * x)) - 25.0), Float64(abs(fma(Float64(cos(Float64(z * 30.0)) * y), 30.0, sin(Float64(z * 30.0)))) - 0.2)); else tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * Float64(y + z))) - 0.2)); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, 7.8e+102], 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[(N[(N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision] * 30.0 + N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.8 \cdot 10^{+102}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(z \cdot 30, 30 \cdot x\right) - 25, \left|\mathsf{fma}\left(\cos \left(z \cdot 30\right) \cdot y, 30, \sin \left(z \cdot 30\right)\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot \left(y + z\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if y < 7.7999999999999997e102Initial program 46.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in y around 0
lower-sqrt.f64N/A
distribute-lft-outN/A
pow2N/A
pow2N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
pow2N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lower-*.f6436.8
Applied rewrites36.8%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
pow2N/A
pow2N/A
+-commutativeN/A
distribute-lft-outN/A
+-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
pow2N/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.4
Applied rewrites71.4%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6490.6
Applied rewrites90.6%
if 7.7999999999999997e102 < y Initial program 46.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around -inf
lower-*.f6444.9
Applied rewrites44.9%
Taylor expanded in y around 0
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6471.9
Applied rewrites71.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (fma z 30.0 (sin (* y 30.0)))) 0.2)))
(if (<= x -2.8e-105)
(fmax (* -30.0 x) (- (fabs (fma z 30.0 (* y 30.0))) 0.2))
(if (<= x 4.8e+45)
(fmax (- (* (+ (/ 25.0 y) 30.0) y)) t_0)
(fmax (* (- 30.0 (/ 25.0 x)) x) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs(fma(z, 30.0, sin((y * 30.0)))) - 0.2;
double tmp;
if (x <= -2.8e-105) {
tmp = fmax((-30.0 * x), (fabs(fma(z, 30.0, (y * 30.0))) - 0.2));
} else if (x <= 4.8e+45) {
tmp = fmax(-(((25.0 / y) + 30.0) * y), t_0);
} else {
tmp = fmax(((30.0 - (25.0 / x)) * x), t_0);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(abs(fma(z, 30.0, sin(Float64(y * 30.0)))) - 0.2) tmp = 0.0 if (x <= -2.8e-105) tmp = fmax(Float64(-30.0 * x), Float64(abs(fma(z, 30.0, Float64(y * 30.0))) - 0.2)); elseif (x <= 4.8e+45) tmp = fmax(Float64(-Float64(Float64(Float64(25.0 / y) + 30.0) * y)), t_0); else tmp = fmax(Float64(Float64(30.0 - Float64(25.0 / x)) * x), t_0); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[(z * 30.0 + N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[x, -2.8e-105], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(z * 30.0 + N[(y * 30.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.8e+45], N[Max[(-N[(N[(N[(25.0 / y), $MachinePrecision] + 30.0), $MachinePrecision] * y), $MachinePrecision]), t$95$0], $MachinePrecision], N[Max[N[(N[(30.0 - N[(25.0 / x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\mathsf{fma}\left(z, 30, \sin \left(y \cdot 30\right)\right)\right| - 0.2\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{-105}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(z, 30, y \cdot 30\right)\right| - 0.2\right)\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+45}:\\
\;\;\;\;\mathsf{max}\left(-\left(\frac{25}{y} + 30\right) \cdot y, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\left(30 - \frac{25}{x}\right) \cdot x, t\_0\right)\\
\end{array}
\end{array}
if x < -2.8e-105Initial program 46.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around -inf
lower-*.f6444.9
Applied rewrites44.9%
Taylor expanded in y around 0
*-commutativeN/A
lift-*.f6471.9
Applied rewrites71.9%
if -2.8e-105 < x < 4.79999999999999979e45Initial program 46.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in y around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lift-/.f6457.3
Applied rewrites57.3%
if 4.79999999999999979e45 < x Initial program 46.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6457.3
Applied rewrites57.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (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_0 (cos (* z 30.0))))
(* (sin (* z 30.0)) (cos (* x 30.0)))))
0.2))
1e+148)
(fmax
(- (sqrt (* 900.0 (fma x x (* y y)))) 25.0)
(- (fabs (fma z 30.0 t_0)) 0.2))
(fmax (* -30.0 x) (- (fabs (* 30.0 (+ y z))) 0.2)))))
double code(double x, double y, double z) {
double t_0 = 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_0 * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2)) <= 1e+148) {
tmp = fmax((sqrt((900.0 * fma(x, x, (y * y)))) - 25.0), (fabs(fma(z, 30.0, t_0)) - 0.2));
} else {
tmp = fmax((-30.0 * x), (fabs((30.0 * (y + z))) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = 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_0 * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2)) <= 1e+148) tmp = fmax(Float64(sqrt(Float64(900.0 * fma(x, x, Float64(y * y)))) - 25.0), Float64(abs(fma(z, 30.0, t_0)) - 0.2)); else tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * Float64(y + z))) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = 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$0 * 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], 1e+148], N[Max[N[(N[Sqrt[N[(900.0 * N[(x * x + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(z * 30.0 + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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\_0 \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 10^{+148}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{900 \cdot \mathsf{fma}\left(x, x, y \cdot y\right)} - 25, \left|\mathsf{fma}\left(z, 30, t\_0\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot \left(y + z\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))) < 1e148Initial program 46.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in z around 0
lower-sqrt.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
pow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6458.7
Applied rewrites58.7%
if 1e148 < (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.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around -inf
lower-*.f6444.9
Applied rewrites44.9%
Taylor expanded in y around 0
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6471.9
Applied rewrites71.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (* 30.0 (+ y z))) 0.2)))
(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))
1e+148)
(fmax (- (sqrt (* (fma z z (* x x)) 900.0)) 25.0) t_0)
(fmax (* -30.0 x) t_0))))
double code(double x, double y, double z) {
double t_0 = fabs((30.0 * (y + z))) - 0.2;
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)) <= 1e+148) {
tmp = fmax((sqrt((fma(z, z, (x * x)) * 900.0)) - 25.0), t_0);
} else {
tmp = fmax((-30.0 * x), t_0);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(abs(Float64(30.0 * Float64(y + z))) - 0.2) 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)) <= 1e+148) tmp = fmax(Float64(sqrt(Float64(fma(z, z, Float64(x * x)) * 900.0)) - 25.0), t_0); else tmp = fmax(Float64(-30.0 * x), t_0); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[(30.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $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], 1e+148], N[Max[N[(N[Sqrt[N[(N[(z * z + N[(x * x), $MachinePrecision]), $MachinePrecision] * 900.0), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(-30.0 * x), $MachinePrecision], t$95$0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|30 \cdot \left(y + z\right)\right| - 0.2\\
\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 10^{+148}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\mathsf{fma}\left(z, z, x \cdot x\right) \cdot 900} - 25, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, t\_0\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))) < 1e148Initial program 46.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in y around 0
lower--.f64N/A
lower-sqrt.f64N/A
distribute-lft-outN/A
+-commutativeN/A
pow2N/A
pow2N/A
*-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f6436.4
Applied rewrites36.4%
Taylor expanded in y around 0
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6458.6
Applied rewrites58.6%
if 1e148 < (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.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around -inf
lower-*.f6444.9
Applied rewrites44.9%
Taylor expanded in y around 0
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6471.9
Applied rewrites71.9%
(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+78)
(fmax (- (sqrt (* (fma z z (* x x)) 900.0)) 25.0) (- (fabs (* z 30.0)) 0.2))
(fmax (* -30.0 x) (- (fabs (fma z 30.0 (* y 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+78) {
tmp = fmax((sqrt((fma(z, z, (x * x)) * 900.0)) - 25.0), (fabs((z * 30.0)) - 0.2));
} else {
tmp = fmax((-30.0 * x), (fabs(fma(z, 30.0, (y * 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+78) tmp = fmax(Float64(sqrt(Float64(fma(z, z, Float64(x * x)) * 900.0)) - 25.0), Float64(abs(Float64(z * 30.0)) - 0.2)); else tmp = fmax(Float64(-30.0 * x), Float64(abs(fma(z, 30.0, Float64(y * 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+78], N[Max[N[(N[Sqrt[N[(N[(z * z + N[(x * x), $MachinePrecision]), $MachinePrecision] * 900.0), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(z * 30.0 + N[(y * 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^{+78}:\\
\;\;\;\;\mathsf{max}\left(\sqrt{\mathsf{fma}\left(z, z, x \cdot x\right) \cdot 900} - 25, \left|z \cdot 30\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(z, 30, y \cdot 30\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))) < 4.99999999999999984e78Initial program 46.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in y around 0
lower--.f64N/A
lower-sqrt.f64N/A
distribute-lft-outN/A
+-commutativeN/A
pow2N/A
pow2N/A
*-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f6436.4
Applied rewrites36.4%
Taylor expanded in y around 0
*-commutativeN/A
lift-*.f6435.6
Applied rewrites35.6%
if 4.99999999999999984e78 < (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.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around -inf
lower-*.f6444.9
Applied rewrites44.9%
Taylor expanded in y around 0
*-commutativeN/A
lift-*.f6471.9
Applied rewrites71.9%
(FPCore (x y z) :precision binary64 (fmax (* -30.0 x) (- (fabs (fma z 30.0 (* y 30.0))) 0.2)))
double code(double x, double y, double z) {
return fmax((-30.0 * x), (fabs(fma(z, 30.0, (y * 30.0))) - 0.2));
}
function code(x, y, z) return fmax(Float64(-30.0 * x), Float64(abs(fma(z, 30.0, Float64(y * 30.0))) - 0.2)) end
code[x_, y_, z_] := N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(z * 30.0 + N[(y * 30.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(z, 30, y \cdot 30\right)\right| - 0.2\right)
\end{array}
Initial program 46.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around -inf
lower-*.f6444.9
Applied rewrites44.9%
Taylor expanded in y around 0
*-commutativeN/A
lift-*.f6471.9
Applied rewrites71.9%
(FPCore (x y z) :precision binary64 (fmax (* -30.0 x) (- (fabs (* 30.0 (+ y z))) 0.2)))
double code(double x, double y, double z) {
return fmax((-30.0 * x), (fabs((30.0 * (y + z))) - 0.2));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = fmax(((-30.0d0) * x), (abs((30.0d0 * (y + z))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((-30.0 * x), (Math.abs((30.0 * (y + z))) - 0.2));
}
def code(x, y, z): return fmax((-30.0 * x), (math.fabs((30.0 * (y + z))) - 0.2))
function code(x, y, z) return fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * Float64(y + z))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((-30.0 * x), (abs((30.0 * (y + z))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(-30 \cdot x, \left|30 \cdot \left(y + z\right)\right| - 0.2\right)
\end{array}
Initial program 46.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around -inf
lower-*.f6444.9
Applied rewrites44.9%
Taylor expanded in y around 0
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6471.9
Applied rewrites71.9%
(FPCore (x y z) :precision binary64 (fmax (* -30.0 x) (- (fabs (* z 30.0)) 0.2)))
double code(double x, double y, double z) {
return fmax((-30.0 * x), (fabs((z * 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(((-30.0d0) * x), (abs((z * 30.0d0)) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((-30.0 * x), (Math.abs((z * 30.0)) - 0.2));
}
def code(x, y, z): return fmax((-30.0 * x), (math.fabs((z * 30.0)) - 0.2))
function code(x, y, z) return fmax(Float64(-30.0 * x), Float64(abs(Float64(z * 30.0)) - 0.2)) end
function tmp = code(x, y, z) tmp = max((-30.0 * x), (abs((z * 30.0)) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(-30 \cdot x, \left|z \cdot 30\right| - 0.2\right)
\end{array}
Initial program 46.8%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6446.2
Applied rewrites46.2%
Taylor expanded in x around -inf
lower-*.f6444.9
Applied rewrites44.9%
Taylor expanded in y around 0
*-commutativeN/A
lift-*.f6444.3
Applied rewrites44.3%
herbie shell --seed 2025140
(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)))