
(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}
Sampling outcomes in binary64 precision:
Herbie found 14 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
(if (or (<= z -1.85e+15) (not (<= z 1.75e+46)))
(fmax (- (hypot (* z 30.0) (* 30.0 x)) 25.0) (- (fabs (* 30.0 x)) 0.2))
(fmax
(- (hypot (* y 30.0) (* 30.0 x)) 25.0)
(-
(fabs
(+
(* (sin (* z 30.0)) (cos (* x 30.0)))
(+
(* (sin (* x 30.0)) (cos (* y 30.0)))
(* (sin (* y 30.0)) (cos (* z 30.0))))))
0.2))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.85e+15) || !(z <= 1.75e+46)) {
tmp = fmax((hypot((z * 30.0), (30.0 * x)) - 25.0), (fabs((30.0 * x)) - 0.2));
} else {
tmp = fmax((hypot((y * 30.0), (30.0 * x)) - 25.0), (fabs(((sin((z * 30.0)) * cos((x * 30.0))) + ((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))))) - 0.2));
}
return tmp;
}
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.85e+15) || !(z <= 1.75e+46)) {
tmp = fmax((Math.hypot((z * 30.0), (30.0 * x)) - 25.0), (Math.abs((30.0 * x)) - 0.2));
} else {
tmp = fmax((Math.hypot((y * 30.0), (30.0 * x)) - 25.0), (Math.abs(((Math.sin((z * 30.0)) * Math.cos((x * 30.0))) + ((Math.sin((x * 30.0)) * Math.cos((y * 30.0))) + (Math.sin((y * 30.0)) * Math.cos((z * 30.0)))))) - 0.2));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.85e+15) or not (z <= 1.75e+46): tmp = fmax((math.hypot((z * 30.0), (30.0 * x)) - 25.0), (math.fabs((30.0 * x)) - 0.2)) else: tmp = fmax((math.hypot((y * 30.0), (30.0 * x)) - 25.0), (math.fabs(((math.sin((z * 30.0)) * math.cos((x * 30.0))) + ((math.sin((x * 30.0)) * math.cos((y * 30.0))) + (math.sin((y * 30.0)) * math.cos((z * 30.0)))))) - 0.2)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.85e+15) || !(z <= 1.75e+46)) 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(hypot(Float64(y * 30.0), Float64(30.0 * x)) - 25.0), Float64(abs(Float64(Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))) + Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))))) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.85e+15) || ~((z <= 1.75e+46))) tmp = max((hypot((z * 30.0), (30.0 * x)) - 25.0), (abs((30.0 * x)) - 0.2)); else tmp = max((hypot((y * 30.0), (30.0 * x)) - 25.0), (abs(((sin((z * 30.0)) * cos((x * 30.0))) + ((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))))) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.85e+15], N[Not[LessEqual[z, 1.75e+46]], $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[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 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[(N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 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]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+15} \lor \neg \left(z \leq 1.75 \cdot 10^{+46}\right):\\
\;\;\;\;\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(\mathsf{hypot}\left(y \cdot 30, 30 \cdot x\right) - 25, \left|\sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right) + \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)\right| - 0.2\right)\\
\end{array}
\end{array}
if z < -1.85e15 or 1.74999999999999992e46 < z Initial program 35.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-*.f6489.6
Applied rewrites89.6%
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-*.f6489.6
Applied rewrites89.6%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6489.6
Applied rewrites89.6%
Taylor expanded in x around inf
lift-*.f6489.6
Applied rewrites89.6%
if -1.85e15 < z < 1.74999999999999992e46Initial program 58.0%
Taylor expanded in z 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.4
Applied rewrites98.4%
Final simplification94.7%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.85e+15) (not (<= z 1.75e+46)))
(fmax (- (hypot (* z 30.0) (* 30.0 x)) 25.0) (- (fabs (* 30.0 x)) 0.2))
(fmax
(- (hypot (* 30.0 x) (* y 30.0)) 25.0)
(- (fabs (fma (sin (* z 30.0)) (cos (* 30.0 x)) (sin (* 30.0 x)))) 0.2))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.85e+15) || !(z <= 1.75e+46)) {
tmp = fmax((hypot((z * 30.0), (30.0 * x)) - 25.0), (fabs((30.0 * x)) - 0.2));
} else {
tmp = fmax((hypot((30.0 * x), (y * 30.0)) - 25.0), (fabs(fma(sin((z * 30.0)), cos((30.0 * x)), sin((30.0 * x)))) - 0.2));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if ((z <= -1.85e+15) || !(z <= 1.75e+46)) 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(hypot(Float64(30.0 * x), Float64(y * 30.0)) - 25.0), Float64(abs(fma(sin(Float64(z * 30.0)), cos(Float64(30.0 * x)), sin(Float64(30.0 * x)))) - 0.2)); end return tmp end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.85e+15], N[Not[LessEqual[z, 1.75e+46]], $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[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[Sqrt[N[(30.0 * x), $MachinePrecision] ^ 2 + N[(y * 30.0), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+15} \lor \neg \left(z \leq 1.75 \cdot 10^{+46}\right):\\
\;\;\;\;\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(\mathsf{hypot}\left(30 \cdot x, y \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if z < -1.85e15 or 1.74999999999999992e46 < z Initial program 35.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-*.f6489.6
Applied rewrites89.6%
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-*.f6489.6
Applied rewrites89.6%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6489.6
Applied rewrites89.6%
Taylor expanded in x around inf
lift-*.f6489.6
Applied rewrites89.6%
if -1.85e15 < z < 1.74999999999999992e46Initial program 58.0%
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-*.f6469.6
Applied rewrites69.6%
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-*.f6468.3
Applied rewrites68.3%
Taylor expanded in z around 0
metadata-evalN/A
pow2N/A
swap-sqrN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
lift-*.f6497.8
Applied rewrites97.8%
Final simplification94.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0))))
(if (<= y -115.0)
(fmax (- (hypot (* 30.0 x) (* y 30.0)) 25.0) (- (fabs t_0) 0.2))
(if (<= y 5.6e+67)
(fmax
(- (hypot (* z 30.0) (* 30.0 x)) 25.0)
(- (fabs (fma 30.0 x t_0)) 0.2))
(fmax (* y 30.0) (- (fabs (fma z 30.0 (sin (* y 30.0)))) 0.2))))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double tmp;
if (y <= -115.0) {
tmp = fmax((hypot((30.0 * x), (y * 30.0)) - 25.0), (fabs(t_0) - 0.2));
} else if (y <= 5.6e+67) {
tmp = fmax((hypot((z * 30.0), (30.0 * x)) - 25.0), (fabs(fma(30.0, x, t_0)) - 0.2));
} else {
tmp = fmax((y * 30.0), (fabs(fma(z, 30.0, sin((y * 30.0)))) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) tmp = 0.0 if (y <= -115.0) tmp = fmax(Float64(hypot(Float64(30.0 * x), Float64(y * 30.0)) - 25.0), Float64(abs(t_0) - 0.2)); elseif (y <= 5.6e+67) tmp = fmax(Float64(hypot(Float64(z * 30.0), Float64(30.0 * x)) - 25.0), Float64(abs(fma(30.0, x, t_0)) - 0.2)); else tmp = fmax(Float64(y * 30.0), Float64(abs(fma(z, 30.0, sin(Float64(y * 30.0)))) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -115.0], N[Max[N[(N[Sqrt[N[(30.0 * x), $MachinePrecision] ^ 2 + N[(y * 30.0), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 5.6e+67], 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 + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(y * 30.0), $MachinePrecision], N[(N[Abs[N[(z * 30.0 + N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
\mathbf{if}\;y \leq -115:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(30 \cdot x, y \cdot 30\right) - 25, \left|t\_0\right| - 0.2\right)\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+67}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(z \cdot 30, 30 \cdot x\right) - 25, \left|\mathsf{fma}\left(30, x, t\_0\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot 30, \left|\mathsf{fma}\left(z, 30, \sin \left(y \cdot 30\right)\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if y < -115Initial program 34.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-*.f6448.6
Applied rewrites48.6%
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-*.f6447.5
Applied rewrites47.5%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6447.5
Applied rewrites47.5%
Taylor expanded in z around 0
metadata-evalN/A
pow2N/A
swap-sqrN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
lift-*.f6489.1
Applied rewrites89.1%
if -115 < y < 5.5999999999999995e67Initial program 60.0%
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.7
Applied rewrites98.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-*.f6498.1
Applied rewrites98.1%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6496.3
Applied rewrites96.3%
if 5.5999999999999995e67 < y Initial program 26.7%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f6463.1
Applied rewrites63.1%
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-*.f6463.1
Applied rewrites63.1%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6486.6
Applied rewrites86.6%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.85e+15) (not (<= z 1.75e+46)))
(fmax (- (hypot (* z 30.0) (* 30.0 x)) 25.0) (- (fabs (* 30.0 x)) 0.2))
(fmax
(- (hypot (* 30.0 x) (* y 30.0)) 25.0)
(- (fabs (sin (* z 30.0))) 0.2))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.85e+15) || !(z <= 1.75e+46)) {
tmp = fmax((hypot((z * 30.0), (30.0 * x)) - 25.0), (fabs((30.0 * x)) - 0.2));
} else {
tmp = fmax((hypot((30.0 * x), (y * 30.0)) - 25.0), (fabs(sin((z * 30.0))) - 0.2));
}
return tmp;
}
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.85e+15) || !(z <= 1.75e+46)) {
tmp = fmax((Math.hypot((z * 30.0), (30.0 * x)) - 25.0), (Math.abs((30.0 * x)) - 0.2));
} else {
tmp = fmax((Math.hypot((30.0 * x), (y * 30.0)) - 25.0), (Math.abs(Math.sin((z * 30.0))) - 0.2));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.85e+15) or not (z <= 1.75e+46): tmp = fmax((math.hypot((z * 30.0), (30.0 * x)) - 25.0), (math.fabs((30.0 * x)) - 0.2)) else: tmp = fmax((math.hypot((30.0 * x), (y * 30.0)) - 25.0), (math.fabs(math.sin((z * 30.0))) - 0.2)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.85e+15) || !(z <= 1.75e+46)) 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(hypot(Float64(30.0 * x), Float64(y * 30.0)) - 25.0), Float64(abs(sin(Float64(z * 30.0))) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.85e+15) || ~((z <= 1.75e+46))) tmp = max((hypot((z * 30.0), (30.0 * x)) - 25.0), (abs((30.0 * x)) - 0.2)); else tmp = max((hypot((30.0 * x), (y * 30.0)) - 25.0), (abs(sin((z * 30.0))) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.85e+15], N[Not[LessEqual[z, 1.75e+46]], $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[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[Sqrt[N[(30.0 * x), $MachinePrecision] ^ 2 + N[(y * 30.0), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+15} \lor \neg \left(z \leq 1.75 \cdot 10^{+46}\right):\\
\;\;\;\;\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(\mathsf{hypot}\left(30 \cdot x, y \cdot 30\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if z < -1.85e15 or 1.74999999999999992e46 < z Initial program 35.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-*.f6489.6
Applied rewrites89.6%
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-*.f6489.6
Applied rewrites89.6%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6489.6
Applied rewrites89.6%
Taylor expanded in x around inf
lift-*.f6489.6
Applied rewrites89.6%
if -1.85e15 < z < 1.74999999999999992e46Initial program 58.0%
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-*.f6469.6
Applied rewrites69.6%
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-*.f6468.3
Applied rewrites68.3%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6465.6
Applied rewrites65.6%
Taylor expanded in z around 0
metadata-evalN/A
pow2N/A
swap-sqrN/A
*-commutativeN/A
metadata-evalN/A
unpow-prod-downN/A
unpow2N/A
lower-hypot.f64N/A
lift-*.f64N/A
lift-*.f6495.1
Applied rewrites95.1%
Final simplification92.8%
(FPCore (x y z)
:precision binary64
(if (<= y -3.2e+160)
(fmax (* -30.0 y) (- (fabs (sin (* z 30.0))) 0.2))
(if (<= y 5.6e+67)
(fmax (- (hypot (* z 30.0) (* 30.0 x)) 25.0) (- (fabs (* 30.0 x)) 0.2))
(fmax (* y 30.0) (- (fabs (fma z 30.0 (sin (* y 30.0)))) 0.2)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.2e+160) {
tmp = fmax((-30.0 * y), (fabs(sin((z * 30.0))) - 0.2));
} else if (y <= 5.6e+67) {
tmp = fmax((hypot((z * 30.0), (30.0 * x)) - 25.0), (fabs((30.0 * x)) - 0.2));
} else {
tmp = fmax((y * 30.0), (fabs(fma(z, 30.0, sin((y * 30.0)))) - 0.2));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= -3.2e+160) tmp = fmax(Float64(-30.0 * y), Float64(abs(sin(Float64(z * 30.0))) - 0.2)); elseif (y <= 5.6e+67) 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), Float64(abs(fma(z, 30.0, sin(Float64(y * 30.0)))) - 0.2)); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, -3.2e+160], N[Max[N[(-30.0 * y), $MachinePrecision], N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 5.6e+67], 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], N[(N[Abs[N[(z * 30.0 + N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+160}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+67}:\\
\;\;\;\;\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, \left|\mathsf{fma}\left(z, 30, \sin \left(y \cdot 30\right)\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if y < -3.1999999999999998e160Initial program 7.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-*.f6423.6
Applied rewrites23.6%
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-*.f6423.0
Applied rewrites23.0%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6423.0
Applied rewrites23.0%
Taylor expanded in y around -inf
lower-*.f6482.5
Applied rewrites82.5%
if -3.1999999999999998e160 < y < 5.5999999999999995e67Initial program 59.0%
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-*.f6493.4
Applied rewrites93.4%
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-*.f6492.7
Applied rewrites92.7%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6491.2
Applied rewrites91.2%
Taylor expanded in x around inf
lift-*.f6490.8
Applied rewrites90.8%
if 5.5999999999999995e67 < y Initial program 26.7%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f6463.1
Applied rewrites63.1%
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-*.f6463.1
Applied rewrites63.1%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6486.6
Applied rewrites86.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sin (* z 30.0))))
(if (<= y -9.8e+60)
(fmax (* -30.0 y) (- (fabs t_0) 0.2))
(if (<= y 6.8e+62)
(fmax (- (* z 30.0) 25.0) (- (fabs (fma 30.0 x t_0)) 0.2))
(fmax (* y 30.0) (- (fabs (fma z 30.0 (sin (* y 30.0)))) 0.2))))))
double code(double x, double y, double z) {
double t_0 = sin((z * 30.0));
double tmp;
if (y <= -9.8e+60) {
tmp = fmax((-30.0 * y), (fabs(t_0) - 0.2));
} else if (y <= 6.8e+62) {
tmp = fmax(((z * 30.0) - 25.0), (fabs(fma(30.0, x, t_0)) - 0.2));
} else {
tmp = fmax((y * 30.0), (fabs(fma(z, 30.0, sin((y * 30.0)))) - 0.2));
}
return tmp;
}
function code(x, y, z) t_0 = sin(Float64(z * 30.0)) tmp = 0.0 if (y <= -9.8e+60) tmp = fmax(Float64(-30.0 * y), Float64(abs(t_0) - 0.2)); elseif (y <= 6.8e+62) tmp = fmax(Float64(Float64(z * 30.0) - 25.0), Float64(abs(fma(30.0, x, t_0)) - 0.2)); else tmp = fmax(Float64(y * 30.0), Float64(abs(fma(z, 30.0, sin(Float64(y * 30.0)))) - 0.2)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -9.8e+60], N[Max[N[(-30.0 * y), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 6.8e+62], N[Max[N[(N[(z * 30.0), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(y * 30.0), $MachinePrecision], N[(N[Abs[N[(z * 30.0 + N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
\mathbf{if}\;y \leq -9.8 \cdot 10^{+60}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|t\_0\right| - 0.2\right)\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+62}:\\
\;\;\;\;\mathsf{max}\left(z \cdot 30 - 25, \left|\mathsf{fma}\left(30, x, t\_0\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(y \cdot 30, \left|\mathsf{fma}\left(z, 30, \sin \left(y \cdot 30\right)\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if y < -9.8000000000000005e60Initial program 29.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-*.f6440.7
Applied rewrites40.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-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6439.9
Applied rewrites39.9%
Taylor expanded in y around -inf
lower-*.f6465.6
Applied rewrites65.6%
if -9.8000000000000005e60 < y < 6.80000000000000028e62Initial program 59.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-*.f6496.6
Applied rewrites96.6%
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-*.f6495.9
Applied rewrites95.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6494.2
Applied rewrites94.2%
Taylor expanded in z around inf
*-commutativeN/A
lift-*.f6476.5
Applied rewrites76.5%
if 6.80000000000000028e62 < y Initial program 25.9%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f6460.8
Applied rewrites60.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-*.f6460.8
Applied rewrites60.8%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6485.2
Applied rewrites85.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* z 30.0))) 0.2)))
(if (<= x -5.4e-24)
(fmax (- (* -30.0 x) 25.0) t_0)
(if (<= x 2.85e+76)
(fmax (* y 30.0) (- (fabs (fma z 30.0 (sin (* y 30.0)))) 0.2))
(fmax (* 30.0 x) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs(sin((z * 30.0))) - 0.2;
double tmp;
if (x <= -5.4e-24) {
tmp = fmax(((-30.0 * x) - 25.0), t_0);
} else if (x <= 2.85e+76) {
tmp = fmax((y * 30.0), (fabs(fma(z, 30.0, sin((y * 30.0)))) - 0.2));
} else {
tmp = fmax((30.0 * x), t_0);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(abs(sin(Float64(z * 30.0))) - 0.2) tmp = 0.0 if (x <= -5.4e-24) tmp = fmax(Float64(Float64(-30.0 * x) - 25.0), t_0); elseif (x <= 2.85e+76) tmp = fmax(Float64(y * 30.0), Float64(abs(fma(z, 30.0, sin(Float64(y * 30.0)))) - 0.2)); 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[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[x, -5.4e-24], N[Max[N[(N[(-30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 2.85e+76], N[Max[N[(y * 30.0), $MachinePrecision], N[(N[Abs[N[(z * 30.0 + N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(30.0 * x), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\sin \left(z \cdot 30\right)\right| - 0.2\\
\mathbf{if}\;x \leq -5.4 \cdot 10^{-24}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, t\_0\right)\\
\mathbf{elif}\;x \leq 2.85 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{max}\left(y \cdot 30, \left|\mathsf{fma}\left(z, 30, \sin \left(y \cdot 30\right)\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot x, t\_0\right)\\
\end{array}
\end{array}
if x < -5.40000000000000014e-24Initial program 38.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-*.f6480.9
Applied rewrites80.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-*.f6480.5
Applied rewrites80.5%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6479.0
Applied rewrites79.0%
Taylor expanded in x around -inf
lift-*.f6463.1
Applied rewrites63.1%
if -5.40000000000000014e-24 < x < 2.85000000000000002e76Initial program 62.6%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f6423.1
Applied rewrites23.1%
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-*.f6420.9
Applied rewrites20.9%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6461.7
Applied rewrites61.7%
if 2.85000000000000002e76 < x Initial program 22.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-*.f6491.9
Applied rewrites91.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-*.f6491.9
Applied rewrites91.9%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6491.9
Applied rewrites91.9%
Taylor expanded in x around inf
lift-*.f6477.9
Applied rewrites77.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* z 30.0))) 0.2)))
(if (<= z -190000000.0)
(fmax (* -30.0 z) t_0)
(if (<= z 75000000.0)
(fmax (- (* -30.0 x) 25.0) t_0)
(fmax (- (* z 30.0) 25.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs(sin((z * 30.0))) - 0.2;
double tmp;
if (z <= -190000000.0) {
tmp = fmax((-30.0 * z), t_0);
} else if (z <= 75000000.0) {
tmp = fmax(((-30.0 * x) - 25.0), t_0);
} else {
tmp = fmax(((z * 30.0) - 25.0), t_0);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs(sin((z * 30.0d0))) - 0.2d0
if (z <= (-190000000.0d0)) then
tmp = fmax(((-30.0d0) * z), t_0)
else if (z <= 75000000.0d0) then
tmp = fmax((((-30.0d0) * x) - 25.0d0), t_0)
else
tmp = fmax(((z * 30.0d0) - 25.0d0), t_0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs(Math.sin((z * 30.0))) - 0.2;
double tmp;
if (z <= -190000000.0) {
tmp = fmax((-30.0 * z), t_0);
} else if (z <= 75000000.0) {
tmp = fmax(((-30.0 * x) - 25.0), t_0);
} else {
tmp = fmax(((z * 30.0) - 25.0), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((z * 30.0))) - 0.2 tmp = 0 if z <= -190000000.0: tmp = fmax((-30.0 * z), t_0) elif z <= 75000000.0: tmp = fmax(((-30.0 * x) - 25.0), t_0) else: tmp = fmax(((z * 30.0) - 25.0), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(z * 30.0))) - 0.2) tmp = 0.0 if (z <= -190000000.0) tmp = fmax(Float64(-30.0 * z), t_0); elseif (z <= 75000000.0) tmp = fmax(Float64(Float64(-30.0 * x) - 25.0), t_0); else tmp = fmax(Float64(Float64(z * 30.0) - 25.0), t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(sin((z * 30.0))) - 0.2; tmp = 0.0; if (z <= -190000000.0) tmp = max((-30.0 * z), t_0); elseif (z <= 75000000.0) tmp = max(((-30.0 * x) - 25.0), t_0); else tmp = max(((z * 30.0) - 25.0), t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[z, -190000000.0], N[Max[N[(-30.0 * z), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[z, 75000000.0], N[Max[N[(N[(-30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(N[(z * 30.0), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\sin \left(z \cdot 30\right)\right| - 0.2\\
\mathbf{if}\;z \leq -190000000:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, t\_0\right)\\
\mathbf{elif}\;z \leq 75000000:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(z \cdot 30 - 25, t\_0\right)\\
\end{array}
\end{array}
if z < -1.9e8Initial program 40.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-*.f6489.4
Applied rewrites89.4%
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-*.f6489.4
Applied rewrites89.4%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6489.4
Applied rewrites89.4%
Taylor expanded in z around -inf
lower-*.f6469.1
Applied rewrites69.1%
if -1.9e8 < z < 7.5e7Initial program 57.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-*.f6470.8
Applied rewrites70.8%
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-*.f6469.4
Applied rewrites69.4%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6466.5
Applied rewrites66.5%
Taylor expanded in x around -inf
lift-*.f6447.0
Applied rewrites47.0%
if 7.5e7 < z Initial program 35.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-*.f6483.3
Applied rewrites83.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-*.f6483.3
Applied rewrites83.3%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6483.3
Applied rewrites83.3%
Taylor expanded in z around inf
*-commutativeN/A
lift-*.f6466.9
Applied rewrites66.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* z 30.0))) 0.2)))
(if (<= z -190000000.0)
(fmax (* -30.0 z) t_0)
(if (<= z 2.2e-9)
(fmax (- (* -30.0 x) 25.0) t_0)
(fmax (* z 30.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs(sin((z * 30.0))) - 0.2;
double tmp;
if (z <= -190000000.0) {
tmp = fmax((-30.0 * z), t_0);
} else if (z <= 2.2e-9) {
tmp = fmax(((-30.0 * x) - 25.0), t_0);
} else {
tmp = fmax((z * 30.0), t_0);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs(sin((z * 30.0d0))) - 0.2d0
if (z <= (-190000000.0d0)) then
tmp = fmax(((-30.0d0) * z), t_0)
else if (z <= 2.2d-9) then
tmp = fmax((((-30.0d0) * x) - 25.0d0), t_0)
else
tmp = fmax((z * 30.0d0), t_0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs(Math.sin((z * 30.0))) - 0.2;
double tmp;
if (z <= -190000000.0) {
tmp = fmax((-30.0 * z), t_0);
} else if (z <= 2.2e-9) {
tmp = fmax(((-30.0 * x) - 25.0), t_0);
} else {
tmp = fmax((z * 30.0), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((z * 30.0))) - 0.2 tmp = 0 if z <= -190000000.0: tmp = fmax((-30.0 * z), t_0) elif z <= 2.2e-9: tmp = fmax(((-30.0 * x) - 25.0), t_0) else: tmp = fmax((z * 30.0), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(z * 30.0))) - 0.2) tmp = 0.0 if (z <= -190000000.0) tmp = fmax(Float64(-30.0 * z), t_0); elseif (z <= 2.2e-9) tmp = fmax(Float64(Float64(-30.0 * x) - 25.0), t_0); else tmp = fmax(Float64(z * 30.0), t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(sin((z * 30.0))) - 0.2; tmp = 0.0; if (z <= -190000000.0) tmp = max((-30.0 * z), t_0); elseif (z <= 2.2e-9) tmp = max(((-30.0 * x) - 25.0), t_0); else tmp = max((z * 30.0), t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[z, -190000000.0], N[Max[N[(-30.0 * z), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[z, 2.2e-9], N[Max[N[(N[(-30.0 * x), $MachinePrecision] - 25.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|\sin \left(z \cdot 30\right)\right| - 0.2\\
\mathbf{if}\;z \leq -190000000:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, t\_0\right)\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-9}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(z \cdot 30, t\_0\right)\\
\end{array}
\end{array}
if z < -1.9e8Initial program 40.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-*.f6489.4
Applied rewrites89.4%
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-*.f6489.4
Applied rewrites89.4%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6489.4
Applied rewrites89.4%
Taylor expanded in z around -inf
lower-*.f6469.1
Applied rewrites69.1%
if -1.9e8 < z < 2.1999999999999998e-9Initial program 58.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-*.f6472.0
Applied rewrites72.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-*.f6470.6
Applied rewrites70.6%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6467.6
Applied rewrites67.6%
Taylor expanded in x around -inf
lift-*.f6448.2
Applied rewrites48.2%
if 2.1999999999999998e-9 < z Initial program 35.4%
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-*.f6479.7
Applied rewrites79.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-*.f6479.7
Applied rewrites79.7%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6479.7
Applied rewrites79.7%
Taylor expanded in z around inf
*-commutativeN/A
lift-*.f6461.9
Applied rewrites61.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* z 30.0))) 0.2)))
(if (<= z -6400000000000.0)
(fmax (* -30.0 z) t_0)
(if (<= z 1.5e+45)
(fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2))
(fmax (* z 30.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs(sin((z * 30.0))) - 0.2;
double tmp;
if (z <= -6400000000000.0) {
tmp = fmax((-30.0 * z), t_0);
} else if (z <= 1.5e+45) {
tmp = fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
} else {
tmp = fmax((z * 30.0), t_0);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs(sin((z * 30.0d0))) - 0.2d0
if (z <= (-6400000000000.0d0)) then
tmp = fmax(((-30.0d0) * z), t_0)
else if (z <= 1.5d+45) then
tmp = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
else
tmp = fmax((z * 30.0d0), t_0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs(Math.sin((z * 30.0))) - 0.2;
double tmp;
if (z <= -6400000000000.0) {
tmp = fmax((-30.0 * z), t_0);
} else if (z <= 1.5e+45) {
tmp = fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
} else {
tmp = fmax((z * 30.0), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((z * 30.0))) - 0.2 tmp = 0 if z <= -6400000000000.0: tmp = fmax((-30.0 * z), t_0) elif z <= 1.5e+45: tmp = fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2)) else: tmp = fmax((z * 30.0), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(sin(Float64(z * 30.0))) - 0.2) tmp = 0.0 if (z <= -6400000000000.0) tmp = fmax(Float64(-30.0 * z), t_0); elseif (z <= 1.5e+45) tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2)); else tmp = fmax(Float64(z * 30.0), t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(sin((z * 30.0))) - 0.2; tmp = 0.0; if (z <= -6400000000000.0) tmp = max((-30.0 * z), t_0); elseif (z <= 1.5e+45) tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2)); else tmp = max((z * 30.0), t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[z, -6400000000000.0], N[Max[N[(-30.0 * z), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[z, 1.5e+45], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(z * 30.0), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\sin \left(z \cdot 30\right)\right| - 0.2\\
\mathbf{if}\;z \leq -6400000000000:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, t\_0\right)\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+45}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(z \cdot 30, t\_0\right)\\
\end{array}
\end{array}
if z < -6.4e12Initial program 40.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-*.f6490.7
Applied rewrites90.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-*.f6490.7
Applied rewrites90.7%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6490.7
Applied rewrites90.7%
Taylor expanded in z around -inf
lower-*.f6470.1
Applied rewrites70.1%
if -6.4e12 < z < 1.50000000000000005e45Initial program 58.1%
Taylor expanded in x around -inf
lower-*.f6425.4
Applied rewrites25.4%
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-*.f6424.9
Applied rewrites24.9%
Taylor expanded in z around 0
lift-sin.f64N/A
lift-*.f6424.7
Applied rewrites24.7%
Taylor expanded in x around 0
lift-*.f6441.9
Applied rewrites41.9%
if 1.50000000000000005e45 < z Initial program 30.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-*.f6484.8
Applied rewrites84.8%
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-*.f6484.8
Applied rewrites84.8%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6484.8
Applied rewrites84.8%
Taylor expanded in z around inf
*-commutativeN/A
lift-*.f6471.6
Applied rewrites71.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (fabs (sin (* z 30.0))) 0.2)))
(if (<= y -9.2e+60)
(fmax (* -30.0 y) t_0)
(if (<= y 5.6e+67)
(fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2))
(fmax (* y 30.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs(sin((z * 30.0))) - 0.2;
double tmp;
if (y <= -9.2e+60) {
tmp = fmax((-30.0 * y), t_0);
} else if (y <= 5.6e+67) {
tmp = fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
} else {
tmp = fmax((y * 30.0), t_0);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs(sin((z * 30.0d0))) - 0.2d0
if (y <= (-9.2d+60)) then
tmp = fmax(((-30.0d0) * y), t_0)
else if (y <= 5.6d+67) then
tmp = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
else
tmp = fmax((y * 30.0d0), t_0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs(Math.sin((z * 30.0))) - 0.2;
double tmp;
if (y <= -9.2e+60) {
tmp = fmax((-30.0 * y), t_0);
} else if (y <= 5.6e+67) {
tmp = fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
} else {
tmp = fmax((y * 30.0), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(math.sin((z * 30.0))) - 0.2 tmp = 0 if y <= -9.2e+60: tmp = fmax((-30.0 * y), t_0) elif y <= 5.6e+67: tmp = fmax((-30.0 * x), (math.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(sin(Float64(z * 30.0))) - 0.2) tmp = 0.0 if (y <= -9.2e+60) tmp = fmax(Float64(-30.0 * y), t_0); elseif (y <= 5.6e+67) tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2)); else tmp = fmax(Float64(y * 30.0), t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(sin((z * 30.0))) - 0.2; tmp = 0.0; if (y <= -9.2e+60) tmp = max((-30.0 * y), t_0); elseif (y <= 5.6e+67) tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2)); else tmp = max((y * 30.0), t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[y, -9.2e+60], N[Max[N[(-30.0 * y), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[y, 5.6e+67], N[Max[N[(-30.0 * x), $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|\sin \left(z \cdot 30\right)\right| - 0.2\\
\mathbf{if}\;y \leq -9.2 \cdot 10^{+60}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, t\_0\right)\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+67}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, \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 < -9.20000000000000068e60Initial program 29.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-*.f6440.7
Applied rewrites40.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-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6439.9
Applied rewrites39.9%
Taylor expanded in y around -inf
lower-*.f6465.6
Applied rewrites65.6%
if -9.20000000000000068e60 < y < 5.5999999999999995e67Initial program 59.2%
Taylor expanded in x around -inf
lower-*.f6423.8
Applied rewrites23.8%
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-*.f6423.7
Applied rewrites23.7%
Taylor expanded in z around 0
lift-sin.f64N/A
lift-*.f6423.1
Applied rewrites23.1%
Taylor expanded in x around 0
lift-*.f6438.5
Applied rewrites38.5%
if 5.5999999999999995e67 < y Initial program 26.7%
Taylor expanded in y around inf
*-commutativeN/A
lift-*.f6463.1
Applied rewrites63.1%
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-*.f6463.1
Applied rewrites63.1%
Taylor expanded in y around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6463.1
Applied rewrites63.1%
(FPCore (x y z) :precision binary64 (if (<= z -6400000000000.0) (fmax (* -30.0 z) (- (fabs (sin (* z 30.0))) 0.2)) (fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2))))
double code(double x, double y, double z) {
double tmp;
if (z <= -6400000000000.0) {
tmp = fmax((-30.0 * z), (fabs(sin((z * 30.0))) - 0.2));
} else {
tmp = fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-6400000000000.0d0)) then
tmp = fmax(((-30.0d0) * z), (abs(sin((z * 30.0d0))) - 0.2d0))
else
tmp = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -6400000000000.0) {
tmp = fmax((-30.0 * z), (Math.abs(Math.sin((z * 30.0))) - 0.2));
} else {
tmp = fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -6400000000000.0: tmp = fmax((-30.0 * z), (math.fabs(math.sin((z * 30.0))) - 0.2)) else: tmp = fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -6400000000000.0) tmp = fmax(Float64(-30.0 * z), Float64(abs(sin(Float64(z * 30.0))) - 0.2)); else tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -6400000000000.0) tmp = max((-30.0 * z), (abs(sin((z * 30.0))) - 0.2)); else tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -6400000000000.0], N[Max[N[(-30.0 * z), $MachinePrecision], N[(N[Abs[N[Sin[N[(z * 30.0), $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}\;z \leq -6400000000000:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z, \left|\sin \left(z \cdot 30\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 z < -6.4e12Initial program 40.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-*.f6490.7
Applied rewrites90.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-*.f6490.7
Applied rewrites90.7%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6490.7
Applied rewrites90.7%
Taylor expanded in z around -inf
lower-*.f6470.1
Applied rewrites70.1%
if -6.4e12 < z Initial program 51.1%
Taylor expanded in x around -inf
lower-*.f6420.6
Applied rewrites20.6%
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-*.f6420.3
Applied rewrites20.3%
Taylor expanded in z around 0
lift-sin.f64N/A
lift-*.f6419.8
Applied rewrites19.8%
Taylor expanded in x around 0
lift-*.f6435.3
Applied rewrites35.3%
(FPCore (x y z) :precision binary64 (if (<= y -9.2e+60) (fmax (* -30.0 y) (- (fabs (sin (* z 30.0))) 0.2)) (fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2))))
double code(double x, double y, double z) {
double tmp;
if (y <= -9.2e+60) {
tmp = fmax((-30.0 * y), (fabs(sin((z * 30.0))) - 0.2));
} else {
tmp = fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-9.2d+60)) then
tmp = fmax(((-30.0d0) * y), (abs(sin((z * 30.0d0))) - 0.2d0))
else
tmp = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -9.2e+60) {
tmp = fmax((-30.0 * y), (Math.abs(Math.sin((z * 30.0))) - 0.2));
} else {
tmp = fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -9.2e+60: tmp = fmax((-30.0 * y), (math.fabs(math.sin((z * 30.0))) - 0.2)) else: tmp = fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -9.2e+60) tmp = fmax(Float64(-30.0 * y), Float64(abs(sin(Float64(z * 30.0))) - 0.2)); else tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -9.2e+60) tmp = max((-30.0 * y), (abs(sin((z * 30.0))) - 0.2)); else tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -9.2e+60], N[Max[N[(-30.0 * y), $MachinePrecision], N[(N[Abs[N[Sin[N[(z * 30.0), $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}\;y \leq -9.2 \cdot 10^{+60}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\sin \left(z \cdot 30\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 y < -9.20000000000000068e60Initial program 29.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-*.f6440.7
Applied rewrites40.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-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around 0
*-commutativeN/A
lift-sin.f64N/A
lift-*.f6439.9
Applied rewrites39.9%
Taylor expanded in y around -inf
lower-*.f6465.6
Applied rewrites65.6%
if -9.20000000000000068e60 < y Initial program 52.0%
Taylor expanded in x around -inf
lower-*.f6420.7
Applied rewrites20.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-*.f6420.5
Applied rewrites20.5%
Taylor expanded in z around 0
lift-sin.f64N/A
lift-*.f6419.8
Applied rewrites19.8%
Taylor expanded in x around 0
lift-*.f6433.7
Applied rewrites33.7%
(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 48.7%
Taylor expanded in x around -inf
lower-*.f6419.8
Applied rewrites19.8%
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-*.f6419.6
Applied rewrites19.6%
Taylor expanded in z around 0
lift-sin.f64N/A
lift-*.f6419.0
Applied rewrites19.0%
Taylor expanded in x around 0
lift-*.f6432.7
Applied rewrites32.7%
herbie shell --seed 2025038
(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)))