
(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 12 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 -7.2e+41)
t_0
(if (<= z 1.85e-40) (+ x (sin y)) (if (<= z 3.3e+165) (+ x z) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -7.2e+41) {
tmp = t_0;
} else if (z <= 1.85e-40) {
tmp = x + sin(y);
} else if (z <= 3.3e+165) {
tmp = x + 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 = z * cos(y)
if (z <= (-7.2d+41)) then
tmp = t_0
else if (z <= 1.85d-40) then
tmp = x + sin(y)
else if (z <= 3.3d+165) then
tmp = x + z
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 <= -7.2e+41) {
tmp = t_0;
} else if (z <= 1.85e-40) {
tmp = x + Math.sin(y);
} else if (z <= 3.3e+165) {
tmp = x + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -7.2e+41: tmp = t_0 elif z <= 1.85e-40: tmp = x + math.sin(y) elif z <= 3.3e+165: tmp = x + z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -7.2e+41) tmp = t_0; elseif (z <= 1.85e-40) tmp = Float64(x + sin(y)); elseif (z <= 3.3e+165) tmp = Float64(x + z); 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 <= -7.2e+41) tmp = t_0; elseif (z <= 1.85e-40) tmp = x + sin(y); elseif (z <= 3.3e+165) tmp = x + z; 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, -7.2e+41], t$95$0, If[LessEqual[z, 1.85e-40], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+165], N[(x + z), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+41}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-40}:\\
\;\;\;\;x + \sin y\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+165}:\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -7.20000000000000051e41 or 3.2999999999999999e165 < z Initial program 99.9%
Taylor expanded in z around inf 83.9%
if -7.20000000000000051e41 < z < 1.84999999999999999e-40Initial program 100.0%
Taylor expanded in z around 0 88.6%
+-commutative88.6%
Simplified88.6%
if 1.84999999999999999e-40 < z < 3.2999999999999999e165Initial program 100.0%
Taylor expanded in y around 0 80.9%
Final simplification85.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -4e+43)
t_0
(if (<= z -7.8e-162) (+ x z) (if (<= z 4.5e+164) (+ z (+ x y)) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -4e+43) {
tmp = t_0;
} else if (z <= -7.8e-162) {
tmp = x + z;
} else if (z <= 4.5e+164) {
tmp = z + (x + 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 <= (-4d+43)) then
tmp = t_0
else if (z <= (-7.8d-162)) then
tmp = x + z
else if (z <= 4.5d+164) then
tmp = z + (x + 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 <= -4e+43) {
tmp = t_0;
} else if (z <= -7.8e-162) {
tmp = x + z;
} else if (z <= 4.5e+164) {
tmp = z + (x + y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -4e+43: tmp = t_0 elif z <= -7.8e-162: tmp = x + z elif z <= 4.5e+164: tmp = z + (x + y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -4e+43) tmp = t_0; elseif (z <= -7.8e-162) tmp = Float64(x + z); elseif (z <= 4.5e+164) tmp = Float64(z + Float64(x + 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 <= -4e+43) tmp = t_0; elseif (z <= -7.8e-162) tmp = x + z; elseif (z <= 4.5e+164) tmp = z + (x + 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, -4e+43], t$95$0, If[LessEqual[z, -7.8e-162], N[(x + z), $MachinePrecision], If[LessEqual[z, 4.5e+164], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -4 \cdot 10^{+43}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-162}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+164}:\\
\;\;\;\;z + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.00000000000000006e43 or 4.49999999999999975e164 < z Initial program 99.9%
Taylor expanded in z around inf 83.9%
if -4.00000000000000006e43 < z < -7.7999999999999999e-162Initial program 100.0%
Taylor expanded in y around 0 76.0%
if -7.7999999999999999e-162 < z < 4.49999999999999975e164Initial program 100.0%
Taylor expanded in y around 0 75.5%
associate-+r+75.5%
+-commutative75.5%
Simplified75.5%
Final simplification78.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.8) (not (<= z 0.75))) (+ x (* z (cos y))) (+ (+ x (sin y)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.8) || !(z <= 0.75)) {
tmp = x + (z * cos(y));
} else {
tmp = (x + sin(y)) + 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 <= (-0.8d0)) .or. (.not. (z <= 0.75d0))) then
tmp = x + (z * cos(y))
else
tmp = (x + sin(y)) + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.8) || !(z <= 0.75)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = (x + Math.sin(y)) + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.8) or not (z <= 0.75): tmp = x + (z * math.cos(y)) else: tmp = (x + math.sin(y)) + z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.8) || !(z <= 0.75)) tmp = Float64(x + Float64(z * cos(y))); else tmp = Float64(Float64(x + sin(y)) + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.8) || ~((z <= 0.75))) tmp = x + (z * cos(y)); else tmp = (x + sin(y)) + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.8], N[Not[LessEqual[z, 0.75]], $MachinePrecision]], N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.8 \lor \neg \left(z \leq 0.75\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;\left(x + \sin y\right) + z\\
\end{array}
\end{array}
if z < -0.80000000000000004 or 0.75 < z Initial program 99.9%
Taylor expanded in x around inf 98.6%
if -0.80000000000000004 < z < 0.75Initial program 100.0%
Taylor expanded in y around 0 99.2%
Final simplification98.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -4.6e-97) (not (<= z 8e-44))) (+ x (* z (cos y))) (+ x (sin y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.6e-97) || !(z <= 8e-44)) {
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 <= (-4.6d-97)) .or. (.not. (z <= 8d-44))) 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 <= -4.6e-97) || !(z <= 8e-44)) {
tmp = x + (z * Math.cos(y));
} else {
tmp = x + Math.sin(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.6e-97) or not (z <= 8e-44): tmp = x + (z * math.cos(y)) else: tmp = x + math.sin(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.6e-97) || !(z <= 8e-44)) 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 <= -4.6e-97) || ~((z <= 8e-44))) tmp = x + (z * cos(y)); else tmp = x + sin(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.6e-97], N[Not[LessEqual[z, 8e-44]], $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 -4.6 \cdot 10^{-97} \lor \neg \left(z \leq 8 \cdot 10^{-44}\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \sin y\\
\end{array}
\end{array}
if z < -4.59999999999999988e-97 or 7.99999999999999962e-44 < z Initial program 99.9%
Taylor expanded in x around inf 95.1%
if -4.59999999999999988e-97 < z < 7.99999999999999962e-44Initial program 100.0%
Taylor expanded in z around 0 93.1%
+-commutative93.1%
Simplified93.1%
Final simplification94.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.45e+27) (not (<= y 12.5))) (+ x z) (+ x (+ z (* y (+ 1.0 (* y (* y -0.16666666666666666))))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.45e+27) || !(y <= 12.5)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666)))));
}
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.45d+27)) .or. (.not. (y <= 12.5d0))) then
tmp = x + z
else
tmp = x + (z + (y * (1.0d0 + (y * (y * (-0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.45e+27) || !(y <= 12.5)) {
tmp = x + z;
} else {
tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666)))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.45e+27) or not (y <= 12.5): tmp = x + z else: tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666))))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.45e+27) || !(y <= 12.5)) tmp = Float64(x + z); else tmp = Float64(x + Float64(z + Float64(y * Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666)))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.45e+27) || ~((y <= 12.5))) tmp = x + z; else tmp = x + (z + (y * (1.0 + (y * (y * -0.16666666666666666))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.45e+27], N[Not[LessEqual[y, 12.5]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(x + N[(z + N[(y * N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+27} \lor \neg \left(y \leq 12.5\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;x + \left(z + y \cdot \left(1 + y \cdot \left(y \cdot -0.16666666666666666\right)\right)\right)\\
\end{array}
\end{array}
if y < -1.4500000000000001e27 or 12.5 < y Initial program 99.9%
Taylor expanded in y around 0 41.8%
if -1.4500000000000001e27 < y < 12.5Initial program 100.0%
Taylor expanded in y around 0 98.7%
Taylor expanded in z around 0 98.7%
*-commutative98.7%
Simplified98.7%
Final simplification73.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -5.8e+46) (not (<= y 340.0))) (+ x z) (+ z (+ x y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.8e+46) || !(y <= 340.0)) {
tmp = x + z;
} else {
tmp = z + (x + 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 ((y <= (-5.8d+46)) .or. (.not. (y <= 340.0d0))) then
tmp = x + z
else
tmp = z + (x + y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -5.8e+46) || !(y <= 340.0)) {
tmp = x + z;
} else {
tmp = z + (x + y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5.8e+46) or not (y <= 340.0): tmp = x + z else: tmp = z + (x + y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5.8e+46) || !(y <= 340.0)) tmp = Float64(x + z); else tmp = Float64(z + Float64(x + y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -5.8e+46) || ~((y <= 340.0))) tmp = x + z; else tmp = z + (x + y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.8e+46], N[Not[LessEqual[y, 340.0]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+46} \lor \neg \left(y \leq 340\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;z + \left(x + y\right)\\
\end{array}
\end{array}
if y < -5.8000000000000004e46 or 340 < y Initial program 99.9%
Taylor expanded in y around 0 43.1%
if -5.8000000000000004e46 < y < 340Initial program 100.0%
Taylor expanded in y around 0 95.6%
associate-+r+95.6%
+-commutative95.6%
Simplified95.6%
Final simplification73.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -3.4e-189) (not (<= x 8.2e-61))) (+ x z) (+ y z)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.4e-189) || !(x <= 8.2e-61)) {
tmp = x + z;
} else {
tmp = y + 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 ((x <= (-3.4d-189)) .or. (.not. (x <= 8.2d-61))) then
tmp = x + z
else
tmp = y + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -3.4e-189) || !(x <= 8.2e-61)) {
tmp = x + z;
} else {
tmp = y + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -3.4e-189) or not (x <= 8.2e-61): tmp = x + z else: tmp = y + z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -3.4e-189) || !(x <= 8.2e-61)) tmp = Float64(x + z); else tmp = Float64(y + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -3.4e-189) || ~((x <= 8.2e-61))) tmp = x + z; else tmp = y + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -3.4e-189], N[Not[LessEqual[x, 8.2e-61]], $MachinePrecision]], N[(x + z), $MachinePrecision], N[(y + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-189} \lor \neg \left(x \leq 8.2 \cdot 10^{-61}\right):\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;y + z\\
\end{array}
\end{array}
if x < -3.4000000000000001e-189 or 8.19999999999999998e-61 < x Initial program 99.9%
Taylor expanded in y around 0 78.8%
if -3.4000000000000001e-189 < x < 8.19999999999999998e-61Initial program 99.9%
Taylor expanded in y around 0 54.4%
associate-+r+54.4%
+-commutative54.4%
Simplified54.4%
Taylor expanded in x around 0 52.9%
+-commutative52.9%
Simplified52.9%
Final simplification71.9%
(FPCore (x y z) :precision binary64 (if (<= x -2.6e+14) x (if (<= x 1.25e-42) z x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.6e+14) {
tmp = x;
} else if (x <= 1.25e-42) {
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 <= (-2.6d+14)) then
tmp = x
else if (x <= 1.25d-42) 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 <= -2.6e+14) {
tmp = x;
} else if (x <= 1.25e-42) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.6e+14: tmp = x elif x <= 1.25e-42: tmp = z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.6e+14) tmp = x; elseif (x <= 1.25e-42) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.6e+14) tmp = x; elseif (x <= 1.25e-42) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.6e+14], x, If[LessEqual[x, 1.25e-42], z, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-42}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.6e14 or 1.25000000000000001e-42 < x Initial program 100.0%
add-cbrt-cube99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 80.9%
if -2.6e14 < x < 1.25000000000000001e-42Initial program 99.9%
Taylor expanded in y around 0 53.8%
associate-+r+53.8%
+-commutative53.8%
Simplified53.8%
Taylor expanded in z around inf 38.7%
(FPCore (x y z) :precision binary64 (if (<= x -6.1e-131) x (if (<= x 2.4e-43) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -6.1e-131) {
tmp = x;
} else if (x <= 2.4e-43) {
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 <= (-6.1d-131)) then
tmp = x
else if (x <= 2.4d-43) 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 <= -6.1e-131) {
tmp = x;
} else if (x <= 2.4e-43) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -6.1e-131: tmp = x elif x <= 2.4e-43: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -6.1e-131) tmp = x; elseif (x <= 2.4e-43) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -6.1e-131) tmp = x; elseif (x <= 2.4e-43) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -6.1e-131], x, If[LessEqual[x, 2.4e-43], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.1 \cdot 10^{-131}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-43}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.10000000000000016e-131 or 2.4000000000000002e-43 < x Initial program 99.9%
add-cbrt-cube99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 67.2%
if -6.10000000000000016e-131 < x < 2.4000000000000002e-43Initial program 99.9%
Taylor expanded in y around 0 49.8%
associate-+r+49.8%
+-commutative49.8%
Simplified49.8%
Taylor expanded in y around inf 16.9%
(FPCore (x y z) :precision binary64 (+ x z))
double code(double x, double y, double z) {
return x + z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + z
end function
public static double code(double x, double y, double z) {
return x + z;
}
def code(x, y, z): return x + z
function code(x, y, z) return Float64(x + z) end
function tmp = code(x, y, z) tmp = x + z; end
code[x_, y_, z_] := N[(x + z), $MachinePrecision]
\begin{array}{l}
\\
x + z
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 68.0%
(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%
add-cbrt-cube99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 46.1%
herbie shell --seed 2024138
(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))))