
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
return (x + sin(y)) + (z * cos(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 + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z): return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z) return Float64(Float64(x + sin(y)) + Float64(z * cos(y))) end
function tmp = code(x, y, z) tmp = (x + sin(y)) + (z * cos(y)); end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
return (x + sin(y)) + (z * cos(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 + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z): return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z) return Float64(Float64(x + sin(y)) + Float64(z * cos(y))) end
function tmp = code(x, y, z) tmp = (x + sin(y)) + (z * cos(y)); end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
return (x + sin(y)) + (z * cos(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 + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z): return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z) return Float64(Float64(x + sin(y)) + Float64(z * cos(y))) end
function tmp = code(x, y, z) tmp = (x + sin(y)) + (z * cos(y)); end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}
Initial program 99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -3.1e+161)
t_0
(if (<= z -2.4e+25)
(+ z x)
(if (<= z -4.8e-21) t_0 (if (<= z 1.2e+17) (+ (sin y) x) t_0))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -3.1e+161) {
tmp = t_0;
} else if (z <= -2.4e+25) {
tmp = z + x;
} else if (z <= -4.8e-21) {
tmp = t_0;
} else if (z <= 1.2e+17) {
tmp = sin(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 * cos(y)
if (z <= (-3.1d+161)) then
tmp = t_0
else if (z <= (-2.4d+25)) then
tmp = z + x
else if (z <= (-4.8d-21)) then
tmp = t_0
else if (z <= 1.2d+17) then
tmp = sin(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.cos(y);
double tmp;
if (z <= -3.1e+161) {
tmp = t_0;
} else if (z <= -2.4e+25) {
tmp = z + x;
} else if (z <= -4.8e-21) {
tmp = t_0;
} else if (z <= 1.2e+17) {
tmp = Math.sin(y) + x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -3.1e+161: tmp = t_0 elif z <= -2.4e+25: tmp = z + x elif z <= -4.8e-21: tmp = t_0 elif z <= 1.2e+17: tmp = math.sin(y) + x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -3.1e+161) tmp = t_0; elseif (z <= -2.4e+25) tmp = Float64(z + x); elseif (z <= -4.8e-21) tmp = t_0; elseif (z <= 1.2e+17) tmp = Float64(sin(y) + x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if (z <= -3.1e+161) tmp = t_0; elseif (z <= -2.4e+25) tmp = z + x; elseif (z <= -4.8e-21) tmp = t_0; elseif (z <= 1.2e+17) tmp = sin(y) + x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+161], t$95$0, If[LessEqual[z, -2.4e+25], N[(z + x), $MachinePrecision], If[LessEqual[z, -4.8e-21], t$95$0, If[LessEqual[z, 1.2e+17], N[(N[Sin[y], $MachinePrecision] + x), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+161}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{+25}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-21}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+17}:\\
\;\;\;\;\sin y + x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.10000000000000007e161 or -2.39999999999999996e25 < z < -4.7999999999999999e-21 or 1.2e17 < z Initial program 99.8%
Taylor expanded in z around inf 0
Simplified0
if -3.10000000000000007e161 < z < -2.39999999999999996e25Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if -4.7999999999999999e-21 < z < 1.2e17Initial program 100.0%
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -1.8e+161)
t_0
(if (<= z -9e-236)
(+ z x)
(if (<= z 2.45e-136) (+ z (+ y x)) (if (<= z 5.8e+196) (+ z x) t_0))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -1.8e+161) {
tmp = t_0;
} else if (z <= -9e-236) {
tmp = z + x;
} else if (z <= 2.45e-136) {
tmp = z + (y + x);
} else if (z <= 5.8e+196) {
tmp = z + 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 * cos(y)
if (z <= (-1.8d+161)) then
tmp = t_0
else if (z <= (-9d-236)) then
tmp = z + x
else if (z <= 2.45d-136) then
tmp = z + (y + x)
else if (z <= 5.8d+196) then
tmp = z + 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.cos(y);
double tmp;
if (z <= -1.8e+161) {
tmp = t_0;
} else if (z <= -9e-236) {
tmp = z + x;
} else if (z <= 2.45e-136) {
tmp = z + (y + x);
} else if (z <= 5.8e+196) {
tmp = z + x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -1.8e+161: tmp = t_0 elif z <= -9e-236: tmp = z + x elif z <= 2.45e-136: tmp = z + (y + x) elif z <= 5.8e+196: tmp = z + x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -1.8e+161) tmp = t_0; elseif (z <= -9e-236) tmp = Float64(z + x); elseif (z <= 2.45e-136) tmp = Float64(z + Float64(y + x)); elseif (z <= 5.8e+196) tmp = Float64(z + x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if (z <= -1.8e+161) tmp = t_0; elseif (z <= -9e-236) tmp = z + x; elseif (z <= 2.45e-136) tmp = z + (y + x); elseif (z <= 5.8e+196) tmp = z + x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+161], t$95$0, If[LessEqual[z, -9e-236], N[(z + x), $MachinePrecision], If[LessEqual[z, 2.45e-136], N[(z + N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+196], N[(z + x), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+161}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-236}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-136}:\\
\;\;\;\;z + \left(y + x\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+196}:\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.79999999999999992e161 or 5.8e196 < z Initial program 99.9%
Taylor expanded in z around inf 0
Simplified0
if -1.79999999999999992e161 < z < -8.99999999999999997e-236 or 2.45e-136 < z < 5.8e196Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if -8.99999999999999997e-236 < z < 2.45e-136Initial program 100.0%
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (* z (cos y))))) (if (<= z -1.15e-24) t_0 (if (<= z 0.017) (+ (sin y) x) t_0))))
double code(double x, double y, double z) {
double t_0 = x + (z * cos(y));
double tmp;
if (z <= -1.15e-24) {
tmp = t_0;
} else if (z <= 0.017) {
tmp = sin(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 * cos(y))
if (z <= (-1.15d-24)) then
tmp = t_0
else if (z <= 0.017d0) then
tmp = sin(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.cos(y));
double tmp;
if (z <= -1.15e-24) {
tmp = t_0;
} else if (z <= 0.017) {
tmp = Math.sin(y) + x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (z * math.cos(y)) tmp = 0 if z <= -1.15e-24: tmp = t_0 elif z <= 0.017: tmp = math.sin(y) + x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(z * cos(y))) tmp = 0.0 if (z <= -1.15e-24) tmp = t_0; elseif (z <= 0.017) tmp = Float64(sin(y) + x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (z * cos(y)); tmp = 0.0; if (z <= -1.15e-24) tmp = t_0; elseif (z <= 0.017) tmp = sin(y) + x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e-24], t$95$0, If[LessEqual[z, 0.017], N[(N[Sin[y], $MachinePrecision] + x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + z \cdot \cos y\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-24}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.017:\\
\;\;\;\;\sin y + x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.1500000000000001e-24 or 0.017000000000000001 < z Initial program 99.9%
Taylor expanded in x around inf 0
Simplified0
if -1.1500000000000001e-24 < z < 0.017000000000000001Initial program 100.0%
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z)
:precision binary64
(if (<= y -1.2e+236)
(sin y)
(if (<= y -2.4e+32)
(+ z x)
(if (<= y 1800000000000.0)
(+ (+ x (+ y z)) (* (+ (* y -0.16666666666666666) (* z -0.5)) (* y y)))
(+ z x)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.2e+236) {
tmp = sin(y);
} else if (y <= -2.4e+32) {
tmp = z + x;
} else if (y <= 1800000000000.0) {
tmp = (x + (y + z)) + (((y * -0.16666666666666666) + (z * -0.5)) * (y * y));
} else {
tmp = z + 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 <= (-1.2d+236)) then
tmp = sin(y)
else if (y <= (-2.4d+32)) then
tmp = z + x
else if (y <= 1800000000000.0d0) then
tmp = (x + (y + z)) + (((y * (-0.16666666666666666d0)) + (z * (-0.5d0))) * (y * y))
else
tmp = z + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.2e+236) {
tmp = Math.sin(y);
} else if (y <= -2.4e+32) {
tmp = z + x;
} else if (y <= 1800000000000.0) {
tmp = (x + (y + z)) + (((y * -0.16666666666666666) + (z * -0.5)) * (y * y));
} else {
tmp = z + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.2e+236: tmp = math.sin(y) elif y <= -2.4e+32: tmp = z + x elif y <= 1800000000000.0: tmp = (x + (y + z)) + (((y * -0.16666666666666666) + (z * -0.5)) * (y * y)) else: tmp = z + x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.2e+236) tmp = sin(y); elseif (y <= -2.4e+32) tmp = Float64(z + x); elseif (y <= 1800000000000.0) tmp = Float64(Float64(x + Float64(y + z)) + Float64(Float64(Float64(y * -0.16666666666666666) + Float64(z * -0.5)) * Float64(y * y))); else tmp = Float64(z + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.2e+236) tmp = sin(y); elseif (y <= -2.4e+32) tmp = z + x; elseif (y <= 1800000000000.0) tmp = (x + (y + z)) + (((y * -0.16666666666666666) + (z * -0.5)) * (y * y)); else tmp = z + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.2e+236], N[Sin[y], $MachinePrecision], If[LessEqual[y, -2.4e+32], N[(z + x), $MachinePrecision], If[LessEqual[y, 1800000000000.0], N[(N[(x + N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y * -0.16666666666666666), $MachinePrecision] + N[(z * -0.5), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+236}:\\
\;\;\;\;\sin y\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{+32}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 1800000000000:\\
\;\;\;\;\left(x + \left(y + z\right)\right) + \left(y \cdot -0.16666666666666666 + z \cdot -0.5\right) \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if y < -1.20000000000000006e236Initial program 99.8%
Taylor expanded in z around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
if -1.20000000000000006e236 < y < -2.39999999999999991e32 or 1.8e12 < y Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if -2.39999999999999991e32 < y < 1.8e12Initial program 100.0%
Taylor expanded in y around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z)
:precision binary64
(if (<= y -2.8e+31)
(+ z x)
(if (<= y 10000000.0)
(+ (+ x (+ y z)) (* (+ (* y -0.16666666666666666) (* z -0.5)) (* y y)))
(+ z x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.8e+31) {
tmp = z + x;
} else if (y <= 10000000.0) {
tmp = (x + (y + z)) + (((y * -0.16666666666666666) + (z * -0.5)) * (y * y));
} else {
tmp = z + 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 <= (-2.8d+31)) then
tmp = z + x
else if (y <= 10000000.0d0) then
tmp = (x + (y + z)) + (((y * (-0.16666666666666666d0)) + (z * (-0.5d0))) * (y * y))
else
tmp = z + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.8e+31) {
tmp = z + x;
} else if (y <= 10000000.0) {
tmp = (x + (y + z)) + (((y * -0.16666666666666666) + (z * -0.5)) * (y * y));
} else {
tmp = z + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.8e+31: tmp = z + x elif y <= 10000000.0: tmp = (x + (y + z)) + (((y * -0.16666666666666666) + (z * -0.5)) * (y * y)) else: tmp = z + x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.8e+31) tmp = Float64(z + x); elseif (y <= 10000000.0) tmp = Float64(Float64(x + Float64(y + z)) + Float64(Float64(Float64(y * -0.16666666666666666) + Float64(z * -0.5)) * Float64(y * y))); else tmp = Float64(z + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.8e+31) tmp = z + x; elseif (y <= 10000000.0) tmp = (x + (y + z)) + (((y * -0.16666666666666666) + (z * -0.5)) * (y * y)); else tmp = z + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.8e+31], N[(z + x), $MachinePrecision], If[LessEqual[y, 10000000.0], N[(N[(x + N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y * -0.16666666666666666), $MachinePrecision] + N[(z * -0.5), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+31}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 10000000:\\
\;\;\;\;\left(x + \left(y + z\right)\right) + \left(y \cdot -0.16666666666666666 + z \cdot -0.5\right) \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if y < -2.80000000000000017e31 or 1e7 < y Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if -2.80000000000000017e31 < y < 1e7Initial program 100.0%
Taylor expanded in y around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z)
:precision binary64
(if (<= y -2.8e+31)
(+ z x)
(if (<= y 4600000.0)
(+ x (+ z (* y (+ 1.0 (* y (+ (* z -0.5) (* y -0.16666666666666666)))))))
(+ z x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.8e+31) {
tmp = z + x;
} else if (y <= 4600000.0) {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))));
} else {
tmp = z + 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 <= (-2.8d+31)) then
tmp = z + x
else if (y <= 4600000.0d0) then
tmp = x + (z + (y * (1.0d0 + (y * ((z * (-0.5d0)) + (y * (-0.16666666666666666d0)))))))
else
tmp = z + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.8e+31) {
tmp = z + x;
} else if (y <= 4600000.0) {
tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))));
} else {
tmp = z + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.8e+31: tmp = z + x elif y <= 4600000.0: tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))))) else: tmp = z + x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.8e+31) tmp = Float64(z + x); elseif (y <= 4600000.0) tmp = Float64(x + Float64(z + Float64(y * Float64(1.0 + Float64(y * Float64(Float64(z * -0.5) + Float64(y * -0.16666666666666666))))))); else tmp = Float64(z + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.8e+31) tmp = z + x; elseif (y <= 4600000.0) tmp = x + (z + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))))); else tmp = z + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.8e+31], N[(z + x), $MachinePrecision], If[LessEqual[y, 4600000.0], N[(x + N[(z + N[(y * N[(1.0 + N[(y * N[(N[(z * -0.5), $MachinePrecision] + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+31}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 4600000:\\
\;\;\;\;x + \left(z + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if y < -2.80000000000000017e31 or 4.6e6 < y Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if -2.80000000000000017e31 < y < 4.6e6Initial program 100.0%
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z)
:precision binary64
(if (<= y -3.4e+40)
(+ z x)
(if (<= y 260000000000.0)
(+ y (+ x (* z (+ 1.0 (* -0.5 (* y y))))))
(+ z x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.4e+40) {
tmp = z + x;
} else if (y <= 260000000000.0) {
tmp = y + (x + (z * (1.0 + (-0.5 * (y * y)))));
} else {
tmp = z + 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 <= (-3.4d+40)) then
tmp = z + x
else if (y <= 260000000000.0d0) then
tmp = y + (x + (z * (1.0d0 + ((-0.5d0) * (y * y)))))
else
tmp = z + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.4e+40) {
tmp = z + x;
} else if (y <= 260000000000.0) {
tmp = y + (x + (z * (1.0 + (-0.5 * (y * y)))));
} else {
tmp = z + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.4e+40: tmp = z + x elif y <= 260000000000.0: tmp = y + (x + (z * (1.0 + (-0.5 * (y * y))))) else: tmp = z + x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.4e+40) tmp = Float64(z + x); elseif (y <= 260000000000.0) tmp = Float64(y + Float64(x + Float64(z * Float64(1.0 + Float64(-0.5 * Float64(y * y)))))); else tmp = Float64(z + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.4e+40) tmp = z + x; elseif (y <= 260000000000.0) tmp = y + (x + (z * (1.0 + (-0.5 * (y * y))))); else tmp = z + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.4e+40], N[(z + x), $MachinePrecision], If[LessEqual[y, 260000000000.0], N[(y + N[(x + N[(z * N[(1.0 + N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+40}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 260000000000:\\
\;\;\;\;y + \left(x + z \cdot \left(1 + -0.5 \cdot \left(y \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if y < -3.39999999999999989e40 or 2.6e11 < y Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if -3.39999999999999989e40 < y < 2.6e11Initial program 100.0%
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z)
:precision binary64
(if (<= y -7.8e+31)
(+ z x)
(if (<= y 62.0)
(+ x (+ z (* y (+ 1.0 (* y (* y -0.16666666666666666))))))
(+ z x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7.8e+31) {
tmp = z + x;
} else if (y <= 62.0) {
tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666)))));
} else {
tmp = z + 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 <= (-7.8d+31)) then
tmp = z + x
else if (y <= 62.0d0) then
tmp = x + (z + (y * (1.0d0 + (y * (y * (-0.16666666666666666d0))))))
else
tmp = z + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7.8e+31) {
tmp = z + x;
} else if (y <= 62.0) {
tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666)))));
} else {
tmp = z + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7.8e+31: tmp = z + x elif y <= 62.0: tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666))))) else: tmp = z + x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7.8e+31) tmp = Float64(z + x); elseif (y <= 62.0) tmp = Float64(x + Float64(z + Float64(y * Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666)))))); else tmp = Float64(z + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7.8e+31) tmp = z + x; elseif (y <= 62.0) tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666))))); else tmp = z + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7.8e+31], N[(z + x), $MachinePrecision], If[LessEqual[y, 62.0], N[(x + N[(z + N[(y * N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{+31}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 62:\\
\;\;\;\;x + \left(z + y \cdot \left(1 + y \cdot \left(y \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if y < -7.79999999999999999e31 or 62 < y Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if -7.79999999999999999e31 < y < 62Initial program 100.0%
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= x -4.9e-52) x (if (<= x 3.2e-179) z (if (<= x 8.2e-90) (+ y x) (if (<= x 0.44) z x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.9e-52) {
tmp = x;
} else if (x <= 3.2e-179) {
tmp = z;
} else if (x <= 8.2e-90) {
tmp = y + x;
} else if (x <= 0.44) {
tmp = z;
} 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 <= (-4.9d-52)) then
tmp = x
else if (x <= 3.2d-179) then
tmp = z
else if (x <= 8.2d-90) then
tmp = y + x
else if (x <= 0.44d0) then
tmp = z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.9e-52) {
tmp = x;
} else if (x <= 3.2e-179) {
tmp = z;
} else if (x <= 8.2e-90) {
tmp = y + x;
} else if (x <= 0.44) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.9e-52: tmp = x elif x <= 3.2e-179: tmp = z elif x <= 8.2e-90: tmp = y + x elif x <= 0.44: tmp = z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.9e-52) tmp = x; elseif (x <= 3.2e-179) tmp = z; elseif (x <= 8.2e-90) tmp = Float64(y + x); elseif (x <= 0.44) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.9e-52) tmp = x; elseif (x <= 3.2e-179) tmp = z; elseif (x <= 8.2e-90) tmp = y + x; elseif (x <= 0.44) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.9e-52], x, If[LessEqual[x, 3.2e-179], z, If[LessEqual[x, 8.2e-90], N[(y + x), $MachinePrecision], If[LessEqual[x, 0.44], z, x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.9 \cdot 10^{-52}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-179}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-90}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;x \leq 0.44:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.90000000000000019e-52 or 0.440000000000000002 < x Initial program 99.9%
Taylor expanded in x around inf 0
Simplified0
if -4.90000000000000019e-52 < x < 3.2000000000000001e-179 or 8.2000000000000007e-90 < x < 0.440000000000000002Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in z around inf 0
Simplified0
if 3.2000000000000001e-179 < x < 8.2000000000000007e-90Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= y -60.0) (+ z x) (if (<= y 8.2e-14) (+ z (+ y x)) (+ z x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -60.0) {
tmp = z + x;
} else if (y <= 8.2e-14) {
tmp = z + (y + x);
} else {
tmp = z + 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 <= (-60.0d0)) then
tmp = z + x
else if (y <= 8.2d-14) then
tmp = z + (y + x)
else
tmp = z + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -60.0) {
tmp = z + x;
} else if (y <= 8.2e-14) {
tmp = z + (y + x);
} else {
tmp = z + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -60.0: tmp = z + x elif y <= 8.2e-14: tmp = z + (y + x) else: tmp = z + x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -60.0) tmp = Float64(z + x); elseif (y <= 8.2e-14) tmp = Float64(z + Float64(y + x)); else tmp = Float64(z + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -60.0) tmp = z + x; elseif (y <= 8.2e-14) tmp = z + (y + x); else tmp = z + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -60.0], N[(z + x), $MachinePrecision], If[LessEqual[y, 8.2e-14], N[(z + N[(y + x), $MachinePrecision]), $MachinePrecision], N[(z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -60:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-14}:\\
\;\;\;\;z + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if y < -60 or 8.2000000000000004e-14 < y Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if -60 < y < 8.2000000000000004e-14Initial program 100.0%
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= x -4e-139) (+ z x) (if (<= x 4.5e-93) (+ z y) (+ z x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4e-139) {
tmp = z + x;
} else if (x <= 4.5e-93) {
tmp = z + y;
} else {
tmp = z + 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 <= (-4d-139)) then
tmp = z + x
else if (x <= 4.5d-93) then
tmp = z + y
else
tmp = z + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4e-139) {
tmp = z + x;
} else if (x <= 4.5e-93) {
tmp = z + y;
} else {
tmp = z + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4e-139: tmp = z + x elif x <= 4.5e-93: tmp = z + y else: tmp = z + x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4e-139) tmp = Float64(z + x); elseif (x <= 4.5e-93) tmp = Float64(z + y); else tmp = Float64(z + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4e-139) tmp = z + x; elseif (x <= 4.5e-93) tmp = z + y; else tmp = z + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4e-139], N[(z + x), $MachinePrecision], If[LessEqual[x, 4.5e-93], N[(z + y), $MachinePrecision], N[(z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-139}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-93}:\\
\;\;\;\;z + y\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if x < -4.00000000000000012e-139 or 4.5000000000000002e-93 < x Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
if -4.00000000000000012e-139 < x < 4.5000000000000002e-93Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= x -3.2e-52) x (if (<= x 0.29) z x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.2e-52) {
tmp = x;
} else if (x <= 0.29) {
tmp = z;
} 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 <= (-3.2d-52)) then
tmp = x
else if (x <= 0.29d0) then
tmp = z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.2e-52) {
tmp = x;
} else if (x <= 0.29) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.2e-52: tmp = x elif x <= 0.29: tmp = z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.2e-52) tmp = x; elseif (x <= 0.29) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.2e-52) tmp = x; elseif (x <= 0.29) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.2e-52], x, If[LessEqual[x, 0.29], z, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-52}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 0.29:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.2000000000000001e-52 or 0.28999999999999998 < x Initial program 99.9%
Taylor expanded in x around inf 0
Simplified0
if -3.2000000000000001e-52 < x < 0.28999999999999998Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= x -4.4e-134) x (if (<= x 6e-93) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.4e-134) {
tmp = x;
} else if (x <= 6e-93) {
tmp = y;
} 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 <= (-4.4d-134)) then
tmp = x
else if (x <= 6d-93) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.4e-134) {
tmp = x;
} else if (x <= 6e-93) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.4e-134: tmp = x elif x <= 6e-93: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.4e-134) tmp = x; elseif (x <= 6e-93) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.4e-134) tmp = x; elseif (x <= 6e-93) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.4e-134], x, If[LessEqual[x, 6e-93], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{-134}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-93}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.3999999999999999e-134 or 6.0000000000000003e-93 < x Initial program 99.9%
Taylor expanded in x around inf 0
Simplified0
if -4.3999999999999999e-134 < x < 6.0000000000000003e-93Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (+ z x))
double code(double x, double y, double z) {
return z + x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = z + x
end function
public static double code(double x, double y, double z) {
return z + x;
}
def code(x, y, z): return z + x
function code(x, y, z) return Float64(z + x) end
function tmp = code(x, y, z) tmp = z + x; end
code[x_, y_, z_] := N[(z + x), $MachinePrecision]
\begin{array}{l}
\\
z + x
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
Taylor expanded in x around inf 0
Simplified0
herbie shell --seed 2024110
(FPCore (x y z)
:name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C"
:precision binary64
(+ (+ x (sin y)) (* z (cos y))))