
(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 7 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 (- (fabs (+ (sin (* 30.0 x)) (* 30.0 y))) 0.2)))
(if (<= y -4.2e+119)
(fmax (* -30.0 x) t_0)
(if (<= y 1e+67)
(fmax (- (* 30.0 (hypot x z)) 25.0) (- (fabs (sin (* y 30.0))) 0.2))
(fmax (- (* (+ (/ 25.0 x) 30.0) x)) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs((sin((30.0 * x)) + (30.0 * y))) - 0.2;
double tmp;
if (y <= -4.2e+119) {
tmp = fmax((-30.0 * x), t_0);
} else if (y <= 1e+67) {
tmp = fmax(((30.0 * hypot(x, z)) - 25.0), (fabs(sin((y * 30.0))) - 0.2));
} else {
tmp = fmax(-(((25.0 / x) + 30.0) * x), t_0);
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = Math.abs((Math.sin((30.0 * x)) + (30.0 * y))) - 0.2;
double tmp;
if (y <= -4.2e+119) {
tmp = fmax((-30.0 * x), t_0);
} else if (y <= 1e+67) {
tmp = fmax(((30.0 * Math.hypot(x, z)) - 25.0), (Math.abs(Math.sin((y * 30.0))) - 0.2));
} else {
tmp = fmax(-(((25.0 / x) + 30.0) * x), t_0);
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs((math.sin((30.0 * x)) + (30.0 * y))) - 0.2 tmp = 0 if y <= -4.2e+119: tmp = fmax((-30.0 * x), t_0) elif y <= 1e+67: tmp = fmax(((30.0 * math.hypot(x, z)) - 25.0), (math.fabs(math.sin((y * 30.0))) - 0.2)) else: tmp = fmax(-(((25.0 / x) + 30.0) * x), t_0) return tmp
function code(x, y, z) t_0 = Float64(abs(Float64(sin(Float64(30.0 * x)) + Float64(30.0 * y))) - 0.2) tmp = 0.0 if (y <= -4.2e+119) tmp = fmax(Float64(-30.0 * x), t_0); elseif (y <= 1e+67) tmp = fmax(Float64(Float64(30.0 * hypot(x, z)) - 25.0), Float64(abs(sin(Float64(y * 30.0))) - 0.2)); else tmp = fmax(Float64(-Float64(Float64(Float64(25.0 / x) + 30.0) * x)), t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs((sin((30.0 * x)) + (30.0 * y))) - 0.2; tmp = 0.0; if (y <= -4.2e+119) tmp = max((-30.0 * x), t_0); elseif (y <= 1e+67) tmp = max(((30.0 * hypot(x, z)) - 25.0), (abs(sin((y * 30.0))) - 0.2)); else tmp = max(-(((25.0 / x) + 30.0) * x), t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[(N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] + N[(30.0 * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[y, -4.2e+119], N[Max[N[(-30.0 * x), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[y, 1e+67], N[Max[N[(N[(30.0 * N[Sqrt[x ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[(-N[(N[(N[(25.0 / x), $MachinePrecision] + 30.0), $MachinePrecision] * x), $MachinePrecision]), t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\sin \left(30 \cdot x\right) + 30 \cdot y\right| - 0.2\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{+119}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x, t\_0\right)\\
\mathbf{elif}\;y \leq 10^{+67}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot \mathsf{hypot}\left(x, z\right) - 25, \left|\sin \left(y \cdot 30\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-\left(\frac{25}{x} + 30\right) \cdot x, t\_0\right)\\
\end{array}
\end{array}
if y < -4.19999999999999966e119Initial program 46.3%
Taylor expanded in z around 0
Applied rewrites45.9%
Taylor expanded in x around 0
Applied rewrites45.7%
Taylor expanded in x around -inf
Applied rewrites17.3%
Taylor expanded in y around 0
Applied rewrites45.6%
if -4.19999999999999966e119 < y < 9.99999999999999983e66Initial program 46.3%
Taylor expanded in z around 0
Applied rewrites45.9%
Taylor expanded in x around 0
Applied rewrites45.7%
Taylor expanded in y around 0
Applied rewrites35.9%
Applied rewrites70.8%
if 9.99999999999999983e66 < y Initial program 46.3%
Taylor expanded in z around 0
Applied rewrites45.9%
Taylor expanded in x around 0
Applied rewrites45.7%
Taylor expanded in x around -inf
Applied rewrites28.0%
Taylor expanded in y around 0
Applied rewrites56.6%
(FPCore (x y z)
:precision binary64
(if (<= z -1.65e+188)
(fmax (- (* -30.0 z) 25.0) (- (fabs (sin (* y 30.0))) 0.2))
(if (<= z 7.2e+24)
(fmax
(- (* (+ (/ 25.0 x) 30.0) x))
(- (fabs (+ (sin (* 30.0 x)) (* 30.0 y))) 0.2))
(fmax
(* z (- 30.0 (* 25.0 (/ 1.0 z))))
(- (fabs (sin (* z 30.0))) 0.2)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.65e+188) {
tmp = fmax(((-30.0 * z) - 25.0), (fabs(sin((y * 30.0))) - 0.2));
} else if (z <= 7.2e+24) {
tmp = fmax(-(((25.0 / x) + 30.0) * x), (fabs((sin((30.0 * x)) + (30.0 * y))) - 0.2));
} else {
tmp = fmax((z * (30.0 - (25.0 * (1.0 / z)))), (fabs(sin((z * 30.0))) - 0.2));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.65d+188)) then
tmp = fmax((((-30.0d0) * z) - 25.0d0), (abs(sin((y * 30.0d0))) - 0.2d0))
else if (z <= 7.2d+24) then
tmp = fmax(-(((25.0d0 / x) + 30.0d0) * x), (abs((sin((30.0d0 * x)) + (30.0d0 * y))) - 0.2d0))
else
tmp = fmax((z * (30.0d0 - (25.0d0 * (1.0d0 / z)))), (abs(sin((z * 30.0d0))) - 0.2d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.65e+188) {
tmp = fmax(((-30.0 * z) - 25.0), (Math.abs(Math.sin((y * 30.0))) - 0.2));
} else if (z <= 7.2e+24) {
tmp = fmax(-(((25.0 / x) + 30.0) * x), (Math.abs((Math.sin((30.0 * x)) + (30.0 * y))) - 0.2));
} else {
tmp = fmax((z * (30.0 - (25.0 * (1.0 / z)))), (Math.abs(Math.sin((z * 30.0))) - 0.2));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.65e+188: tmp = fmax(((-30.0 * z) - 25.0), (math.fabs(math.sin((y * 30.0))) - 0.2)) elif z <= 7.2e+24: tmp = fmax(-(((25.0 / x) + 30.0) * x), (math.fabs((math.sin((30.0 * x)) + (30.0 * y))) - 0.2)) else: tmp = fmax((z * (30.0 - (25.0 * (1.0 / z)))), (math.fabs(math.sin((z * 30.0))) - 0.2)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.65e+188) tmp = fmax(Float64(Float64(-30.0 * z) - 25.0), Float64(abs(sin(Float64(y * 30.0))) - 0.2)); elseif (z <= 7.2e+24) tmp = fmax(Float64(-Float64(Float64(Float64(25.0 / x) + 30.0) * x)), Float64(abs(Float64(sin(Float64(30.0 * x)) + Float64(30.0 * y))) - 0.2)); else tmp = fmax(Float64(z * Float64(30.0 - Float64(25.0 * Float64(1.0 / z)))), 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.65e+188) tmp = max(((-30.0 * z) - 25.0), (abs(sin((y * 30.0))) - 0.2)); elseif (z <= 7.2e+24) tmp = max(-(((25.0 / x) + 30.0) * x), (abs((sin((30.0 * x)) + (30.0 * y))) - 0.2)); else tmp = max((z * (30.0 - (25.0 * (1.0 / z)))), (abs(sin((z * 30.0))) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.65e+188], N[Max[N[(N[(-30.0 * z), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 7.2e+24], N[Max[(-N[(N[(N[(25.0 / x), $MachinePrecision] + 30.0), $MachinePrecision] * x), $MachinePrecision]), N[(N[Abs[N[(N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] + N[(30.0 * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(z * N[(30.0 - N[(25.0 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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.65 \cdot 10^{+188}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z - 25, \left|\sin \left(y \cdot 30\right)\right| - 0.2\right)\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{max}\left(-\left(\frac{25}{x} + 30\right) \cdot x, \left|\sin \left(30 \cdot x\right) + 30 \cdot y\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(z \cdot \left(30 - 25 \cdot \frac{1}{z}\right), \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if z < -1.64999999999999991e188Initial program 46.3%
Taylor expanded in z around 0
Applied rewrites45.9%
Taylor expanded in x around 0
Applied rewrites45.7%
Taylor expanded in z around -inf
Applied rewrites24.1%
Taylor expanded in z around inf
Applied rewrites28.6%
if -1.64999999999999991e188 < z < 7.19999999999999966e24Initial program 46.3%
Taylor expanded in z around 0
Applied rewrites45.9%
Taylor expanded in x around 0
Applied rewrites45.7%
Taylor expanded in x around -inf
Applied rewrites28.0%
Taylor expanded in y around 0
Applied rewrites56.6%
if 7.19999999999999966e24 < z Initial program 46.3%
Taylor expanded in x around 0
Applied rewrites46.0%
Taylor expanded in y around 0
Applied rewrites45.7%
Taylor expanded in z around inf
Applied rewrites27.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(fmax (* -30.0 x) (- (fabs (+ (sin (* 30.0 x)) (* 30.0 y))) 0.2))))
(if (<= y -9.5e+39)
t_0
(if (<= y 15500000000.0)
(fmax
(- (* 30.0 (sqrt (fma x x (* z z)))) 25.0)
(- (fabs (* y (+ 30.0 (* -4500.0 (pow y 2.0))))) 0.2))
t_0))))
double code(double x, double y, double z) {
double t_0 = fmax((-30.0 * x), (fabs((sin((30.0 * x)) + (30.0 * y))) - 0.2));
double tmp;
if (y <= -9.5e+39) {
tmp = t_0;
} else if (y <= 15500000000.0) {
tmp = fmax(((30.0 * sqrt(fma(x, x, (z * z)))) - 25.0), (fabs((y * (30.0 + (-4500.0 * pow(y, 2.0))))) - 0.2));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = fmax(Float64(-30.0 * x), Float64(abs(Float64(sin(Float64(30.0 * x)) + Float64(30.0 * y))) - 0.2)) tmp = 0.0 if (y <= -9.5e+39) tmp = t_0; elseif (y <= 15500000000.0) tmp = fmax(Float64(Float64(30.0 * sqrt(fma(x, x, Float64(z * z)))) - 25.0), Float64(abs(Float64(y * Float64(30.0 + Float64(-4500.0 * (y ^ 2.0))))) - 0.2)); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] + N[(30.0 * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -9.5e+39], t$95$0, If[LessEqual[y, 15500000000.0], N[Max[N[(N[(30.0 * N[Sqrt[N[(x * x + N[(z * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(y * N[(30.0 + N[(-4500.0 * N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot x\right) + 30 \cdot y\right| - 0.2\right)\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+39}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 15500000000:\\
\;\;\;\;\mathsf{max}\left(30 \cdot \sqrt{\mathsf{fma}\left(x, x, z \cdot z\right)} - 25, \left|y \cdot \left(30 + -4500 \cdot {y}^{2}\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -9.50000000000000011e39 or 1.55e10 < y Initial program 46.3%
Taylor expanded in z around 0
Applied rewrites45.9%
Taylor expanded in x around 0
Applied rewrites45.7%
Taylor expanded in x around -inf
Applied rewrites17.3%
Taylor expanded in y around 0
Applied rewrites45.6%
if -9.50000000000000011e39 < y < 1.55e10Initial program 46.3%
Taylor expanded in z around 0
Applied rewrites45.9%
Taylor expanded in x around 0
Applied rewrites45.7%
Taylor expanded in y around 0
Applied rewrites35.9%
Taylor expanded in y around 0
Applied rewrites33.9%
(FPCore (x y z)
:precision binary64
(if (<= y -1.22e+41)
(fmax (* -30.0 y) (- (fabs (sin (* z 30.0))) 0.2))
(fmax
(- (* 30.0 (sqrt (fma x x (* z z)))) 25.0)
(- (fabs (* y (+ 30.0 (* -4500.0 (pow y 2.0))))) 0.2))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.22e+41) {
tmp = fmax((-30.0 * y), (fabs(sin((z * 30.0))) - 0.2));
} else {
tmp = fmax(((30.0 * sqrt(fma(x, x, (z * z)))) - 25.0), (fabs((y * (30.0 + (-4500.0 * pow(y, 2.0))))) - 0.2));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= -1.22e+41) tmp = fmax(Float64(-30.0 * y), Float64(abs(sin(Float64(z * 30.0))) - 0.2)); else tmp = fmax(Float64(Float64(30.0 * sqrt(fma(x, x, Float64(z * z)))) - 25.0), Float64(abs(Float64(y * Float64(30.0 + Float64(-4500.0 * (y ^ 2.0))))) - 0.2)); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, -1.22e+41], 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[(N[(30.0 * N[Sqrt[N[(x * x + N[(z * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(y * N[(30.0 + N[(-4500.0 * N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{+41}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot \sqrt{\mathsf{fma}\left(x, x, z \cdot z\right)} - 25, \left|y \cdot \left(30 + -4500 \cdot {y}^{2}\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if y < -1.22e41Initial program 46.3%
Taylor expanded in x around 0
Applied rewrites46.0%
Taylor expanded in y around 0
Applied rewrites45.7%
Taylor expanded in y around -inf
Applied rewrites18.3%
if -1.22e41 < y Initial program 46.3%
Taylor expanded in z around 0
Applied rewrites45.9%
Taylor expanded in x around 0
Applied rewrites45.7%
Taylor expanded in y around 0
Applied rewrites35.9%
Taylor expanded in y around 0
Applied rewrites33.9%
(FPCore (x y z)
:precision binary64
(if (<= y -2.7e+41)
(fmax (* -30.0 y) (- (fabs (sin (* z 30.0))) 0.2))
(fmax
(- (* (+ (/ 25.0 x) 30.0) x))
(- (fabs (* y (+ 30.0 (* -4500.0 (pow y 2.0))))) 0.2))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.7e+41) {
tmp = fmax((-30.0 * y), (fabs(sin((z * 30.0))) - 0.2));
} else {
tmp = fmax(-(((25.0 / x) + 30.0) * x), (fabs((y * (30.0 + (-4500.0 * pow(y, 2.0))))) - 0.2));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-2.7d+41)) then
tmp = fmax(((-30.0d0) * y), (abs(sin((z * 30.0d0))) - 0.2d0))
else
tmp = fmax(-(((25.0d0 / x) + 30.0d0) * x), (abs((y * (30.0d0 + ((-4500.0d0) * (y ** 2.0d0))))) - 0.2d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.7e+41) {
tmp = fmax((-30.0 * y), (Math.abs(Math.sin((z * 30.0))) - 0.2));
} else {
tmp = fmax(-(((25.0 / x) + 30.0) * x), (Math.abs((y * (30.0 + (-4500.0 * Math.pow(y, 2.0))))) - 0.2));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.7e+41: tmp = fmax((-30.0 * y), (math.fabs(math.sin((z * 30.0))) - 0.2)) else: tmp = fmax(-(((25.0 / x) + 30.0) * x), (math.fabs((y * (30.0 + (-4500.0 * math.pow(y, 2.0))))) - 0.2)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.7e+41) tmp = fmax(Float64(-30.0 * y), Float64(abs(sin(Float64(z * 30.0))) - 0.2)); else tmp = fmax(Float64(-Float64(Float64(Float64(25.0 / x) + 30.0) * x)), Float64(abs(Float64(y * Float64(30.0 + Float64(-4500.0 * (y ^ 2.0))))) - 0.2)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.7e+41) tmp = max((-30.0 * y), (abs(sin((z * 30.0))) - 0.2)); else tmp = max(-(((25.0 / x) + 30.0) * x), (abs((y * (30.0 + (-4500.0 * (y ^ 2.0))))) - 0.2)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.7e+41], 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[(N[(N[(25.0 / x), $MachinePrecision] + 30.0), $MachinePrecision] * x), $MachinePrecision]), N[(N[Abs[N[(y * N[(30.0 + N[(-4500.0 * N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+41}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-\left(\frac{25}{x} + 30\right) \cdot x, \left|y \cdot \left(30 + -4500 \cdot {y}^{2}\right)\right| - 0.2\right)\\
\end{array}
\end{array}
if y < -2.7e41Initial program 46.3%
Taylor expanded in x around 0
Applied rewrites46.0%
Taylor expanded in y around 0
Applied rewrites45.7%
Taylor expanded in y around -inf
Applied rewrites18.3%
if -2.7e41 < y Initial program 46.3%
Taylor expanded in z around 0
Applied rewrites45.9%
Taylor expanded in x around 0
Applied rewrites45.7%
Taylor expanded in x around -inf
Applied rewrites28.0%
Taylor expanded in y around 0
Applied rewrites26.2%
(FPCore (x y z) :precision binary64 (fmax (- (* (+ (/ 25.0 x) 30.0) x)) (- (fabs (* y (+ 30.0 (* -4500.0 (pow y 2.0))))) 0.2)))
double code(double x, double y, double z) {
return fmax(-(((25.0 / x) + 30.0) * x), (fabs((y * (30.0 + (-4500.0 * pow(y, 2.0))))) - 0.2));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = fmax(-(((25.0d0 / x) + 30.0d0) * x), (abs((y * (30.0d0 + ((-4500.0d0) * (y ** 2.0d0))))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax(-(((25.0 / x) + 30.0) * x), (Math.abs((y * (30.0 + (-4500.0 * Math.pow(y, 2.0))))) - 0.2));
}
def code(x, y, z): return fmax(-(((25.0 / x) + 30.0) * x), (math.fabs((y * (30.0 + (-4500.0 * math.pow(y, 2.0))))) - 0.2))
function code(x, y, z) return fmax(Float64(-Float64(Float64(Float64(25.0 / x) + 30.0) * x)), Float64(abs(Float64(y * Float64(30.0 + Float64(-4500.0 * (y ^ 2.0))))) - 0.2)) end
function tmp = code(x, y, z) tmp = max(-(((25.0 / x) + 30.0) * x), (abs((y * (30.0 + (-4500.0 * (y ^ 2.0))))) - 0.2)); end
code[x_, y_, z_] := N[Max[(-N[(N[(N[(25.0 / x), $MachinePrecision] + 30.0), $MachinePrecision] * x), $MachinePrecision]), N[(N[Abs[N[(y * N[(30.0 + N[(-4500.0 * N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(-\left(\frac{25}{x} + 30\right) \cdot x, \left|y \cdot \left(30 + -4500 \cdot {y}^{2}\right)\right| - 0.2\right)
\end{array}
Initial program 46.3%
Taylor expanded in z around 0
Applied rewrites45.9%
Taylor expanded in x around 0
Applied rewrites45.7%
Taylor expanded in x around -inf
Applied rewrites28.0%
Taylor expanded in y around 0
Applied rewrites26.2%
(FPCore (x y z) :precision binary64 (fmax (* -30.0 x) (- (fabs (* y (+ 30.0 (* -4500.0 (pow y 2.0))))) 0.2)))
double code(double x, double y, double z) {
return fmax((-30.0 * x), (fabs((y * (30.0 + (-4500.0 * pow(y, 2.0))))) - 0.2));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = fmax(((-30.0d0) * x), (abs((y * (30.0d0 + ((-4500.0d0) * (y ** 2.0d0))))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
return fmax((-30.0 * x), (Math.abs((y * (30.0 + (-4500.0 * Math.pow(y, 2.0))))) - 0.2));
}
def code(x, y, z): return fmax((-30.0 * x), (math.fabs((y * (30.0 + (-4500.0 * math.pow(y, 2.0))))) - 0.2))
function code(x, y, z) return fmax(Float64(-30.0 * x), Float64(abs(Float64(y * Float64(30.0 + Float64(-4500.0 * (y ^ 2.0))))) - 0.2)) end
function tmp = code(x, y, z) tmp = max((-30.0 * x), (abs((y * (30.0 + (-4500.0 * (y ^ 2.0))))) - 0.2)); end
code[x_, y_, z_] := N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(y * N[(30.0 + N[(-4500.0 * N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{max}\left(-30 \cdot x, \left|y \cdot \left(30 + -4500 \cdot {y}^{2}\right)\right| - 0.2\right)
\end{array}
Initial program 46.3%
Taylor expanded in z around 0
Applied rewrites45.9%
Taylor expanded in x around 0
Applied rewrites45.7%
Taylor expanded in x around -inf
Applied rewrites17.3%
Taylor expanded in y around 0
Applied rewrites15.4%
herbie shell --seed 2025141
(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)))