
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x + cos(y)) - (z * sin(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x + cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x + cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x + cos(y)) - (z * sin(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x + cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x + cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x + cos(y)) - (z * sin(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x + cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x + cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}
Initial program 99.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* z (sin y))) (t_1 (- (+ x 1.0) t_0))) (if (<= x -350.0) t_1 (if (<= x 2e-27) (- (cos y) t_0) t_1))))
double code(double x, double y, double z) {
double t_0 = z * sin(y);
double t_1 = (x + 1.0) - t_0;
double tmp;
if (x <= -350.0) {
tmp = t_1;
} else if (x <= 2e-27) {
tmp = cos(y) - t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = z * sin(y)
t_1 = (x + 1.0d0) - t_0
if (x <= (-350.0d0)) then
tmp = t_1
else if (x <= 2d-27) then
tmp = cos(y) - t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * Math.sin(y);
double t_1 = (x + 1.0) - t_0;
double tmp;
if (x <= -350.0) {
tmp = t_1;
} else if (x <= 2e-27) {
tmp = Math.cos(y) - t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.sin(y) t_1 = (x + 1.0) - t_0 tmp = 0 if x <= -350.0: tmp = t_1 elif x <= 2e-27: tmp = math.cos(y) - t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * sin(y)) t_1 = Float64(Float64(x + 1.0) - t_0) tmp = 0.0 if (x <= -350.0) tmp = t_1; elseif (x <= 2e-27) tmp = Float64(cos(y) - t_0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * sin(y); t_1 = (x + 1.0) - t_0; tmp = 0.0; if (x <= -350.0) tmp = t_1; elseif (x <= 2e-27) tmp = cos(y) - t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[x, -350.0], t$95$1, If[LessEqual[x, 2e-27], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
t_1 := \left(x + 1\right) - t\_0\\
\mathbf{if}\;x \leq -350:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-27}:\\
\;\;\;\;\cos y - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -350 or 2.0000000000000001e-27 < x Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if -350 < x < 2.0000000000000001e-27Initial program 99.9%
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (let* ((t_0 (- (+ x 1.0) (* z (sin y))))) (if (<= z -0.68) t_0 (if (<= z 1.95) (+ (cos y) x) t_0))))
double code(double x, double y, double z) {
double t_0 = (x + 1.0) - (z * sin(y));
double tmp;
if (z <= -0.68) {
tmp = t_0;
} else if (z <= 1.95) {
tmp = cos(y) + x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (x + 1.0d0) - (z * sin(y))
if (z <= (-0.68d0)) then
tmp = t_0
else if (z <= 1.95d0) then
tmp = cos(y) + x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x + 1.0) - (z * Math.sin(y));
double tmp;
if (z <= -0.68) {
tmp = t_0;
} else if (z <= 1.95) {
tmp = Math.cos(y) + x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (x + 1.0) - (z * math.sin(y)) tmp = 0 if z <= -0.68: tmp = t_0 elif z <= 1.95: tmp = math.cos(y) + x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(x + 1.0) - Float64(z * sin(y))) tmp = 0.0 if (z <= -0.68) tmp = t_0; elseif (z <= 1.95) tmp = Float64(cos(y) + x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x + 1.0) - (z * sin(y)); tmp = 0.0; if (z <= -0.68) tmp = t_0; elseif (z <= 1.95) tmp = cos(y) + x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + 1.0), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.68], t$95$0, If[LessEqual[z, 1.95], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x + 1\right) - z \cdot \sin y\\
\mathbf{if}\;z \leq -0.68:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.95:\\
\;\;\;\;\cos y + x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.680000000000000049 or 1.94999999999999996 < z Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if -0.680000000000000049 < z < 1.94999999999999996Initial program 100.0%
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (let* ((t_0 (- x (* z (sin y))))) (if (<= z -2.4e+61) t_0 (if (<= z 3.4e+64) (+ (cos y) x) t_0))))
double code(double x, double y, double z) {
double t_0 = x - (z * sin(y));
double tmp;
if (z <= -2.4e+61) {
tmp = t_0;
} else if (z <= 3.4e+64) {
tmp = cos(y) + x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x - (z * sin(y))
if (z <= (-2.4d+61)) then
tmp = t_0
else if (z <= 3.4d+64) then
tmp = cos(y) + x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x - (z * Math.sin(y));
double tmp;
if (z <= -2.4e+61) {
tmp = t_0;
} else if (z <= 3.4e+64) {
tmp = Math.cos(y) + x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x - (z * math.sin(y)) tmp = 0 if z <= -2.4e+61: tmp = t_0 elif z <= 3.4e+64: tmp = math.cos(y) + x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x - Float64(z * sin(y))) tmp = 0.0 if (z <= -2.4e+61) tmp = t_0; elseif (z <= 3.4e+64) tmp = Float64(cos(y) + x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x - (z * sin(y)); tmp = 0.0; if (z <= -2.4e+61) tmp = t_0; elseif (z <= 3.4e+64) tmp = cos(y) + x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+61], t$95$0, If[LessEqual[z, 3.4e+64], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x - z \cdot \sin y\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+61}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+64}:\\
\;\;\;\;\cos y + x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.3999999999999999e61 or 3.4000000000000002e64 < z Initial program 99.8%
Taylor expanded in x around inf 0
Simplified0
if -2.3999999999999999e61 < z < 3.4000000000000002e64Initial program 100.0%
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (let* ((t_0 (- 1.0 (* z (sin y))))) (if (<= z -2.95e+200) t_0 (if (<= z 2.8e+112) (+ (cos y) x) t_0))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (z * sin(y));
double tmp;
if (z <= -2.95e+200) {
tmp = t_0;
} else if (z <= 2.8e+112) {
tmp = cos(y) + x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - (z * sin(y))
if (z <= (-2.95d+200)) then
tmp = t_0
else if (z <= 2.8d+112) then
tmp = cos(y) + x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (z * Math.sin(y));
double tmp;
if (z <= -2.95e+200) {
tmp = t_0;
} else if (z <= 2.8e+112) {
tmp = Math.cos(y) + x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (z * math.sin(y)) tmp = 0 if z <= -2.95e+200: tmp = t_0 elif z <= 2.8e+112: tmp = math.cos(y) + x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(z * sin(y))) tmp = 0.0 if (z <= -2.95e+200) tmp = t_0; elseif (z <= 2.8e+112) tmp = Float64(cos(y) + x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (z * sin(y)); tmp = 0.0; if (z <= -2.95e+200) tmp = t_0; elseif (z <= 2.8e+112) tmp = cos(y) + x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.95e+200], t$95$0, If[LessEqual[z, 2.8e+112], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - z \cdot \sin y\\
\mathbf{if}\;z \leq -2.95 \cdot 10^{+200}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+112}:\\
\;\;\;\;\cos y + x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.9500000000000001e200 or 2.8000000000000001e112 < z Initial program 99.8%
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
if -2.9500000000000001e200 < z < 2.8000000000000001e112Initial program 100.0%
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (let* ((t_0 (* z (- (sin y))))) (if (<= z -3.5e+200) t_0 (if (<= z 4.7e+197) (+ (cos y) x) t_0))))
double code(double x, double y, double z) {
double t_0 = z * -sin(y);
double tmp;
if (z <= -3.5e+200) {
tmp = t_0;
} else if (z <= 4.7e+197) {
tmp = cos(y) + x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * -sin(y)
if (z <= (-3.5d+200)) then
tmp = t_0
else if (z <= 4.7d+197) then
tmp = cos(y) + x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * -Math.sin(y);
double tmp;
if (z <= -3.5e+200) {
tmp = t_0;
} else if (z <= 4.7e+197) {
tmp = Math.cos(y) + x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * -math.sin(y) tmp = 0 if z <= -3.5e+200: tmp = t_0 elif z <= 4.7e+197: tmp = math.cos(y) + x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-sin(y))) tmp = 0.0 if (z <= -3.5e+200) tmp = t_0; elseif (z <= 4.7e+197) tmp = Float64(cos(y) + x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * -sin(y); tmp = 0.0; if (z <= -3.5e+200) tmp = t_0; elseif (z <= 4.7e+197) tmp = cos(y) + x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * (-N[Sin[y], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[z, -3.5e+200], t$95$0, If[LessEqual[z, 4.7e+197], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(-\sin y\right)\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+200}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{+197}:\\
\;\;\;\;\cos y + x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.50000000000000006e200 or 4.6999999999999999e197 < z Initial program 99.8%
Applied egg-rr0
Taylor expanded in z around inf 0
Simplified0
if -3.50000000000000006e200 < z < 4.6999999999999999e197Initial program 100.0%
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (cos y) x)))
(if (<= y -80.0)
t_0
(if (<= y 0.038)
(+ x (+ 1.0 (* y (- (* y (+ -0.5 (* z (* y 0.16666666666666666)))) z))))
t_0))))
double code(double x, double y, double z) {
double t_0 = cos(y) + x;
double tmp;
if (y <= -80.0) {
tmp = t_0;
} else if (y <= 0.038) {
tmp = x + (1.0 + (y * ((y * (-0.5 + (z * (y * 0.16666666666666666)))) - z)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = cos(y) + x
if (y <= (-80.0d0)) then
tmp = t_0
else if (y <= 0.038d0) then
tmp = x + (1.0d0 + (y * ((y * ((-0.5d0) + (z * (y * 0.16666666666666666d0)))) - z)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.cos(y) + x;
double tmp;
if (y <= -80.0) {
tmp = t_0;
} else if (y <= 0.038) {
tmp = x + (1.0 + (y * ((y * (-0.5 + (z * (y * 0.16666666666666666)))) - z)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = math.cos(y) + x tmp = 0 if y <= -80.0: tmp = t_0 elif y <= 0.038: tmp = x + (1.0 + (y * ((y * (-0.5 + (z * (y * 0.16666666666666666)))) - z))) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(cos(y) + x) tmp = 0.0 if (y <= -80.0) tmp = t_0; elseif (y <= 0.038) tmp = Float64(x + Float64(1.0 + Float64(y * Float64(Float64(y * Float64(-0.5 + Float64(z * Float64(y * 0.16666666666666666)))) - z)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = cos(y) + x; tmp = 0.0; if (y <= -80.0) tmp = t_0; elseif (y <= 0.038) tmp = x + (1.0 + (y * ((y * (-0.5 + (z * (y * 0.16666666666666666)))) - z))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -80.0], t$95$0, If[LessEqual[y, 0.038], N[(x + N[(1.0 + N[(y * N[(N[(y * N[(-0.5 + N[(z * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos y + x\\
\mathbf{if}\;y \leq -80:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 0.038:\\
\;\;\;\;x + \left(1 + y \cdot \left(y \cdot \left(-0.5 + z \cdot \left(y \cdot 0.16666666666666666\right)\right) - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -80 or 0.0379999999999999991 < y Initial program 99.9%
Taylor expanded in z around 0 0
Simplified0
if -80 < y < 0.0379999999999999991Initial program 100.0%
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= x -1.46e-9) (+ 1.0 x) (if (<= x 6.8e-13) (cos y) (+ 1.0 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.46e-9) {
tmp = 1.0 + x;
} else if (x <= 6.8e-13) {
tmp = cos(y);
} else {
tmp = 1.0 + x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.46d-9)) then
tmp = 1.0d0 + x
else if (x <= 6.8d-13) then
tmp = cos(y)
else
tmp = 1.0d0 + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.46e-9) {
tmp = 1.0 + x;
} else if (x <= 6.8e-13) {
tmp = Math.cos(y);
} else {
tmp = 1.0 + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.46e-9: tmp = 1.0 + x elif x <= 6.8e-13: tmp = math.cos(y) else: tmp = 1.0 + x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.46e-9) tmp = Float64(1.0 + x); elseif (x <= 6.8e-13) tmp = cos(y); else tmp = Float64(1.0 + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.46e-9) tmp = 1.0 + x; elseif (x <= 6.8e-13) tmp = cos(y); else tmp = 1.0 + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.46e-9], N[(1.0 + x), $MachinePrecision], If[LessEqual[x, 6.8e-13], N[Cos[y], $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.46 \cdot 10^{-9}:\\
\;\;\;\;1 + x\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-13}:\\
\;\;\;\;\cos y\\
\mathbf{else}:\\
\;\;\;\;1 + x\\
\end{array}
\end{array}
if x < -1.4599999999999999e-9 or 6.80000000000000031e-13 < x Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if -1.4599999999999999e-9 < x < 6.80000000000000031e-13Initial program 99.9%
Taylor expanded in z around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y z)
:precision binary64
(if (<= y -6.4e+14)
(+ 1.0 x)
(if (<= y 0.04)
(+ x (+ 1.0 (* y (- (* y (+ -0.5 (* z (* y 0.16666666666666666)))) z))))
(+ 1.0 x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -6.4e+14) {
tmp = 1.0 + x;
} else if (y <= 0.04) {
tmp = x + (1.0 + (y * ((y * (-0.5 + (z * (y * 0.16666666666666666)))) - z)));
} else {
tmp = 1.0 + x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-6.4d+14)) then
tmp = 1.0d0 + x
else if (y <= 0.04d0) then
tmp = x + (1.0d0 + (y * ((y * ((-0.5d0) + (z * (y * 0.16666666666666666d0)))) - z)))
else
tmp = 1.0d0 + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -6.4e+14) {
tmp = 1.0 + x;
} else if (y <= 0.04) {
tmp = x + (1.0 + (y * ((y * (-0.5 + (z * (y * 0.16666666666666666)))) - z)));
} else {
tmp = 1.0 + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -6.4e+14: tmp = 1.0 + x elif y <= 0.04: tmp = x + (1.0 + (y * ((y * (-0.5 + (z * (y * 0.16666666666666666)))) - z))) else: tmp = 1.0 + x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -6.4e+14) tmp = Float64(1.0 + x); elseif (y <= 0.04) tmp = Float64(x + Float64(1.0 + Float64(y * Float64(Float64(y * Float64(-0.5 + Float64(z * Float64(y * 0.16666666666666666)))) - z)))); else tmp = Float64(1.0 + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -6.4e+14) tmp = 1.0 + x; elseif (y <= 0.04) tmp = x + (1.0 + (y * ((y * (-0.5 + (z * (y * 0.16666666666666666)))) - z))); else tmp = 1.0 + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -6.4e+14], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 0.04], N[(x + N[(1.0 + N[(y * N[(N[(y * N[(-0.5 + N[(z * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{+14}:\\
\;\;\;\;1 + x\\
\mathbf{elif}\;y \leq 0.04:\\
\;\;\;\;x + \left(1 + y \cdot \left(y \cdot \left(-0.5 + z \cdot \left(y \cdot 0.16666666666666666\right)\right) - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x\\
\end{array}
\end{array}
if y < -6.4e14 or 0.0400000000000000008 < y Initial program 99.8%
Taylor expanded in y around 0 0
Simplified0
if -6.4e14 < y < 0.0400000000000000008Initial program 100.0%
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= x -2.9e-87) (+ 1.0 x) (if (<= x 2e-11) (- 1.0 (* y z)) (+ 1.0 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.9e-87) {
tmp = 1.0 + x;
} else if (x <= 2e-11) {
tmp = 1.0 - (y * z);
} else {
tmp = 1.0 + x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.9d-87)) then
tmp = 1.0d0 + x
else if (x <= 2d-11) then
tmp = 1.0d0 - (y * z)
else
tmp = 1.0d0 + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.9e-87) {
tmp = 1.0 + x;
} else if (x <= 2e-11) {
tmp = 1.0 - (y * z);
} else {
tmp = 1.0 + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.9e-87: tmp = 1.0 + x elif x <= 2e-11: tmp = 1.0 - (y * z) else: tmp = 1.0 + x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.9e-87) tmp = Float64(1.0 + x); elseif (x <= 2e-11) tmp = Float64(1.0 - Float64(y * z)); else tmp = Float64(1.0 + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.9e-87) tmp = 1.0 + x; elseif (x <= 2e-11) tmp = 1.0 - (y * z); else tmp = 1.0 + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.9e-87], N[(1.0 + x), $MachinePrecision], If[LessEqual[x, 2e-11], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{-87}:\\
\;\;\;\;1 + x\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-11}:\\
\;\;\;\;1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;1 + x\\
\end{array}
\end{array}
if x < -2.8999999999999999e-87 or 1.99999999999999988e-11 < x Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if -2.8999999999999999e-87 < x < 1.99999999999999988e-11Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= y 165.0) (+ 1.0 (- x (* z y))) (+ 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (y <= 165.0) {
tmp = 1.0 + (x - (z * y));
} else {
tmp = 1.0 + x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= 165.0d0) then
tmp = 1.0d0 + (x - (z * y))
else
tmp = 1.0d0 + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 165.0) {
tmp = 1.0 + (x - (z * y));
} else {
tmp = 1.0 + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 165.0: tmp = 1.0 + (x - (z * y)) else: tmp = 1.0 + x return tmp
function code(x, y, z) tmp = 0.0 if (y <= 165.0) tmp = Float64(1.0 + Float64(x - Float64(z * y))); else tmp = Float64(1.0 + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 165.0) tmp = 1.0 + (x - (z * y)); else tmp = 1.0 + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 165.0], N[(1.0 + N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 165:\\
\;\;\;\;1 + \left(x - z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x\\
\end{array}
\end{array}
if y < 165Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if 165 < y Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= x -1.0) x (if (<= x 1.9) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.0) {
tmp = x;
} else if (x <= 1.9) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = x
else if (x <= 1.9d0) then
tmp = 1.0d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.0) {
tmp = x;
} else if (x <= 1.9) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.0: tmp = x elif x <= 1.9: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.0) tmp = x; elseif (x <= 1.9) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.0) tmp = x; elseif (x <= 1.9) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.0], x, If[LessEqual[x, 1.9], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.9:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1 or 1.8999999999999999 < x Initial program 99.9%
Taylor expanded in x around inf 0
Simplified0
if -1 < x < 1.8999999999999999Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (+ 1.0 x))
double code(double x, double y, double z) {
return 1.0 + x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 + x
end function
public static double code(double x, double y, double z) {
return 1.0 + x;
}
def code(x, y, z): return 1.0 + x
function code(x, y, z) return Float64(1.0 + x) end
function tmp = code(x, y, z) tmp = 1.0 + x; end
code[x_, y_, z_] := N[(1.0 + x), $MachinePrecision]
\begin{array}{l}
\\
1 + x
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z) :precision binary64 1.0)
double code(double x, double y, double z) {
return 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0
end function
public static double code(double x, double y, double z) {
return 1.0;
}
def code(x, y, z): return 1.0
function code(x, y, z) return 1.0 end
function tmp = code(x, y, z) tmp = 1.0; end
code[x_, y_, z_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
herbie shell --seed 2024110
(FPCore (x y z)
:name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, B"
:precision binary64
(- (+ x (cos y)) (* z (sin y))))