
(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 11 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 (fma z (cos y) (+ x (sin y))))
double code(double x, double y, double z) {
return fma(z, cos(y), (x + sin(y)));
}
function code(x, y, z) return fma(z, cos(y), Float64(x + sin(y))) end
code[x_, y_, z_] := N[(z * N[Cos[y], $MachinePrecision] + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, \cos y, x + \sin y\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Final simplification99.9%
(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%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -1.15e+138)
t_0
(if (<= z -1.25e-190)
(+ z x)
(if (<= z 8.2e-282) (+ y (+ z x)) (if (<= z 8e+35) (+ z x) t_0))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -1.15e+138) {
tmp = t_0;
} else if (z <= -1.25e-190) {
tmp = z + x;
} else if (z <= 8.2e-282) {
tmp = y + (z + x);
} else if (z <= 8e+35) {
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.15d+138)) then
tmp = t_0
else if (z <= (-1.25d-190)) then
tmp = z + x
else if (z <= 8.2d-282) then
tmp = y + (z + x)
else if (z <= 8d+35) 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.15e+138) {
tmp = t_0;
} else if (z <= -1.25e-190) {
tmp = z + x;
} else if (z <= 8.2e-282) {
tmp = y + (z + x);
} else if (z <= 8e+35) {
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.15e+138: tmp = t_0 elif z <= -1.25e-190: tmp = z + x elif z <= 8.2e-282: tmp = y + (z + x) elif z <= 8e+35: 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.15e+138) tmp = t_0; elseif (z <= -1.25e-190) tmp = Float64(z + x); elseif (z <= 8.2e-282) tmp = Float64(y + Float64(z + x)); elseif (z <= 8e+35) 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.15e+138) tmp = t_0; elseif (z <= -1.25e-190) tmp = z + x; elseif (z <= 8.2e-282) tmp = y + (z + x); elseif (z <= 8e+35) 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.15e+138], t$95$0, If[LessEqual[z, -1.25e-190], N[(z + x), $MachinePrecision], If[LessEqual[z, 8.2e-282], N[(y + N[(z + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+35], N[(z + x), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+138}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-190}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-282}:\\
\;\;\;\;y + \left(z + x\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+35}:\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.15000000000000004e138 or 7.9999999999999997e35 < z Initial program 99.8%
+-commutative99.8%
add-cube-cbrt99.1%
associate-*r*99.1%
fma-def99.1%
pow299.1%
Applied egg-rr99.1%
Taylor expanded in z around inf 87.9%
pow-base-187.9%
*-commutative87.9%
*-lft-identity87.9%
Simplified87.9%
if -1.15000000000000004e138 < z < -1.25000000000000009e-190 or 8.19999999999999954e-282 < z < 7.9999999999999997e35Initial program 100.0%
Taylor expanded in y around 0 73.1%
if -1.25000000000000009e-190 < z < 8.19999999999999954e-282Initial program 100.0%
Taylor expanded in y around 0 75.6%
Final simplification79.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -1.85e+138)
t_0
(if (<= z -1.4e-23) (+ z x) (if (<= z 2e+34) (+ x (sin y)) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -1.85e+138) {
tmp = t_0;
} else if (z <= -1.4e-23) {
tmp = z + x;
} else if (z <= 2e+34) {
tmp = x + sin(y);
} 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.85d+138)) then
tmp = t_0
else if (z <= (-1.4d-23)) then
tmp = z + x
else if (z <= 2d+34) then
tmp = x + sin(y)
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.85e+138) {
tmp = t_0;
} else if (z <= -1.4e-23) {
tmp = z + x;
} else if (z <= 2e+34) {
tmp = x + Math.sin(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -1.85e+138: tmp = t_0 elif z <= -1.4e-23: tmp = z + x elif z <= 2e+34: tmp = x + math.sin(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -1.85e+138) tmp = t_0; elseif (z <= -1.4e-23) tmp = Float64(z + x); elseif (z <= 2e+34) tmp = Float64(x + sin(y)); 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.85e+138) tmp = t_0; elseif (z <= -1.4e-23) tmp = z + x; elseif (z <= 2e+34) tmp = x + sin(y); 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.85e+138], t$95$0, If[LessEqual[z, -1.4e-23], N[(z + x), $MachinePrecision], If[LessEqual[z, 2e+34], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+138}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-23}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+34}:\\
\;\;\;\;x + \sin y\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.8499999999999999e138 or 1.99999999999999989e34 < z Initial program 99.8%
+-commutative99.8%
add-cube-cbrt99.1%
associate-*r*99.1%
fma-def99.1%
pow299.1%
Applied egg-rr99.1%
Taylor expanded in z around inf 87.9%
pow-base-187.9%
*-commutative87.9%
*-lft-identity87.9%
Simplified87.9%
if -1.8499999999999999e138 < z < -1.3999999999999999e-23Initial program 100.0%
Taylor expanded in y around 0 73.4%
if -1.3999999999999999e-23 < z < 1.99999999999999989e34Initial program 100.0%
+-commutative100.0%
add-cube-cbrt99.9%
associate-*r*99.9%
fma-def99.9%
pow299.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 89.1%
Final simplification87.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.5e-23) (not (<= z 2.2e-133))) (+ x (* z (cos y))) (+ x (sin y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.5e-23) || !(z <= 2.2e-133)) {
tmp = x + (z * cos(y));
} else {
tmp = x + sin(y);
}
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 ((z <= (-1.5d-23)) .or. (.not. (z <= 2.2d-133))) then
tmp = x + (z * cos(y))
else
tmp = x + sin(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.5e-23) || !(z <= 2.2e-133)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = x + Math.sin(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.5e-23) or not (z <= 2.2e-133): tmp = x + (z * math.cos(y)) else: tmp = x + math.sin(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.5e-23) || !(z <= 2.2e-133)) tmp = Float64(x + Float64(z * cos(y))); else tmp = Float64(x + sin(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.5e-23) || ~((z <= 2.2e-133))) tmp = x + (z * cos(y)); else tmp = x + sin(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.5e-23], N[Not[LessEqual[z, 2.2e-133]], $MachinePrecision]], N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-23} \lor \neg \left(z \leq 2.2 \cdot 10^{-133}\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \sin y\\
\end{array}
\end{array}
if z < -1.50000000000000001e-23 or 2.2000000000000001e-133 < z Initial program 99.8%
Taylor expanded in x around inf 95.9%
if -1.50000000000000001e-23 < z < 2.2000000000000001e-133Initial program 100.0%
+-commutative100.0%
add-cube-cbrt100.0%
associate-*r*100.0%
fma-def100.0%
pow2100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 92.9%
Final simplification94.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -22.0) (not (<= z 3.1))) (+ x (* z (cos y))) (+ z (+ x (sin y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -22.0) || !(z <= 3.1)) {
tmp = x + (z * cos(y));
} else {
tmp = z + (x + sin(y));
}
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 ((z <= (-22.0d0)) .or. (.not. (z <= 3.1d0))) then
tmp = x + (z * cos(y))
else
tmp = z + (x + sin(y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -22.0) || !(z <= 3.1)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = z + (x + Math.sin(y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -22.0) or not (z <= 3.1): tmp = x + (z * math.cos(y)) else: tmp = z + (x + math.sin(y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -22.0) || !(z <= 3.1)) tmp = Float64(x + Float64(z * cos(y))); else tmp = Float64(z + Float64(x + sin(y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -22.0) || ~((z <= 3.1))) tmp = x + (z * cos(y)); else tmp = z + (x + sin(y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -22.0], N[Not[LessEqual[z, 3.1]], $MachinePrecision]], N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -22 \lor \neg \left(z \leq 3.1\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;z + \left(x + \sin y\right)\\
\end{array}
\end{array}
if z < -22 or 3.10000000000000009 < z Initial program 99.8%
Taylor expanded in x around inf 97.9%
if -22 < z < 3.10000000000000009Initial program 100.0%
Taylor expanded in y around 0 99.3%
Final simplification98.6%
(FPCore (x y z) :precision binary64 (if (<= y -6.5e+27) (+ z x) (if (<= y 3.2) (+ y (+ z x)) (+ z x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -6.5e+27) {
tmp = z + x;
} else if (y <= 3.2) {
tmp = y + (z + 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 <= (-6.5d+27)) then
tmp = z + x
else if (y <= 3.2d0) then
tmp = y + (z + 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 <= -6.5e+27) {
tmp = z + x;
} else if (y <= 3.2) {
tmp = y + (z + x);
} else {
tmp = z + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -6.5e+27: tmp = z + x elif y <= 3.2: tmp = y + (z + x) else: tmp = z + x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -6.5e+27) tmp = Float64(z + x); elseif (y <= 3.2) tmp = Float64(y + Float64(z + x)); else tmp = Float64(z + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -6.5e+27) tmp = z + x; elseif (y <= 3.2) tmp = y + (z + x); else tmp = z + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -6.5e+27], N[(z + x), $MachinePrecision], If[LessEqual[y, 3.2], N[(y + N[(z + x), $MachinePrecision]), $MachinePrecision], N[(z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+27}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 3.2:\\
\;\;\;\;y + \left(z + x\right)\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if y < -6.5000000000000005e27 or 3.2000000000000002 < y Initial program 99.8%
Taylor expanded in y around 0 40.5%
if -6.5000000000000005e27 < y < 3.2000000000000002Initial program 100.0%
Taylor expanded in y around 0 95.3%
Final simplification70.2%
(FPCore (x y z) :precision binary64 (if (<= x -7e+27) x (if (<= x 580000000000.0) (+ z y) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -7e+27) {
tmp = x;
} else if (x <= 580000000000.0) {
tmp = z + 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 <= (-7d+27)) then
tmp = x
else if (x <= 580000000000.0d0) then
tmp = z + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -7e+27) {
tmp = x;
} else if (x <= 580000000000.0) {
tmp = z + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -7e+27: tmp = x elif x <= 580000000000.0: tmp = z + y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -7e+27) tmp = x; elseif (x <= 580000000000.0) tmp = Float64(z + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -7e+27) tmp = x; elseif (x <= 580000000000.0) tmp = z + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -7e+27], x, If[LessEqual[x, 580000000000.0], N[(z + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{+27}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 580000000000:\\
\;\;\;\;z + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.0000000000000004e27 or 5.8e11 < x Initial program 100.0%
+-commutative100.0%
add-cube-cbrt99.8%
associate-*r*99.8%
fma-def99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 73.0%
if -7.0000000000000004e27 < x < 5.8e11Initial program 99.8%
Taylor expanded in x around 0 88.6%
*-commutative88.6%
fma-def88.6%
Simplified88.6%
Taylor expanded in y around 0 41.9%
Final simplification56.9%
(FPCore (x y z) :precision binary64 (if (<= y 1.85e-44) (+ z x) (if (<= y 0.00032) (+ z y) (+ z x))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.85e-44) {
tmp = z + x;
} else if (y <= 0.00032) {
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 (y <= 1.85d-44) then
tmp = z + x
else if (y <= 0.00032d0) 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 (y <= 1.85e-44) {
tmp = z + x;
} else if (y <= 0.00032) {
tmp = z + y;
} else {
tmp = z + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.85e-44: tmp = z + x elif y <= 0.00032: tmp = z + y else: tmp = z + x return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.85e-44) tmp = Float64(z + x); elseif (y <= 0.00032) tmp = Float64(z + y); else tmp = Float64(z + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1.85e-44) tmp = z + x; elseif (y <= 0.00032) tmp = z + y; else tmp = z + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.85e-44], N[(z + x), $MachinePrecision], If[LessEqual[y, 0.00032], N[(z + y), $MachinePrecision], N[(z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.85 \cdot 10^{-44}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 0.00032:\\
\;\;\;\;z + y\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if y < 1.85e-44 or 3.20000000000000026e-4 < y Initial program 99.9%
Taylor expanded in y around 0 66.5%
if 1.85e-44 < y < 3.20000000000000026e-4Initial program 99.9%
Taylor expanded in x around 0 99.9%
*-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around 0 93.0%
Final simplification68.1%
(FPCore (x y z) :precision binary64 (if (<= z -1.95e+137) z (if (<= z 4.6e+83) x z)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.95e+137) {
tmp = z;
} else if (z <= 4.6e+83) {
tmp = x;
} else {
tmp = z;
}
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 (z <= (-1.95d+137)) then
tmp = z
else if (z <= 4.6d+83) then
tmp = x
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.95e+137) {
tmp = z;
} else if (z <= 4.6e+83) {
tmp = x;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.95e+137: tmp = z elif z <= 4.6e+83: tmp = x else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.95e+137) tmp = z; elseif (z <= 4.6e+83) tmp = x; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.95e+137) tmp = z; elseif (z <= 4.6e+83) tmp = x; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.95e+137], z, If[LessEqual[z, 4.6e+83], x, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+137}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+83}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.95000000000000015e137 or 4.5999999999999999e83 < z Initial program 99.8%
+-commutative99.8%
add-cube-cbrt99.2%
associate-*r*99.2%
fma-def99.2%
pow299.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 88.8%
pow-base-188.8%
*-commutative88.8%
*-lft-identity88.8%
Simplified88.8%
Taylor expanded in y around 0 49.8%
if -1.95000000000000015e137 < z < 4.5999999999999999e83Initial program 99.9%
+-commutative99.9%
add-cube-cbrt99.8%
associate-*r*99.8%
fma-def99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 56.9%
Final simplification54.3%
(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%
+-commutative99.9%
add-cube-cbrt99.6%
associate-*r*99.6%
fma-def99.6%
pow299.6%
Applied egg-rr99.6%
Taylor expanded in x around inf 40.5%
Final simplification40.5%
herbie shell --seed 2023195
(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))))