
(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 (+ (* z (cos y)) (+ x (sin y))))
double code(double x, double y, double z) {
return (z * cos(y)) + (x + 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 = (z * cos(y)) + (x + sin(y))
end function
public static double code(double x, double y, double z) {
return (z * Math.cos(y)) + (x + Math.sin(y));
}
def code(x, y, z): return (z * math.cos(y)) + (x + math.sin(y))
function code(x, y, z) return Float64(Float64(z * cos(y)) + Float64(x + sin(y))) end
function tmp = code(x, y, z) tmp = (z * cos(y)) + (x + sin(y)); end
code[x_, y_, z_] := N[(N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision] + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \cos y + \left(x + \sin y\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* z (cos y)))) (if (or (<= x -1.45e-60) (not (<= x 4e-21))) (+ x t_0) (+ (sin y) t_0))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if ((x <= -1.45e-60) || !(x <= 4e-21)) {
tmp = x + t_0;
} else {
tmp = sin(y) + 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 ((x <= (-1.45d-60)) .or. (.not. (x <= 4d-21))) then
tmp = x + t_0
else
tmp = sin(y) + 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 ((x <= -1.45e-60) || !(x <= 4e-21)) {
tmp = x + t_0;
} else {
tmp = Math.sin(y) + t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if (x <= -1.45e-60) or not (x <= 4e-21): tmp = x + t_0 else: tmp = math.sin(y) + t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if ((x <= -1.45e-60) || !(x <= 4e-21)) tmp = Float64(x + t_0); else tmp = Float64(sin(y) + t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if ((x <= -1.45e-60) || ~((x <= 4e-21))) tmp = x + t_0; else tmp = sin(y) + t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -1.45e-60], N[Not[LessEqual[x, 4e-21]], $MachinePrecision]], N[(x + t$95$0), $MachinePrecision], N[(N[Sin[y], $MachinePrecision] + t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{-60} \lor \neg \left(x \leq 4 \cdot 10^{-21}\right):\\
\;\;\;\;x + t_0\\
\mathbf{else}:\\
\;\;\;\;\sin y + t_0\\
\end{array}
\end{array}
if x < -1.45e-60 or 3.99999999999999963e-21 < x Initial program 99.9%
add-cube-cbrt_binary6499.3%
Applied rewrite-once99.3%
pow399.4%
Applied egg-rr99.4%
flip-+56.6%
unpow256.6%
div-inv56.5%
rem-cube-cbrt57.0%
fma-udef57.0%
Applied egg-rr57.0%
fma-udef57.0%
+-commutative57.0%
associate-*r/57.1%
*-commutative57.1%
*-lft-identity57.1%
Simplified57.1%
Taylor expanded in x around inf 98.2%
if -1.45e-60 < x < 3.99999999999999963e-21Initial program 99.9%
Taylor expanded in x around 0 96.2%
Final simplification97.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= x -3e+57)
(+ x z)
(if (<= x 7e-173)
t_0
(if (<= x 1.9e-45) (sin y) (if (<= x 4.6e+17) t_0 (+ x z)))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (x <= -3e+57) {
tmp = x + z;
} else if (x <= 7e-173) {
tmp = t_0;
} else if (x <= 1.9e-45) {
tmp = sin(y);
} else if (x <= 4.6e+17) {
tmp = t_0;
} else {
tmp = x + 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) :: t_0
real(8) :: tmp
t_0 = z * cos(y)
if (x <= (-3d+57)) then
tmp = x + z
else if (x <= 7d-173) then
tmp = t_0
else if (x <= 1.9d-45) then
tmp = sin(y)
else if (x <= 4.6d+17) then
tmp = t_0
else
tmp = x + z
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 (x <= -3e+57) {
tmp = x + z;
} else if (x <= 7e-173) {
tmp = t_0;
} else if (x <= 1.9e-45) {
tmp = Math.sin(y);
} else if (x <= 4.6e+17) {
tmp = t_0;
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if x <= -3e+57: tmp = x + z elif x <= 7e-173: tmp = t_0 elif x <= 1.9e-45: tmp = math.sin(y) elif x <= 4.6e+17: tmp = t_0 else: tmp = x + z return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (x <= -3e+57) tmp = Float64(x + z); elseif (x <= 7e-173) tmp = t_0; elseif (x <= 1.9e-45) tmp = sin(y); elseif (x <= 4.6e+17) tmp = t_0; else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if (x <= -3e+57) tmp = x + z; elseif (x <= 7e-173) tmp = t_0; elseif (x <= 1.9e-45) tmp = sin(y); elseif (x <= 4.6e+17) tmp = t_0; else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e+57], N[(x + z), $MachinePrecision], If[LessEqual[x, 7e-173], t$95$0, If[LessEqual[x, 1.9e-45], N[Sin[y], $MachinePrecision], If[LessEqual[x, 4.6e+17], t$95$0, N[(x + z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;x \leq -3 \cdot 10^{+57}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-173}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-45}:\\
\;\;\;\;\sin y\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+17}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if x < -3e57 or 4.6e17 < x Initial program 100.0%
Taylor expanded in y around 0 91.9%
+-commutative91.9%
Simplified91.9%
if -3e57 < x < 7.00000000000000029e-173 or 1.89999999999999999e-45 < x < 4.6e17Initial program 99.9%
Taylor expanded in z around inf 68.7%
if 7.00000000000000029e-173 < x < 1.89999999999999999e-45Initial program 100.0%
Taylor expanded in x around 0 93.3%
Taylor expanded in z around 0 62.9%
Final simplification79.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -2.3e+33)
t_0
(if (<= z -3.15e-49)
(+ x z)
(if (<= z 1.75e-56) (+ x (sin y)) (if (<= z 1.3e+138) (+ x z) t_0))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -2.3e+33) {
tmp = t_0;
} else if (z <= -3.15e-49) {
tmp = x + z;
} else if (z <= 1.75e-56) {
tmp = x + sin(y);
} else if (z <= 1.3e+138) {
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 <= (-2.3d+33)) then
tmp = t_0
else if (z <= (-3.15d-49)) then
tmp = x + z
else if (z <= 1.75d-56) then
tmp = x + sin(y)
else if (z <= 1.3d+138) 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 <= -2.3e+33) {
tmp = t_0;
} else if (z <= -3.15e-49) {
tmp = x + z;
} else if (z <= 1.75e-56) {
tmp = x + Math.sin(y);
} else if (z <= 1.3e+138) {
tmp = x + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -2.3e+33: tmp = t_0 elif z <= -3.15e-49: tmp = x + z elif z <= 1.75e-56: tmp = x + math.sin(y) elif z <= 1.3e+138: 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 <= -2.3e+33) tmp = t_0; elseif (z <= -3.15e-49) tmp = Float64(x + z); elseif (z <= 1.75e-56) tmp = Float64(x + sin(y)); elseif (z <= 1.3e+138) 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 <= -2.3e+33) tmp = t_0; elseif (z <= -3.15e-49) tmp = x + z; elseif (z <= 1.75e-56) tmp = x + sin(y); elseif (z <= 1.3e+138) 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, -2.3e+33], t$95$0, If[LessEqual[z, -3.15e-49], N[(x + z), $MachinePrecision], If[LessEqual[z, 1.75e-56], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+138], N[(x + z), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+33}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.15 \cdot 10^{-49}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-56}:\\
\;\;\;\;x + \sin y\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+138}:\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -2.30000000000000011e33 or 1.3e138 < z Initial program 99.8%
Taylor expanded in z around inf 79.9%
if -2.30000000000000011e33 < z < -3.1499999999999998e-49 or 1.7499999999999999e-56 < z < 1.3e138Initial program 99.9%
Taylor expanded in y around 0 83.2%
+-commutative83.2%
Simplified83.2%
if -3.1499999999999998e-49 < z < 1.7499999999999999e-56Initial program 100.0%
Taylor expanded in z around 0 95.6%
+-commutative95.6%
Simplified95.6%
Final simplification86.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -4.6e-49) (not (<= z 2.3e-56))) (+ x (* z (cos y))) (+ x (sin y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.6e-49) || !(z <= 2.3e-56)) {
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-49)) .or. (.not. (z <= 2.3d-56))) 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-49) || !(z <= 2.3e-56)) {
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-49) or not (z <= 2.3e-56): 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-49) || !(z <= 2.3e-56)) 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-49) || ~((z <= 2.3e-56))) 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-49], N[Not[LessEqual[z, 2.3e-56]], $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^{-49} \lor \neg \left(z \leq 2.3 \cdot 10^{-56}\right):\\
\;\;\;\;x + z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \sin y\\
\end{array}
\end{array}
if z < -4.5999999999999998e-49 or 2.30000000000000002e-56 < z Initial program 99.9%
add-cube-cbrt_binary6498.7%
Applied rewrite-once98.7%
pow398.7%
Applied egg-rr98.7%
flip-+73.9%
unpow273.9%
div-inv73.8%
rem-cube-cbrt75.0%
fma-udef75.0%
Applied egg-rr75.0%
fma-udef75.0%
+-commutative75.0%
associate-*r/75.1%
*-commutative75.1%
*-lft-identity75.1%
Simplified75.1%
Taylor expanded in x around inf 97.4%
if -4.5999999999999998e-49 < z < 2.30000000000000002e-56Initial program 100.0%
Taylor expanded in z around 0 95.6%
+-commutative95.6%
Simplified95.6%
Final simplification96.7%
(FPCore (x y z) :precision binary64 (if (<= x -2e-55) (+ x z) (if (<= x 2.15e-172) (+ z (+ x y)) (if (<= x 1.9e-45) (sin y) (+ x z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2e-55) {
tmp = x + z;
} else if (x <= 2.15e-172) {
tmp = z + (x + y);
} else if (x <= 1.9e-45) {
tmp = sin(y);
} else {
tmp = x + 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 <= (-2d-55)) then
tmp = x + z
else if (x <= 2.15d-172) then
tmp = z + (x + y)
else if (x <= 1.9d-45) then
tmp = sin(y)
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2e-55) {
tmp = x + z;
} else if (x <= 2.15e-172) {
tmp = z + (x + y);
} else if (x <= 1.9e-45) {
tmp = Math.sin(y);
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2e-55: tmp = x + z elif x <= 2.15e-172: tmp = z + (x + y) elif x <= 1.9e-45: tmp = math.sin(y) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2e-55) tmp = Float64(x + z); elseif (x <= 2.15e-172) tmp = Float64(z + Float64(x + y)); elseif (x <= 1.9e-45) tmp = sin(y); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2e-55) tmp = x + z; elseif (x <= 2.15e-172) tmp = z + (x + y); elseif (x <= 1.9e-45) tmp = sin(y); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2e-55], N[(x + z), $MachinePrecision], If[LessEqual[x, 2.15e-172], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.9e-45], N[Sin[y], $MachinePrecision], N[(x + z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-55}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-172}:\\
\;\;\;\;z + \left(x + y\right)\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-45}:\\
\;\;\;\;\sin y\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if x < -1.99999999999999999e-55 or 1.89999999999999999e-45 < x Initial program 99.9%
Taylor expanded in y around 0 82.6%
+-commutative82.6%
Simplified82.6%
if -1.99999999999999999e-55 < x < 2.1499999999999999e-172Initial program 99.9%
Taylor expanded in y around 0 53.0%
associate-+r+53.0%
+-commutative53.0%
+-commutative53.0%
Simplified53.0%
if 2.1499999999999999e-172 < x < 1.89999999999999999e-45Initial program 100.0%
Taylor expanded in x around 0 93.3%
Taylor expanded in z around 0 62.9%
Final simplification73.0%
(FPCore (x y z) :precision binary64 (if (<= x -4.6e-52) (+ x z) (if (<= x 1.9e-64) (+ x (+ (+ y z) (* -0.5 (* z (* y y))))) (+ x z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.6e-52) {
tmp = x + z;
} else if (x <= 1.9e-64) {
tmp = x + ((y + z) + (-0.5 * (z * (y * y))));
} else {
tmp = x + 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 <= (-4.6d-52)) then
tmp = x + z
else if (x <= 1.9d-64) then
tmp = x + ((y + z) + ((-0.5d0) * (z * (y * y))))
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.6e-52) {
tmp = x + z;
} else if (x <= 1.9e-64) {
tmp = x + ((y + z) + (-0.5 * (z * (y * y))));
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.6e-52: tmp = x + z elif x <= 1.9e-64: tmp = x + ((y + z) + (-0.5 * (z * (y * y)))) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.6e-52) tmp = Float64(x + z); elseif (x <= 1.9e-64) tmp = Float64(x + Float64(Float64(y + z) + Float64(-0.5 * Float64(z * Float64(y * y))))); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.6e-52) tmp = x + z; elseif (x <= 1.9e-64) tmp = x + ((y + z) + (-0.5 * (z * (y * y)))); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.6e-52], N[(x + z), $MachinePrecision], If[LessEqual[x, 1.9e-64], N[(x + N[(N[(y + z), $MachinePrecision] + N[(-0.5 * N[(z * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{-52}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-64}:\\
\;\;\;\;x + \left(\left(y + z\right) + -0.5 \cdot \left(z \cdot \left(y \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if x < -4.59999999999999989e-52 or 1.9000000000000001e-64 < x Initial program 99.9%
Taylor expanded in y around 0 82.3%
+-commutative82.3%
Simplified82.3%
if -4.59999999999999989e-52 < x < 1.9000000000000001e-64Initial program 99.9%
Taylor expanded in y around 0 48.5%
associate-+r+48.5%
+-commutative48.5%
*-commutative48.5%
unpow248.5%
Simplified48.5%
Final simplification70.5%
(FPCore (x y z) :precision binary64 (if (<= x -3.5e-56) (+ x z) (if (<= x 2.4e-67) (+ z (+ x y)) (+ x z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.5e-56) {
tmp = x + z;
} else if (x <= 2.4e-67) {
tmp = z + (x + y);
} else {
tmp = x + 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.5d-56)) then
tmp = x + z
else if (x <= 2.4d-67) then
tmp = z + (x + y)
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.5e-56) {
tmp = x + z;
} else if (x <= 2.4e-67) {
tmp = z + (x + y);
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.5e-56: tmp = x + z elif x <= 2.4e-67: tmp = z + (x + y) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.5e-56) tmp = Float64(x + z); elseif (x <= 2.4e-67) tmp = Float64(z + Float64(x + y)); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.5e-56) tmp = x + z; elseif (x <= 2.4e-67) tmp = z + (x + y); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.5e-56], N[(x + z), $MachinePrecision], If[LessEqual[x, 2.4e-67], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-56}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-67}:\\
\;\;\;\;z + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if x < -3.4999999999999998e-56 or 2.4e-67 < x Initial program 99.9%
Taylor expanded in y around 0 81.8%
+-commutative81.8%
Simplified81.8%
if -3.4999999999999998e-56 < x < 2.4e-67Initial program 99.9%
Taylor expanded in y around 0 48.9%
associate-+r+48.9%
+-commutative48.9%
+-commutative48.9%
Simplified48.9%
Final simplification70.5%
(FPCore (x y z) :precision binary64 (if (<= x -23000000000.0) x (if (<= x 5e-8) z x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -23000000000.0) {
tmp = x;
} else if (x <= 5e-8) {
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 <= (-23000000000.0d0)) then
tmp = x
else if (x <= 5d-8) 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 <= -23000000000.0) {
tmp = x;
} else if (x <= 5e-8) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -23000000000.0: tmp = x elif x <= 5e-8: tmp = z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -23000000000.0) tmp = x; elseif (x <= 5e-8) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -23000000000.0) tmp = x; elseif (x <= 5e-8) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -23000000000.0], x, If[LessEqual[x, 5e-8], z, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -23000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-8}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.3e10 or 4.9999999999999998e-8 < x Initial program 99.9%
Taylor expanded in x around inf 74.3%
if -2.3e10 < x < 4.9999999999999998e-8Initial program 99.9%
Taylor expanded in z around inf 60.9%
Taylor expanded in y around 0 39.3%
Final simplification58.5%
(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 67.7%
+-commutative67.7%
Simplified67.7%
Final simplification67.7%
(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 44.1%
Final simplification44.1%
herbie shell --seed 2023297
(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))))