
(FPCore (x) :precision binary64 (let* ((t_0 (sin (* x 0.5)))) (/ (* (* (/ 8.0 3.0) t_0) t_0) (sin x))))
double code(double x) {
double t_0 = sin((x * 0.5));
return (((8.0 / 3.0) * t_0) * t_0) / sin(x);
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = sin((x * 0.5d0))
code = (((8.0d0 / 3.0d0) * t_0) * t_0) / sin(x)
end function
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
return (((8.0 / 3.0) * t_0) * t_0) / Math.sin(x);
}
def code(x): t_0 = math.sin((x * 0.5)) return (((8.0 / 3.0) * t_0) * t_0) / math.sin(x)
function code(x) t_0 = sin(Float64(x * 0.5)) return Float64(Float64(Float64(Float64(8.0 / 3.0) * t_0) * t_0) / sin(x)) end
function tmp = code(x) t_0 = sin((x * 0.5)); tmp = (((8.0 / 3.0) * t_0) * t_0) / sin(x); end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[(N[(8.0 / 3.0), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\frac{\left(\frac{8}{3} \cdot t_0\right) \cdot t_0}{\sin x}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (let* ((t_0 (sin (* x 0.5)))) (/ (* (* (/ 8.0 3.0) t_0) t_0) (sin x))))
double code(double x) {
double t_0 = sin((x * 0.5));
return (((8.0 / 3.0) * t_0) * t_0) / sin(x);
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = sin((x * 0.5d0))
code = (((8.0d0 / 3.0d0) * t_0) * t_0) / sin(x)
end function
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
return (((8.0 / 3.0) * t_0) * t_0) / Math.sin(x);
}
def code(x): t_0 = math.sin((x * 0.5)) return (((8.0 / 3.0) * t_0) * t_0) / math.sin(x)
function code(x) t_0 = sin(Float64(x * 0.5)) return Float64(Float64(Float64(Float64(8.0 / 3.0) * t_0) * t_0) / sin(x)) end
function tmp = code(x) t_0 = sin((x * 0.5)); tmp = (((8.0 / 3.0) * t_0) * t_0) / sin(x); end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[(N[(8.0 / 3.0), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\frac{\left(\frac{8}{3} \cdot t_0\right) \cdot t_0}{\sin x}
\end{array}
\end{array}
(FPCore (x) :precision binary64 (let* ((t_0 (sin (* x 0.5)))) (/ t_0 (* (/ (sin x) t_0) 0.375))))
double code(double x) {
double t_0 = sin((x * 0.5));
return t_0 / ((sin(x) / t_0) * 0.375);
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = sin((x * 0.5d0))
code = t_0 / ((sin(x) / t_0) * 0.375d0)
end function
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
return t_0 / ((Math.sin(x) / t_0) * 0.375);
}
def code(x): t_0 = math.sin((x * 0.5)) return t_0 / ((math.sin(x) / t_0) * 0.375)
function code(x) t_0 = sin(Float64(x * 0.5)) return Float64(t_0 / Float64(Float64(sin(x) / t_0) * 0.375)) end
function tmp = code(x) t_0 = sin((x * 0.5)); tmp = t_0 / ((sin(x) / t_0) * 0.375); end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(t$95$0 / N[(N[(N[Sin[x], $MachinePrecision] / t$95$0), $MachinePrecision] * 0.375), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\frac{t_0}{\frac{\sin x}{t_0} \cdot 0.375}
\end{array}
\end{array}
Initial program 79.2%
associate-/l*99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-/l*79.2%
sqr-neg79.2%
sin-neg79.2%
distribute-lft-neg-out79.2%
sin-neg79.2%
distribute-lft-neg-out79.2%
associate-*r/99.1%
distribute-lft-neg-out99.1%
distribute-rgt-neg-in99.1%
metadata-eval99.1%
distribute-lft-neg-out99.1%
distribute-rgt-neg-in99.1%
metadata-eval99.1%
Simplified99.1%
associate-*r/79.2%
clear-num79.1%
sqr-sin-a52.6%
add-sqr-sqrt20.0%
sqrt-unprod27.6%
swap-sqr27.6%
metadata-eval27.6%
metadata-eval27.6%
swap-sqr27.6%
sqrt-unprod15.1%
add-sqr-sqrt52.6%
sqr-sin-a79.1%
associate-/l/99.1%
Applied egg-rr99.5%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x)
:precision binary64
(let* ((t_0 (sin (* x 0.5))))
(if (or (<= x -0.00058) (not (<= x 1e-12)))
(* 2.6666666666666665 (/ (pow t_0 2.0) (sin x)))
(/ t_0 (+ 0.75 (* -0.09375 (* x x)))))))
double code(double x) {
double t_0 = sin((x * 0.5));
double tmp;
if ((x <= -0.00058) || !(x <= 1e-12)) {
tmp = 2.6666666666666665 * (pow(t_0, 2.0) / sin(x));
} else {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = sin((x * 0.5d0))
if ((x <= (-0.00058d0)) .or. (.not. (x <= 1d-12))) then
tmp = 2.6666666666666665d0 * ((t_0 ** 2.0d0) / sin(x))
else
tmp = t_0 / (0.75d0 + ((-0.09375d0) * (x * x)))
end if
code = tmp
end function
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
double tmp;
if ((x <= -0.00058) || !(x <= 1e-12)) {
tmp = 2.6666666666666665 * (Math.pow(t_0, 2.0) / Math.sin(x));
} else {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
}
return tmp;
}
def code(x): t_0 = math.sin((x * 0.5)) tmp = 0 if (x <= -0.00058) or not (x <= 1e-12): tmp = 2.6666666666666665 * (math.pow(t_0, 2.0) / math.sin(x)) else: tmp = t_0 / (0.75 + (-0.09375 * (x * x))) return tmp
function code(x) t_0 = sin(Float64(x * 0.5)) tmp = 0.0 if ((x <= -0.00058) || !(x <= 1e-12)) tmp = Float64(2.6666666666666665 * Float64((t_0 ^ 2.0) / sin(x))); else tmp = Float64(t_0 / Float64(0.75 + Float64(-0.09375 * Float64(x * x)))); end return tmp end
function tmp_2 = code(x) t_0 = sin((x * 0.5)); tmp = 0.0; if ((x <= -0.00058) || ~((x <= 1e-12))) tmp = 2.6666666666666665 * ((t_0 ^ 2.0) / sin(x)); else tmp = t_0 / (0.75 + (-0.09375 * (x * x))); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x, -0.00058], N[Not[LessEqual[x, 1e-12]], $MachinePrecision]], N[(2.6666666666666665 * N[(N[Power[t$95$0, 2.0], $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(0.75 + N[(-0.09375 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\mathbf{if}\;x \leq -0.00058 \lor \neg \left(x \leq 10^{-12}\right):\\
\;\;\;\;2.6666666666666665 \cdot \frac{{t_0}^{2}}{\sin x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{0.75 + -0.09375 \cdot \left(x \cdot x\right)}\\
\end{array}
\end{array}
if x < -5.8e-4 or 9.9999999999999998e-13 < x Initial program 98.8%
associate-/l*98.9%
metadata-eval98.9%
Simplified98.9%
Applied egg-rr98.8%
if -5.8e-4 < x < 9.9999999999999998e-13Initial program 58.9%
associate-/l*99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-/l*58.9%
sqr-neg58.9%
sin-neg58.9%
distribute-lft-neg-out58.9%
sin-neg58.9%
distribute-lft-neg-out58.9%
associate-*r/99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
associate-*r/58.9%
clear-num58.8%
sqr-sin-a5.6%
add-sqr-sqrt3.1%
sqrt-unprod5.6%
swap-sqr5.6%
metadata-eval5.6%
metadata-eval5.6%
swap-sqr5.6%
sqrt-unprod2.5%
add-sqr-sqrt5.6%
sqr-sin-a58.8%
associate-/l/99.3%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
Final simplification99.4%
(FPCore (x)
:precision binary64
(let* ((t_0 (sin (* x 0.5))) (t_1 (pow t_0 2.0)))
(if (<= x -0.00058)
(* 2.6666666666666665 (/ t_1 (sin x)))
(if (<= x 1e-12)
(/ t_0 (+ 0.75 (* -0.09375 (* x x))))
(* t_1 (/ 2.6666666666666665 (sin x)))))))
double code(double x) {
double t_0 = sin((x * 0.5));
double t_1 = pow(t_0, 2.0);
double tmp;
if (x <= -0.00058) {
tmp = 2.6666666666666665 * (t_1 / sin(x));
} else if (x <= 1e-12) {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = t_1 * (2.6666666666666665 / sin(x));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sin((x * 0.5d0))
t_1 = t_0 ** 2.0d0
if (x <= (-0.00058d0)) then
tmp = 2.6666666666666665d0 * (t_1 / sin(x))
else if (x <= 1d-12) then
tmp = t_0 / (0.75d0 + ((-0.09375d0) * (x * x)))
else
tmp = t_1 * (2.6666666666666665d0 / sin(x))
end if
code = tmp
end function
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
double t_1 = Math.pow(t_0, 2.0);
double tmp;
if (x <= -0.00058) {
tmp = 2.6666666666666665 * (t_1 / Math.sin(x));
} else if (x <= 1e-12) {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = t_1 * (2.6666666666666665 / Math.sin(x));
}
return tmp;
}
def code(x): t_0 = math.sin((x * 0.5)) t_1 = math.pow(t_0, 2.0) tmp = 0 if x <= -0.00058: tmp = 2.6666666666666665 * (t_1 / math.sin(x)) elif x <= 1e-12: tmp = t_0 / (0.75 + (-0.09375 * (x * x))) else: tmp = t_1 * (2.6666666666666665 / math.sin(x)) return tmp
function code(x) t_0 = sin(Float64(x * 0.5)) t_1 = t_0 ^ 2.0 tmp = 0.0 if (x <= -0.00058) tmp = Float64(2.6666666666666665 * Float64(t_1 / sin(x))); elseif (x <= 1e-12) tmp = Float64(t_0 / Float64(0.75 + Float64(-0.09375 * Float64(x * x)))); else tmp = Float64(t_1 * Float64(2.6666666666666665 / sin(x))); end return tmp end
function tmp_2 = code(x) t_0 = sin((x * 0.5)); t_1 = t_0 ^ 2.0; tmp = 0.0; if (x <= -0.00058) tmp = 2.6666666666666665 * (t_1 / sin(x)); elseif (x <= 1e-12) tmp = t_0 / (0.75 + (-0.09375 * (x * x))); else tmp = t_1 * (2.6666666666666665 / sin(x)); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 2.0], $MachinePrecision]}, If[LessEqual[x, -0.00058], N[(2.6666666666666665 * N[(t$95$1 / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1e-12], N[(t$95$0 / N[(0.75 + N[(-0.09375 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.6666666666666665 / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
t_1 := {t_0}^{2}\\
\mathbf{if}\;x \leq -0.00058:\\
\;\;\;\;2.6666666666666665 \cdot \frac{t_1}{\sin x}\\
\mathbf{elif}\;x \leq 10^{-12}:\\
\;\;\;\;\frac{t_0}{0.75 + -0.09375 \cdot \left(x \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{2.6666666666666665}{\sin x}\\
\end{array}
\end{array}
if x < -5.8e-4Initial program 98.9%
associate-/l*99.0%
metadata-eval99.0%
Simplified99.0%
Applied egg-rr98.9%
if -5.8e-4 < x < 9.9999999999999998e-13Initial program 58.9%
associate-/l*99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-/l*58.9%
sqr-neg58.9%
sin-neg58.9%
distribute-lft-neg-out58.9%
sin-neg58.9%
distribute-lft-neg-out58.9%
associate-*r/99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
associate-*r/58.9%
clear-num58.8%
sqr-sin-a5.6%
add-sqr-sqrt3.1%
sqrt-unprod5.6%
swap-sqr5.6%
metadata-eval5.6%
metadata-eval5.6%
swap-sqr5.6%
sqrt-unprod2.5%
add-sqr-sqrt5.6%
sqr-sin-a58.8%
associate-/l/99.3%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
if 9.9999999999999998e-13 < x Initial program 98.8%
associate-/l*98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in x around inf 98.7%
associate-*r/98.7%
*-commutative98.7%
associate-*l/98.8%
*-commutative98.8%
Simplified98.8%
Final simplification99.4%
(FPCore (x)
:precision binary64
(let* ((t_0 (sin (* x 0.5))))
(if (<= x -0.00058)
(* 2.6666666666666665 (/ (pow t_0 2.0) (sin x)))
(if (<= x 1.5e-19)
(/ t_0 (+ 0.75 (* -0.09375 (* x x))))
(/ 2.6666666666666665 (* (sin x) (pow t_0 -2.0)))))))
double code(double x) {
double t_0 = sin((x * 0.5));
double tmp;
if (x <= -0.00058) {
tmp = 2.6666666666666665 * (pow(t_0, 2.0) / sin(x));
} else if (x <= 1.5e-19) {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 2.6666666666666665 / (sin(x) * pow(t_0, -2.0));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = sin((x * 0.5d0))
if (x <= (-0.00058d0)) then
tmp = 2.6666666666666665d0 * ((t_0 ** 2.0d0) / sin(x))
else if (x <= 1.5d-19) then
tmp = t_0 / (0.75d0 + ((-0.09375d0) * (x * x)))
else
tmp = 2.6666666666666665d0 / (sin(x) * (t_0 ** (-2.0d0)))
end if
code = tmp
end function
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
double tmp;
if (x <= -0.00058) {
tmp = 2.6666666666666665 * (Math.pow(t_0, 2.0) / Math.sin(x));
} else if (x <= 1.5e-19) {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 2.6666666666666665 / (Math.sin(x) * Math.pow(t_0, -2.0));
}
return tmp;
}
def code(x): t_0 = math.sin((x * 0.5)) tmp = 0 if x <= -0.00058: tmp = 2.6666666666666665 * (math.pow(t_0, 2.0) / math.sin(x)) elif x <= 1.5e-19: tmp = t_0 / (0.75 + (-0.09375 * (x * x))) else: tmp = 2.6666666666666665 / (math.sin(x) * math.pow(t_0, -2.0)) return tmp
function code(x) t_0 = sin(Float64(x * 0.5)) tmp = 0.0 if (x <= -0.00058) tmp = Float64(2.6666666666666665 * Float64((t_0 ^ 2.0) / sin(x))); elseif (x <= 1.5e-19) tmp = Float64(t_0 / Float64(0.75 + Float64(-0.09375 * Float64(x * x)))); else tmp = Float64(2.6666666666666665 / Float64(sin(x) * (t_0 ^ -2.0))); end return tmp end
function tmp_2 = code(x) t_0 = sin((x * 0.5)); tmp = 0.0; if (x <= -0.00058) tmp = 2.6666666666666665 * ((t_0 ^ 2.0) / sin(x)); elseif (x <= 1.5e-19) tmp = t_0 / (0.75 + (-0.09375 * (x * x))); else tmp = 2.6666666666666665 / (sin(x) * (t_0 ^ -2.0)); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -0.00058], N[(2.6666666666666665 * N[(N[Power[t$95$0, 2.0], $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-19], N[(t$95$0 / N[(0.75 + N[(-0.09375 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.6666666666666665 / N[(N[Sin[x], $MachinePrecision] * N[Power[t$95$0, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\mathbf{if}\;x \leq -0.00058:\\
\;\;\;\;2.6666666666666665 \cdot \frac{{t_0}^{2}}{\sin x}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-19}:\\
\;\;\;\;\frac{t_0}{0.75 + -0.09375 \cdot \left(x \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2.6666666666666665}{\sin x \cdot {t_0}^{-2}}\\
\end{array}
\end{array}
if x < -5.8e-4Initial program 98.9%
associate-/l*99.0%
metadata-eval99.0%
Simplified99.0%
Applied egg-rr98.9%
if -5.8e-4 < x < 1.49999999999999996e-19Initial program 57.9%
associate-/l*99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-/l*57.9%
sqr-neg57.9%
sin-neg57.9%
distribute-lft-neg-out57.9%
sin-neg57.9%
distribute-lft-neg-out57.9%
associate-*r/99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
associate-*r/57.9%
clear-num57.8%
sqr-sin-a5.7%
add-sqr-sqrt3.2%
sqrt-unprod5.7%
swap-sqr5.7%
metadata-eval5.7%
metadata-eval5.7%
swap-sqr5.7%
sqrt-unprod2.5%
add-sqr-sqrt5.7%
sqr-sin-a57.8%
associate-/l/99.3%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
if 1.49999999999999996e-19 < x Initial program 98.8%
associate-/l*98.9%
associate-*r/98.8%
metadata-eval98.8%
associate-/l*98.7%
sqr-neg98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
associate-*r/98.7%
clear-num98.7%
sqr-sin-a93.9%
add-sqr-sqrt0.0%
sqrt-unprod44.6%
swap-sqr44.6%
metadata-eval44.6%
metadata-eval44.6%
swap-sqr44.6%
sqrt-unprod55.6%
add-sqr-sqrt93.9%
sqr-sin-a98.7%
associate-/l/98.8%
Applied egg-rr98.9%
div-inv99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Taylor expanded in x around inf 98.7%
associate-*r/98.8%
*-commutative98.8%
associate-/l*98.8%
unpow298.8%
remove-double-div98.8%
associate-*r/99.0%
*-rgt-identity99.0%
remove-double-div98.8%
associate-/r*98.7%
unpow-198.7%
unpow-198.7%
pow-sqr98.9%
metadata-eval98.9%
associate-/l*99.1%
Simplified99.1%
Final simplification99.5%
(FPCore (x)
:precision binary64
(let* ((t_0 (sin (* x 0.5))))
(if (<= x -0.00058)
(/ 2.6666666666666665 (/ (sin x) (pow t_0 2.0)))
(if (<= x 1.5e-19)
(/ t_0 (+ 0.75 (* -0.09375 (* x x))))
(/ 2.6666666666666665 (* (sin x) (pow t_0 -2.0)))))))
double code(double x) {
double t_0 = sin((x * 0.5));
double tmp;
if (x <= -0.00058) {
tmp = 2.6666666666666665 / (sin(x) / pow(t_0, 2.0));
} else if (x <= 1.5e-19) {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 2.6666666666666665 / (sin(x) * pow(t_0, -2.0));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = sin((x * 0.5d0))
if (x <= (-0.00058d0)) then
tmp = 2.6666666666666665d0 / (sin(x) / (t_0 ** 2.0d0))
else if (x <= 1.5d-19) then
tmp = t_0 / (0.75d0 + ((-0.09375d0) * (x * x)))
else
tmp = 2.6666666666666665d0 / (sin(x) * (t_0 ** (-2.0d0)))
end if
code = tmp
end function
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
double tmp;
if (x <= -0.00058) {
tmp = 2.6666666666666665 / (Math.sin(x) / Math.pow(t_0, 2.0));
} else if (x <= 1.5e-19) {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 2.6666666666666665 / (Math.sin(x) * Math.pow(t_0, -2.0));
}
return tmp;
}
def code(x): t_0 = math.sin((x * 0.5)) tmp = 0 if x <= -0.00058: tmp = 2.6666666666666665 / (math.sin(x) / math.pow(t_0, 2.0)) elif x <= 1.5e-19: tmp = t_0 / (0.75 + (-0.09375 * (x * x))) else: tmp = 2.6666666666666665 / (math.sin(x) * math.pow(t_0, -2.0)) return tmp
function code(x) t_0 = sin(Float64(x * 0.5)) tmp = 0.0 if (x <= -0.00058) tmp = Float64(2.6666666666666665 / Float64(sin(x) / (t_0 ^ 2.0))); elseif (x <= 1.5e-19) tmp = Float64(t_0 / Float64(0.75 + Float64(-0.09375 * Float64(x * x)))); else tmp = Float64(2.6666666666666665 / Float64(sin(x) * (t_0 ^ -2.0))); end return tmp end
function tmp_2 = code(x) t_0 = sin((x * 0.5)); tmp = 0.0; if (x <= -0.00058) tmp = 2.6666666666666665 / (sin(x) / (t_0 ^ 2.0)); elseif (x <= 1.5e-19) tmp = t_0 / (0.75 + (-0.09375 * (x * x))); else tmp = 2.6666666666666665 / (sin(x) * (t_0 ^ -2.0)); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -0.00058], N[(2.6666666666666665 / N[(N[Sin[x], $MachinePrecision] / N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-19], N[(t$95$0 / N[(0.75 + N[(-0.09375 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.6666666666666665 / N[(N[Sin[x], $MachinePrecision] * N[Power[t$95$0, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\mathbf{if}\;x \leq -0.00058:\\
\;\;\;\;\frac{2.6666666666666665}{\frac{\sin x}{{t_0}^{2}}}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-19}:\\
\;\;\;\;\frac{t_0}{0.75 + -0.09375 \cdot \left(x \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2.6666666666666665}{\sin x \cdot {t_0}^{-2}}\\
\end{array}
\end{array}
if x < -5.8e-4Initial program 98.9%
associate-/l*99.0%
associate-*r/99.0%
metadata-eval99.0%
associate-/l*98.9%
sqr-neg98.9%
sin-neg98.9%
distribute-lft-neg-out98.9%
sin-neg98.9%
distribute-lft-neg-out98.9%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
*-commutative98.8%
associate-/r/99.0%
clear-num99.0%
un-div-inv98.9%
associate-/l/99.0%
sqr-sin-a97.8%
add-sqr-sqrt68.6%
sqrt-unprod50.9%
swap-sqr50.9%
metadata-eval50.9%
metadata-eval50.9%
swap-sqr50.9%
sqrt-unprod0.0%
add-sqr-sqrt97.8%
Applied egg-rr99.0%
if -5.8e-4 < x < 1.49999999999999996e-19Initial program 57.9%
associate-/l*99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-/l*57.9%
sqr-neg57.9%
sin-neg57.9%
distribute-lft-neg-out57.9%
sin-neg57.9%
distribute-lft-neg-out57.9%
associate-*r/99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
associate-*r/57.9%
clear-num57.8%
sqr-sin-a5.7%
add-sqr-sqrt3.2%
sqrt-unprod5.7%
swap-sqr5.7%
metadata-eval5.7%
metadata-eval5.7%
swap-sqr5.7%
sqrt-unprod2.5%
add-sqr-sqrt5.7%
sqr-sin-a57.8%
associate-/l/99.3%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
if 1.49999999999999996e-19 < x Initial program 98.8%
associate-/l*98.9%
associate-*r/98.8%
metadata-eval98.8%
associate-/l*98.7%
sqr-neg98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
associate-*r/98.7%
clear-num98.7%
sqr-sin-a93.9%
add-sqr-sqrt0.0%
sqrt-unprod44.6%
swap-sqr44.6%
metadata-eval44.6%
metadata-eval44.6%
swap-sqr44.6%
sqrt-unprod55.6%
add-sqr-sqrt93.9%
sqr-sin-a98.7%
associate-/l/98.8%
Applied egg-rr98.9%
div-inv99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Taylor expanded in x around inf 98.7%
associate-*r/98.8%
*-commutative98.8%
associate-/l*98.8%
unpow298.8%
remove-double-div98.8%
associate-*r/99.0%
*-rgt-identity99.0%
remove-double-div98.8%
associate-/r*98.7%
unpow-198.7%
unpow-198.7%
pow-sqr98.9%
metadata-eval98.9%
associate-/l*99.1%
Simplified99.1%
Final simplification99.5%
(FPCore (x)
:precision binary64
(let* ((t_0 (sin (* x 0.5))))
(if (<= x -0.00058)
(/ (pow t_0 2.0) (* (sin x) 0.375))
(if (<= x 1.5e-19)
(/ t_0 (+ 0.75 (* -0.09375 (* x x))))
(/ 2.6666666666666665 (* (sin x) (pow t_0 -2.0)))))))
double code(double x) {
double t_0 = sin((x * 0.5));
double tmp;
if (x <= -0.00058) {
tmp = pow(t_0, 2.0) / (sin(x) * 0.375);
} else if (x <= 1.5e-19) {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 2.6666666666666665 / (sin(x) * pow(t_0, -2.0));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = sin((x * 0.5d0))
if (x <= (-0.00058d0)) then
tmp = (t_0 ** 2.0d0) / (sin(x) * 0.375d0)
else if (x <= 1.5d-19) then
tmp = t_0 / (0.75d0 + ((-0.09375d0) * (x * x)))
else
tmp = 2.6666666666666665d0 / (sin(x) * (t_0 ** (-2.0d0)))
end if
code = tmp
end function
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
double tmp;
if (x <= -0.00058) {
tmp = Math.pow(t_0, 2.0) / (Math.sin(x) * 0.375);
} else if (x <= 1.5e-19) {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 2.6666666666666665 / (Math.sin(x) * Math.pow(t_0, -2.0));
}
return tmp;
}
def code(x): t_0 = math.sin((x * 0.5)) tmp = 0 if x <= -0.00058: tmp = math.pow(t_0, 2.0) / (math.sin(x) * 0.375) elif x <= 1.5e-19: tmp = t_0 / (0.75 + (-0.09375 * (x * x))) else: tmp = 2.6666666666666665 / (math.sin(x) * math.pow(t_0, -2.0)) return tmp
function code(x) t_0 = sin(Float64(x * 0.5)) tmp = 0.0 if (x <= -0.00058) tmp = Float64((t_0 ^ 2.0) / Float64(sin(x) * 0.375)); elseif (x <= 1.5e-19) tmp = Float64(t_0 / Float64(0.75 + Float64(-0.09375 * Float64(x * x)))); else tmp = Float64(2.6666666666666665 / Float64(sin(x) * (t_0 ^ -2.0))); end return tmp end
function tmp_2 = code(x) t_0 = sin((x * 0.5)); tmp = 0.0; if (x <= -0.00058) tmp = (t_0 ^ 2.0) / (sin(x) * 0.375); elseif (x <= 1.5e-19) tmp = t_0 / (0.75 + (-0.09375 * (x * x))); else tmp = 2.6666666666666665 / (sin(x) * (t_0 ^ -2.0)); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -0.00058], N[(N[Power[t$95$0, 2.0], $MachinePrecision] / N[(N[Sin[x], $MachinePrecision] * 0.375), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-19], N[(t$95$0 / N[(0.75 + N[(-0.09375 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.6666666666666665 / N[(N[Sin[x], $MachinePrecision] * N[Power[t$95$0, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\mathbf{if}\;x \leq -0.00058:\\
\;\;\;\;\frac{{t_0}^{2}}{\sin x \cdot 0.375}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-19}:\\
\;\;\;\;\frac{t_0}{0.75 + -0.09375 \cdot \left(x \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2.6666666666666665}{\sin x \cdot {t_0}^{-2}}\\
\end{array}
\end{array}
if x < -5.8e-4Initial program 98.9%
associate-/l*99.0%
associate-*r/99.0%
metadata-eval99.0%
associate-/l*98.9%
sqr-neg98.9%
sin-neg98.9%
distribute-lft-neg-out98.9%
sin-neg98.9%
distribute-lft-neg-out98.9%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
*-commutative98.8%
associate-*r/98.9%
associate-*l/98.9%
sqr-sin-a97.8%
add-sqr-sqrt68.6%
sqrt-unprod50.8%
swap-sqr50.8%
metadata-eval50.8%
metadata-eval50.8%
swap-sqr50.8%
sqrt-unprod0.0%
add-sqr-sqrt97.8%
sqr-sin-a98.9%
Applied egg-rr99.0%
if -5.8e-4 < x < 1.49999999999999996e-19Initial program 57.9%
associate-/l*99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-/l*57.9%
sqr-neg57.9%
sin-neg57.9%
distribute-lft-neg-out57.9%
sin-neg57.9%
distribute-lft-neg-out57.9%
associate-*r/99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
associate-*r/57.9%
clear-num57.8%
sqr-sin-a5.7%
add-sqr-sqrt3.2%
sqrt-unprod5.7%
swap-sqr5.7%
metadata-eval5.7%
metadata-eval5.7%
swap-sqr5.7%
sqrt-unprod2.5%
add-sqr-sqrt5.7%
sqr-sin-a57.8%
associate-/l/99.3%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
if 1.49999999999999996e-19 < x Initial program 98.8%
associate-/l*98.9%
associate-*r/98.8%
metadata-eval98.8%
associate-/l*98.7%
sqr-neg98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
associate-*r/98.7%
clear-num98.7%
sqr-sin-a93.9%
add-sqr-sqrt0.0%
sqrt-unprod44.6%
swap-sqr44.6%
metadata-eval44.6%
metadata-eval44.6%
swap-sqr44.6%
sqrt-unprod55.6%
add-sqr-sqrt93.9%
sqr-sin-a98.7%
associate-/l/98.8%
Applied egg-rr98.9%
div-inv99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Taylor expanded in x around inf 98.7%
associate-*r/98.8%
*-commutative98.8%
associate-/l*98.8%
unpow298.8%
remove-double-div98.8%
associate-*r/99.0%
*-rgt-identity99.0%
remove-double-div98.8%
associate-/r*98.7%
unpow-198.7%
unpow-198.7%
pow-sqr98.9%
metadata-eval98.9%
associate-/l*99.1%
Simplified99.1%
Final simplification99.5%
(FPCore (x)
:precision binary64
(let* ((t_0 (sin (* x 0.5))) (t_1 (* (sin x) (pow t_0 -2.0))))
(if (<= x -0.00058)
(* 2.6666666666666665 (/ 1.0 t_1))
(if (<= x 1.5e-19)
(/ t_0 (+ 0.75 (* -0.09375 (* x x))))
(/ 2.6666666666666665 t_1)))))
double code(double x) {
double t_0 = sin((x * 0.5));
double t_1 = sin(x) * pow(t_0, -2.0);
double tmp;
if (x <= -0.00058) {
tmp = 2.6666666666666665 * (1.0 / t_1);
} else if (x <= 1.5e-19) {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 2.6666666666666665 / t_1;
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sin((x * 0.5d0))
t_1 = sin(x) * (t_0 ** (-2.0d0))
if (x <= (-0.00058d0)) then
tmp = 2.6666666666666665d0 * (1.0d0 / t_1)
else if (x <= 1.5d-19) then
tmp = t_0 / (0.75d0 + ((-0.09375d0) * (x * x)))
else
tmp = 2.6666666666666665d0 / t_1
end if
code = tmp
end function
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
double t_1 = Math.sin(x) * Math.pow(t_0, -2.0);
double tmp;
if (x <= -0.00058) {
tmp = 2.6666666666666665 * (1.0 / t_1);
} else if (x <= 1.5e-19) {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 2.6666666666666665 / t_1;
}
return tmp;
}
def code(x): t_0 = math.sin((x * 0.5)) t_1 = math.sin(x) * math.pow(t_0, -2.0) tmp = 0 if x <= -0.00058: tmp = 2.6666666666666665 * (1.0 / t_1) elif x <= 1.5e-19: tmp = t_0 / (0.75 + (-0.09375 * (x * x))) else: tmp = 2.6666666666666665 / t_1 return tmp
function code(x) t_0 = sin(Float64(x * 0.5)) t_1 = Float64(sin(x) * (t_0 ^ -2.0)) tmp = 0.0 if (x <= -0.00058) tmp = Float64(2.6666666666666665 * Float64(1.0 / t_1)); elseif (x <= 1.5e-19) tmp = Float64(t_0 / Float64(0.75 + Float64(-0.09375 * Float64(x * x)))); else tmp = Float64(2.6666666666666665 / t_1); end return tmp end
function tmp_2 = code(x) t_0 = sin((x * 0.5)); t_1 = sin(x) * (t_0 ^ -2.0); tmp = 0.0; if (x <= -0.00058) tmp = 2.6666666666666665 * (1.0 / t_1); elseif (x <= 1.5e-19) tmp = t_0 / (0.75 + (-0.09375 * (x * x))); else tmp = 2.6666666666666665 / t_1; end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[x], $MachinePrecision] * N[Power[t$95$0, -2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.00058], N[(2.6666666666666665 * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-19], N[(t$95$0 / N[(0.75 + N[(-0.09375 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.6666666666666665 / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
t_1 := \sin x \cdot {t_0}^{-2}\\
\mathbf{if}\;x \leq -0.00058:\\
\;\;\;\;2.6666666666666665 \cdot \frac{1}{t_1}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-19}:\\
\;\;\;\;\frac{t_0}{0.75 + -0.09375 \cdot \left(x \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2.6666666666666665}{t_1}\\
\end{array}
\end{array}
if x < -5.8e-4Initial program 98.9%
associate-/l*99.0%
associate-*r/99.0%
metadata-eval99.0%
associate-/l*98.9%
sqr-neg98.9%
sin-neg98.9%
distribute-lft-neg-out98.9%
sin-neg98.9%
distribute-lft-neg-out98.9%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
associate-*r/98.9%
clear-num99.0%
sqr-sin-a97.8%
add-sqr-sqrt68.6%
sqrt-unprod50.9%
swap-sqr50.9%
metadata-eval50.9%
metadata-eval50.9%
swap-sqr50.9%
sqrt-unprod0.0%
add-sqr-sqrt97.8%
sqr-sin-a99.0%
pow299.0%
Applied egg-rr99.0%
div-inv99.0%
pow-flip99.0%
metadata-eval99.0%
Applied egg-rr99.0%
if -5.8e-4 < x < 1.49999999999999996e-19Initial program 57.9%
associate-/l*99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-/l*57.9%
sqr-neg57.9%
sin-neg57.9%
distribute-lft-neg-out57.9%
sin-neg57.9%
distribute-lft-neg-out57.9%
associate-*r/99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
associate-*r/57.9%
clear-num57.8%
sqr-sin-a5.7%
add-sqr-sqrt3.2%
sqrt-unprod5.7%
swap-sqr5.7%
metadata-eval5.7%
metadata-eval5.7%
swap-sqr5.7%
sqrt-unprod2.5%
add-sqr-sqrt5.7%
sqr-sin-a57.8%
associate-/l/99.3%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
if 1.49999999999999996e-19 < x Initial program 98.8%
associate-/l*98.9%
associate-*r/98.8%
metadata-eval98.8%
associate-/l*98.7%
sqr-neg98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
associate-*r/98.7%
clear-num98.7%
sqr-sin-a93.9%
add-sqr-sqrt0.0%
sqrt-unprod44.6%
swap-sqr44.6%
metadata-eval44.6%
metadata-eval44.6%
swap-sqr44.6%
sqrt-unprod55.6%
add-sqr-sqrt93.9%
sqr-sin-a98.7%
associate-/l/98.8%
Applied egg-rr98.9%
div-inv99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Taylor expanded in x around inf 98.7%
associate-*r/98.8%
*-commutative98.8%
associate-/l*98.8%
unpow298.8%
remove-double-div98.8%
associate-*r/99.0%
*-rgt-identity99.0%
remove-double-div98.8%
associate-/r*98.7%
unpow-198.7%
unpow-198.7%
pow-sqr98.9%
metadata-eval98.9%
associate-/l*99.1%
Simplified99.1%
Final simplification99.5%
(FPCore (x)
:precision binary64
(let* ((t_0 (sin (* x 0.5))))
(if (<= x -0.00058)
(/ 1.0 (* 0.375 (/ (sin x) (pow t_0 2.0))))
(if (<= x 1.5e-19)
(/ t_0 (+ 0.75 (* -0.09375 (* x x))))
(/ 2.6666666666666665 (* (sin x) (pow t_0 -2.0)))))))
double code(double x) {
double t_0 = sin((x * 0.5));
double tmp;
if (x <= -0.00058) {
tmp = 1.0 / (0.375 * (sin(x) / pow(t_0, 2.0)));
} else if (x <= 1.5e-19) {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 2.6666666666666665 / (sin(x) * pow(t_0, -2.0));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = sin((x * 0.5d0))
if (x <= (-0.00058d0)) then
tmp = 1.0d0 / (0.375d0 * (sin(x) / (t_0 ** 2.0d0)))
else if (x <= 1.5d-19) then
tmp = t_0 / (0.75d0 + ((-0.09375d0) * (x * x)))
else
tmp = 2.6666666666666665d0 / (sin(x) * (t_0 ** (-2.0d0)))
end if
code = tmp
end function
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
double tmp;
if (x <= -0.00058) {
tmp = 1.0 / (0.375 * (Math.sin(x) / Math.pow(t_0, 2.0)));
} else if (x <= 1.5e-19) {
tmp = t_0 / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 2.6666666666666665 / (Math.sin(x) * Math.pow(t_0, -2.0));
}
return tmp;
}
def code(x): t_0 = math.sin((x * 0.5)) tmp = 0 if x <= -0.00058: tmp = 1.0 / (0.375 * (math.sin(x) / math.pow(t_0, 2.0))) elif x <= 1.5e-19: tmp = t_0 / (0.75 + (-0.09375 * (x * x))) else: tmp = 2.6666666666666665 / (math.sin(x) * math.pow(t_0, -2.0)) return tmp
function code(x) t_0 = sin(Float64(x * 0.5)) tmp = 0.0 if (x <= -0.00058) tmp = Float64(1.0 / Float64(0.375 * Float64(sin(x) / (t_0 ^ 2.0)))); elseif (x <= 1.5e-19) tmp = Float64(t_0 / Float64(0.75 + Float64(-0.09375 * Float64(x * x)))); else tmp = Float64(2.6666666666666665 / Float64(sin(x) * (t_0 ^ -2.0))); end return tmp end
function tmp_2 = code(x) t_0 = sin((x * 0.5)); tmp = 0.0; if (x <= -0.00058) tmp = 1.0 / (0.375 * (sin(x) / (t_0 ^ 2.0))); elseif (x <= 1.5e-19) tmp = t_0 / (0.75 + (-0.09375 * (x * x))); else tmp = 2.6666666666666665 / (sin(x) * (t_0 ^ -2.0)); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -0.00058], N[(1.0 / N[(0.375 * N[(N[Sin[x], $MachinePrecision] / N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-19], N[(t$95$0 / N[(0.75 + N[(-0.09375 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.6666666666666665 / N[(N[Sin[x], $MachinePrecision] * N[Power[t$95$0, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\mathbf{if}\;x \leq -0.00058:\\
\;\;\;\;\frac{1}{0.375 \cdot \frac{\sin x}{{t_0}^{2}}}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-19}:\\
\;\;\;\;\frac{t_0}{0.75 + -0.09375 \cdot \left(x \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2.6666666666666665}{\sin x \cdot {t_0}^{-2}}\\
\end{array}
\end{array}
if x < -5.8e-4Initial program 98.9%
associate-/l*99.0%
associate-*r/99.0%
metadata-eval99.0%
associate-/l*98.9%
sqr-neg98.9%
sin-neg98.9%
distribute-lft-neg-out98.9%
sin-neg98.9%
distribute-lft-neg-out98.9%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
associate-*r/98.9%
clear-num99.0%
sqr-sin-a97.8%
add-sqr-sqrt68.6%
sqrt-unprod50.9%
swap-sqr50.9%
metadata-eval50.9%
metadata-eval50.9%
swap-sqr50.9%
sqrt-unprod0.0%
add-sqr-sqrt97.8%
sqr-sin-a99.0%
associate-/l/99.0%
Applied egg-rr99.1%
if -5.8e-4 < x < 1.49999999999999996e-19Initial program 57.9%
associate-/l*99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-/l*57.9%
sqr-neg57.9%
sin-neg57.9%
distribute-lft-neg-out57.9%
sin-neg57.9%
distribute-lft-neg-out57.9%
associate-*r/99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
associate-*r/57.9%
clear-num57.8%
sqr-sin-a5.7%
add-sqr-sqrt3.2%
sqrt-unprod5.7%
swap-sqr5.7%
metadata-eval5.7%
metadata-eval5.7%
swap-sqr5.7%
sqrt-unprod2.5%
add-sqr-sqrt5.7%
sqr-sin-a57.8%
associate-/l/99.3%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
if 1.49999999999999996e-19 < x Initial program 98.8%
associate-/l*98.9%
associate-*r/98.8%
metadata-eval98.8%
associate-/l*98.7%
sqr-neg98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
associate-*r/98.7%
clear-num98.7%
sqr-sin-a93.9%
add-sqr-sqrt0.0%
sqrt-unprod44.6%
swap-sqr44.6%
metadata-eval44.6%
metadata-eval44.6%
swap-sqr44.6%
sqrt-unprod55.6%
add-sqr-sqrt93.9%
sqr-sin-a98.7%
associate-/l/98.8%
Applied egg-rr98.9%
div-inv99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Taylor expanded in x around inf 98.7%
associate-*r/98.8%
*-commutative98.8%
associate-/l*98.8%
unpow298.8%
remove-double-div98.8%
associate-*r/99.0%
*-rgt-identity99.0%
remove-double-div98.8%
associate-/r*98.7%
unpow-198.7%
unpow-198.7%
pow-sqr98.9%
metadata-eval98.9%
associate-/l*99.1%
Simplified99.1%
Final simplification99.5%
(FPCore (x) :precision binary64 (let* ((t_0 (sin (* x -0.5)))) (* 2.6666666666666665 (* t_0 (/ t_0 (sin x))))))
double code(double x) {
double t_0 = sin((x * -0.5));
return 2.6666666666666665 * (t_0 * (t_0 / sin(x)));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = sin((x * (-0.5d0)))
code = 2.6666666666666665d0 * (t_0 * (t_0 / sin(x)))
end function
public static double code(double x) {
double t_0 = Math.sin((x * -0.5));
return 2.6666666666666665 * (t_0 * (t_0 / Math.sin(x)));
}
def code(x): t_0 = math.sin((x * -0.5)) return 2.6666666666666665 * (t_0 * (t_0 / math.sin(x)))
function code(x) t_0 = sin(Float64(x * -0.5)) return Float64(2.6666666666666665 * Float64(t_0 * Float64(t_0 / sin(x)))) end
function tmp = code(x) t_0 = sin((x * -0.5)); tmp = 2.6666666666666665 * (t_0 * (t_0 / sin(x))); end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * -0.5), $MachinePrecision]], $MachinePrecision]}, N[(2.6666666666666665 * N[(t$95$0 * N[(t$95$0 / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot -0.5\right)\\
2.6666666666666665 \cdot \left(t_0 \cdot \frac{t_0}{\sin x}\right)
\end{array}
\end{array}
Initial program 79.2%
associate-/l*99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-/l*79.2%
sqr-neg79.2%
sin-neg79.2%
distribute-lft-neg-out79.2%
sin-neg79.2%
distribute-lft-neg-out79.2%
associate-*r/99.1%
distribute-lft-neg-out99.1%
distribute-rgt-neg-in99.1%
metadata-eval99.1%
distribute-lft-neg-out99.1%
distribute-rgt-neg-in99.1%
metadata-eval99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x) :precision binary64 (let* ((t_0 (sin (* x -0.5)))) (* 2.6666666666666665 (/ t_0 (/ (sin x) t_0)))))
double code(double x) {
double t_0 = sin((x * -0.5));
return 2.6666666666666665 * (t_0 / (sin(x) / t_0));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = sin((x * (-0.5d0)))
code = 2.6666666666666665d0 * (t_0 / (sin(x) / t_0))
end function
public static double code(double x) {
double t_0 = Math.sin((x * -0.5));
return 2.6666666666666665 * (t_0 / (Math.sin(x) / t_0));
}
def code(x): t_0 = math.sin((x * -0.5)) return 2.6666666666666665 * (t_0 / (math.sin(x) / t_0))
function code(x) t_0 = sin(Float64(x * -0.5)) return Float64(2.6666666666666665 * Float64(t_0 / Float64(sin(x) / t_0))) end
function tmp = code(x) t_0 = sin((x * -0.5)); tmp = 2.6666666666666665 * (t_0 / (sin(x) / t_0)); end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * -0.5), $MachinePrecision]], $MachinePrecision]}, N[(2.6666666666666665 * N[(t$95$0 / N[(N[Sin[x], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot -0.5\right)\\
2.6666666666666665 \cdot \frac{t_0}{\frac{\sin x}{t_0}}
\end{array}
\end{array}
Initial program 79.2%
associate-/l*99.2%
associate-*r/99.2%
metadata-eval99.2%
remove-double-neg99.2%
sin-neg99.2%
distribute-lft-neg-out99.2%
neg-mul-199.2%
*-commutative99.2%
associate-/l*99.2%
distribute-lft-neg-out99.2%
distribute-rgt-neg-in99.2%
metadata-eval99.2%
associate-/l/99.2%
neg-mul-199.2%
sin-neg99.2%
distribute-lft-neg-out99.2%
distribute-lft-neg-out99.2%
distribute-rgt-neg-in99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x) :precision binary64 (let* ((t_0 (sin (* x 0.5)))) (/ t_0 (* (sin x) (/ 0.375 t_0)))))
double code(double x) {
double t_0 = sin((x * 0.5));
return t_0 / (sin(x) * (0.375 / t_0));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = sin((x * 0.5d0))
code = t_0 / (sin(x) * (0.375d0 / t_0))
end function
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
return t_0 / (Math.sin(x) * (0.375 / t_0));
}
def code(x): t_0 = math.sin((x * 0.5)) return t_0 / (math.sin(x) * (0.375 / t_0))
function code(x) t_0 = sin(Float64(x * 0.5)) return Float64(t_0 / Float64(sin(x) * Float64(0.375 / t_0))) end
function tmp = code(x) t_0 = sin((x * 0.5)); tmp = t_0 / (sin(x) * (0.375 / t_0)); end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(t$95$0 / N[(N[Sin[x], $MachinePrecision] * N[(0.375 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\frac{t_0}{\sin x \cdot \frac{0.375}{t_0}}
\end{array}
\end{array}
Initial program 79.2%
associate-/l*99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-/l*79.2%
sqr-neg79.2%
sin-neg79.2%
distribute-lft-neg-out79.2%
sin-neg79.2%
distribute-lft-neg-out79.2%
associate-*r/99.1%
distribute-lft-neg-out99.1%
distribute-rgt-neg-in99.1%
metadata-eval99.1%
distribute-lft-neg-out99.1%
distribute-rgt-neg-in99.1%
metadata-eval99.1%
Simplified99.1%
associate-*r/79.2%
clear-num79.1%
sqr-sin-a52.6%
add-sqr-sqrt20.0%
sqrt-unprod27.6%
swap-sqr27.6%
metadata-eval27.6%
metadata-eval27.6%
swap-sqr27.6%
sqrt-unprod15.1%
add-sqr-sqrt52.6%
sqr-sin-a79.1%
associate-/l/99.1%
Applied egg-rr99.5%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in x around inf 99.6%
associate-*r/99.4%
*-commutative99.4%
*-commutative99.4%
associate-*r/99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x) :precision binary64 (if (or (<= x -0.0054) (not (<= x 0.0058))) (/ 2.6666666666666665 (/ (sin x) (- 0.5 (/ (cos x) 2.0)))) (/ (sin (* x 0.5)) (+ 0.75 (* -0.09375 (* x x))))))
double code(double x) {
double tmp;
if ((x <= -0.0054) || !(x <= 0.0058)) {
tmp = 2.6666666666666665 / (sin(x) / (0.5 - (cos(x) / 2.0)));
} else {
tmp = sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x)));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-0.0054d0)) .or. (.not. (x <= 0.0058d0))) then
tmp = 2.6666666666666665d0 / (sin(x) / (0.5d0 - (cos(x) / 2.0d0)))
else
tmp = sin((x * 0.5d0)) / (0.75d0 + ((-0.09375d0) * (x * x)))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if ((x <= -0.0054) || !(x <= 0.0058)) {
tmp = 2.6666666666666665 / (Math.sin(x) / (0.5 - (Math.cos(x) / 2.0)));
} else {
tmp = Math.sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x)));
}
return tmp;
}
def code(x): tmp = 0 if (x <= -0.0054) or not (x <= 0.0058): tmp = 2.6666666666666665 / (math.sin(x) / (0.5 - (math.cos(x) / 2.0))) else: tmp = math.sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x))) return tmp
function code(x) tmp = 0.0 if ((x <= -0.0054) || !(x <= 0.0058)) tmp = Float64(2.6666666666666665 / Float64(sin(x) / Float64(0.5 - Float64(cos(x) / 2.0)))); else tmp = Float64(sin(Float64(x * 0.5)) / Float64(0.75 + Float64(-0.09375 * Float64(x * x)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x <= -0.0054) || ~((x <= 0.0058))) tmp = 2.6666666666666665 / (sin(x) / (0.5 - (cos(x) / 2.0))); else tmp = sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x))); end tmp_2 = tmp; end
code[x_] := If[Or[LessEqual[x, -0.0054], N[Not[LessEqual[x, 0.0058]], $MachinePrecision]], N[(2.6666666666666665 / N[(N[Sin[x], $MachinePrecision] / N[(0.5 - N[(N[Cos[x], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] / N[(0.75 + N[(-0.09375 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0054 \lor \neg \left(x \leq 0.0058\right):\\
\;\;\;\;\frac{2.6666666666666665}{\frac{\sin x}{0.5 - \frac{\cos x}{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(x \cdot 0.5\right)}{0.75 + -0.09375 \cdot \left(x \cdot x\right)}\\
\end{array}
\end{array}
if x < -0.0054000000000000003 or 0.0058 < x Initial program 98.8%
associate-/l*98.9%
associate-*r/98.9%
metadata-eval98.9%
associate-/l*98.8%
sqr-neg98.8%
sin-neg98.8%
distribute-lft-neg-out98.8%
sin-neg98.8%
distribute-lft-neg-out98.8%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
*-commutative98.8%
associate-/r/98.9%
clear-num98.9%
un-div-inv98.9%
associate-/l/98.9%
sqr-sin-a98.2%
add-sqr-sqrt36.4%
sqrt-unprod49.0%
swap-sqr49.0%
metadata-eval49.0%
metadata-eval49.0%
swap-sqr49.0%
sqrt-unprod27.3%
add-sqr-sqrt98.2%
Applied egg-rr98.9%
unpow298.9%
sin-mult98.2%
Applied egg-rr98.2%
div-sub98.2%
+-inverses98.2%
cos-098.2%
metadata-eval98.2%
distribute-lft-out98.2%
metadata-eval98.2%
*-rgt-identity98.2%
Simplified98.2%
if -0.0054000000000000003 < x < 0.0058Initial program 58.9%
associate-/l*99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-/l*58.9%
sqr-neg58.9%
sin-neg58.9%
distribute-lft-neg-out58.9%
sin-neg58.9%
distribute-lft-neg-out58.9%
associate-*r/99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
associate-*r/58.9%
clear-num58.8%
sqr-sin-a5.6%
add-sqr-sqrt3.1%
sqrt-unprod5.6%
swap-sqr5.6%
metadata-eval5.6%
metadata-eval5.6%
swap-sqr5.6%
sqrt-unprod2.5%
add-sqr-sqrt5.6%
sqr-sin-a58.8%
associate-/l/99.3%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
Final simplification99.1%
(FPCore (x)
:precision binary64
(let* ((t_0 (/ (sin x) (- 0.5 (/ (cos x) 2.0)))))
(if (<= x -0.0054)
(* 2.6666666666666665 (/ 1.0 t_0))
(if (<= x 0.0058)
(/ (sin (* x 0.5)) (+ 0.75 (* -0.09375 (* x x))))
(/ 2.6666666666666665 t_0)))))
double code(double x) {
double t_0 = sin(x) / (0.5 - (cos(x) / 2.0));
double tmp;
if (x <= -0.0054) {
tmp = 2.6666666666666665 * (1.0 / t_0);
} else if (x <= 0.0058) {
tmp = sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 2.6666666666666665 / t_0;
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = sin(x) / (0.5d0 - (cos(x) / 2.0d0))
if (x <= (-0.0054d0)) then
tmp = 2.6666666666666665d0 * (1.0d0 / t_0)
else if (x <= 0.0058d0) then
tmp = sin((x * 0.5d0)) / (0.75d0 + ((-0.09375d0) * (x * x)))
else
tmp = 2.6666666666666665d0 / t_0
end if
code = tmp
end function
public static double code(double x) {
double t_0 = Math.sin(x) / (0.5 - (Math.cos(x) / 2.0));
double tmp;
if (x <= -0.0054) {
tmp = 2.6666666666666665 * (1.0 / t_0);
} else if (x <= 0.0058) {
tmp = Math.sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 2.6666666666666665 / t_0;
}
return tmp;
}
def code(x): t_0 = math.sin(x) / (0.5 - (math.cos(x) / 2.0)) tmp = 0 if x <= -0.0054: tmp = 2.6666666666666665 * (1.0 / t_0) elif x <= 0.0058: tmp = math.sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x))) else: tmp = 2.6666666666666665 / t_0 return tmp
function code(x) t_0 = Float64(sin(x) / Float64(0.5 - Float64(cos(x) / 2.0))) tmp = 0.0 if (x <= -0.0054) tmp = Float64(2.6666666666666665 * Float64(1.0 / t_0)); elseif (x <= 0.0058) tmp = Float64(sin(Float64(x * 0.5)) / Float64(0.75 + Float64(-0.09375 * Float64(x * x)))); else tmp = Float64(2.6666666666666665 / t_0); end return tmp end
function tmp_2 = code(x) t_0 = sin(x) / (0.5 - (cos(x) / 2.0)); tmp = 0.0; if (x <= -0.0054) tmp = 2.6666666666666665 * (1.0 / t_0); elseif (x <= 0.0058) tmp = sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x))); else tmp = 2.6666666666666665 / t_0; end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] / N[(0.5 - N[(N[Cos[x], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.0054], N[(2.6666666666666665 * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.0058], N[(N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] / N[(0.75 + N[(-0.09375 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.6666666666666665 / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x}{0.5 - \frac{\cos x}{2}}\\
\mathbf{if}\;x \leq -0.0054:\\
\;\;\;\;2.6666666666666665 \cdot \frac{1}{t_0}\\
\mathbf{elif}\;x \leq 0.0058:\\
\;\;\;\;\frac{\sin \left(x \cdot 0.5\right)}{0.75 + -0.09375 \cdot \left(x \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2.6666666666666665}{t_0}\\
\end{array}
\end{array}
if x < -0.0054000000000000003Initial program 98.9%
associate-/l*99.0%
associate-*r/99.0%
metadata-eval99.0%
associate-/l*98.9%
sqr-neg98.9%
sin-neg98.9%
distribute-lft-neg-out98.9%
sin-neg98.9%
distribute-lft-neg-out98.9%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
associate-*r/98.9%
clear-num99.0%
sqr-sin-a97.8%
add-sqr-sqrt68.6%
sqrt-unprod50.9%
swap-sqr50.9%
metadata-eval50.9%
metadata-eval50.9%
swap-sqr50.9%
sqrt-unprod0.0%
add-sqr-sqrt97.8%
sqr-sin-a99.0%
pow299.0%
Applied egg-rr99.0%
unpow299.0%
sin-mult97.8%
Applied egg-rr97.8%
div-sub97.8%
+-inverses97.8%
cos-097.8%
metadata-eval97.8%
distribute-lft-out97.8%
metadata-eval97.8%
*-rgt-identity97.8%
Simplified97.8%
if -0.0054000000000000003 < x < 0.0058Initial program 58.9%
associate-/l*99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-/l*58.9%
sqr-neg58.9%
sin-neg58.9%
distribute-lft-neg-out58.9%
sin-neg58.9%
distribute-lft-neg-out58.9%
associate-*r/99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
associate-*r/58.9%
clear-num58.8%
sqr-sin-a5.6%
add-sqr-sqrt3.1%
sqrt-unprod5.6%
swap-sqr5.6%
metadata-eval5.6%
metadata-eval5.6%
swap-sqr5.6%
sqrt-unprod2.5%
add-sqr-sqrt5.6%
sqr-sin-a58.8%
associate-/l/99.3%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
unpow2100.0%
Simplified100.0%
if 0.0058 < x Initial program 98.8%
associate-/l*98.8%
associate-*r/98.8%
metadata-eval98.8%
associate-/l*98.7%
sqr-neg98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
*-commutative98.8%
associate-/r/98.8%
clear-num98.8%
un-div-inv98.8%
associate-/l/98.8%
sqr-sin-a98.6%
add-sqr-sqrt0.0%
sqrt-unprod46.8%
swap-sqr46.8%
metadata-eval46.8%
metadata-eval46.8%
swap-sqr46.8%
sqrt-unprod58.2%
add-sqr-sqrt98.6%
Applied egg-rr98.8%
unpow298.8%
sin-mult98.6%
Applied egg-rr98.6%
div-sub98.6%
+-inverses98.6%
cos-098.6%
metadata-eval98.6%
distribute-lft-out98.6%
metadata-eval98.6%
*-rgt-identity98.6%
Simplified98.6%
Final simplification99.1%
(FPCore (x) :precision binary64 (if (or (<= x -7.6) (not (<= x 9600000.0))) (/ 8.0 (sin x)) (/ (sin (* x 0.5)) (+ 0.75 (* -0.09375 (* x x))))))
double code(double x) {
double tmp;
if ((x <= -7.6) || !(x <= 9600000.0)) {
tmp = 8.0 / sin(x);
} else {
tmp = sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x)));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-7.6d0)) .or. (.not. (x <= 9600000.0d0))) then
tmp = 8.0d0 / sin(x)
else
tmp = sin((x * 0.5d0)) / (0.75d0 + ((-0.09375d0) * (x * x)))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if ((x <= -7.6) || !(x <= 9600000.0)) {
tmp = 8.0 / Math.sin(x);
} else {
tmp = Math.sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x)));
}
return tmp;
}
def code(x): tmp = 0 if (x <= -7.6) or not (x <= 9600000.0): tmp = 8.0 / math.sin(x) else: tmp = math.sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x))) return tmp
function code(x) tmp = 0.0 if ((x <= -7.6) || !(x <= 9600000.0)) tmp = Float64(8.0 / sin(x)); else tmp = Float64(sin(Float64(x * 0.5)) / Float64(0.75 + Float64(-0.09375 * Float64(x * x)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x <= -7.6) || ~((x <= 9600000.0))) tmp = 8.0 / sin(x); else tmp = sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x))); end tmp_2 = tmp; end
code[x_] := If[Or[LessEqual[x, -7.6], N[Not[LessEqual[x, 9600000.0]], $MachinePrecision]], N[(8.0 / N[Sin[x], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] / N[(0.75 + N[(-0.09375 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \lor \neg \left(x \leq 9600000\right):\\
\;\;\;\;\frac{8}{\sin x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(x \cdot 0.5\right)}{0.75 + -0.09375 \cdot \left(x \cdot x\right)}\\
\end{array}
\end{array}
if x < -7.5999999999999996 or 9.6e6 < x Initial program 98.8%
associate-/l*98.9%
associate-*r/98.9%
metadata-eval98.9%
associate-/l*98.8%
sqr-neg98.8%
sin-neg98.8%
distribute-lft-neg-out98.8%
sin-neg98.8%
distribute-lft-neg-out98.8%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
associate-*r/98.8%
clear-num98.8%
sqr-sin-a98.2%
add-sqr-sqrt37.2%
sqrt-unprod45.7%
swap-sqr45.7%
metadata-eval45.7%
metadata-eval45.7%
swap-sqr45.7%
sqrt-unprod24.4%
add-sqr-sqrt98.2%
sqr-sin-a98.8%
pow298.8%
Applied egg-rr98.8%
div-inv98.8%
pow-flip98.9%
metadata-eval98.9%
Applied egg-rr98.9%
Taylor expanded in x around 0 16.1%
associate-*r/16.1%
metadata-eval16.1%
unpow216.1%
Simplified16.1%
Taylor expanded in x around inf 16.1%
if -7.5999999999999996 < x < 9.6e6Initial program 61.3%
associate-/l*99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-/l*61.3%
sqr-neg61.3%
sin-neg61.3%
distribute-lft-neg-out61.3%
sin-neg61.3%
distribute-lft-neg-out61.3%
associate-*r/99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
associate-*r/61.3%
clear-num61.2%
sqr-sin-a11.1%
add-sqr-sqrt4.4%
sqrt-unprod11.1%
swap-sqr11.1%
metadata-eval11.1%
metadata-eval11.1%
swap-sqr11.1%
sqrt-unprod6.6%
add-sqr-sqrt11.1%
sqr-sin-a61.2%
associate-/l/99.3%
Applied egg-rr99.9%
Taylor expanded in x around 0 95.4%
unpow295.4%
Simplified95.4%
Final simplification57.6%
(FPCore (x)
:precision binary64
(if (<= x -4e-5)
(*
2.6666666666666665
(/ 1.0 (* (sin x) (+ 0.3333333333333333 (/ 4.0 (* x x))))))
(if (<= x 9600000.0)
(/ (sin (* x 0.5)) (+ 0.75 (* -0.09375 (* x x))))
(/ 8.0 (sin x)))))
double code(double x) {
double tmp;
if (x <= -4e-5) {
tmp = 2.6666666666666665 * (1.0 / (sin(x) * (0.3333333333333333 + (4.0 / (x * x)))));
} else if (x <= 9600000.0) {
tmp = sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 8.0 / sin(x);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-4d-5)) then
tmp = 2.6666666666666665d0 * (1.0d0 / (sin(x) * (0.3333333333333333d0 + (4.0d0 / (x * x)))))
else if (x <= 9600000.0d0) then
tmp = sin((x * 0.5d0)) / (0.75d0 + ((-0.09375d0) * (x * x)))
else
tmp = 8.0d0 / sin(x)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= -4e-5) {
tmp = 2.6666666666666665 * (1.0 / (Math.sin(x) * (0.3333333333333333 + (4.0 / (x * x)))));
} else if (x <= 9600000.0) {
tmp = Math.sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x)));
} else {
tmp = 8.0 / Math.sin(x);
}
return tmp;
}
def code(x): tmp = 0 if x <= -4e-5: tmp = 2.6666666666666665 * (1.0 / (math.sin(x) * (0.3333333333333333 + (4.0 / (x * x))))) elif x <= 9600000.0: tmp = math.sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x))) else: tmp = 8.0 / math.sin(x) return tmp
function code(x) tmp = 0.0 if (x <= -4e-5) tmp = Float64(2.6666666666666665 * Float64(1.0 / Float64(sin(x) * Float64(0.3333333333333333 + Float64(4.0 / Float64(x * x)))))); elseif (x <= 9600000.0) tmp = Float64(sin(Float64(x * 0.5)) / Float64(0.75 + Float64(-0.09375 * Float64(x * x)))); else tmp = Float64(8.0 / sin(x)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= -4e-5) tmp = 2.6666666666666665 * (1.0 / (sin(x) * (0.3333333333333333 + (4.0 / (x * x))))); elseif (x <= 9600000.0) tmp = sin((x * 0.5)) / (0.75 + (-0.09375 * (x * x))); else tmp = 8.0 / sin(x); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, -4e-5], N[(2.6666666666666665 * N[(1.0 / N[(N[Sin[x], $MachinePrecision] * N[(0.3333333333333333 + N[(4.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9600000.0], N[(N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] / N[(0.75 + N[(-0.09375 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(8.0 / N[Sin[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-5}:\\
\;\;\;\;2.6666666666666665 \cdot \frac{1}{\sin x \cdot \left(0.3333333333333333 + \frac{4}{x \cdot x}\right)}\\
\mathbf{elif}\;x \leq 9600000:\\
\;\;\;\;\frac{\sin \left(x \cdot 0.5\right)}{0.75 + -0.09375 \cdot \left(x \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{8}{\sin x}\\
\end{array}
\end{array}
if x < -4.00000000000000033e-5Initial program 98.9%
associate-/l*99.0%
associate-*r/99.0%
metadata-eval99.0%
associate-/l*98.9%
sqr-neg98.9%
sin-neg98.9%
distribute-lft-neg-out98.9%
sin-neg98.9%
distribute-lft-neg-out98.9%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
associate-*r/98.9%
clear-num98.9%
sqr-sin-a97.3%
add-sqr-sqrt68.5%
sqrt-unprod51.0%
swap-sqr51.0%
metadata-eval51.0%
metadata-eval51.0%
swap-sqr51.0%
sqrt-unprod0.0%
add-sqr-sqrt97.3%
sqr-sin-a98.9%
pow298.9%
Applied egg-rr98.9%
div-inv99.0%
pow-flip99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Taylor expanded in x around 0 17.7%
associate-*r/17.7%
metadata-eval17.7%
unpow217.7%
Simplified17.7%
if -4.00000000000000033e-5 < x < 9.6e6Initial program 60.5%
associate-/l*99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-/l*60.4%
sqr-neg60.4%
sin-neg60.4%
distribute-lft-neg-out60.4%
sin-neg60.4%
distribute-lft-neg-out60.4%
associate-*r/99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
associate-*r/60.4%
clear-num60.4%
sqr-sin-a9.4%
add-sqr-sqrt2.5%
sqrt-unprod9.4%
swap-sqr9.4%
metadata-eval9.4%
metadata-eval9.4%
swap-sqr9.4%
sqrt-unprod6.8%
add-sqr-sqrt9.4%
sqr-sin-a60.4%
associate-/l/99.3%
Applied egg-rr99.9%
Taylor expanded in x around 0 96.4%
unpow296.4%
Simplified96.4%
if 9.6e6 < x Initial program 98.8%
associate-/l*98.8%
associate-*r/98.8%
metadata-eval98.8%
associate-/l*98.7%
sqr-neg98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
sin-neg98.7%
distribute-lft-neg-out98.7%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
associate-*r/98.7%
clear-num98.7%
sqr-sin-a98.5%
add-sqr-sqrt0.0%
sqrt-unprod41.1%
swap-sqr41.1%
metadata-eval41.1%
metadata-eval41.1%
swap-sqr41.1%
sqrt-unprod54.1%
add-sqr-sqrt98.5%
sqr-sin-a98.7%
pow298.7%
Applied egg-rr98.7%
div-inv98.6%
pow-flip98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Taylor expanded in x around 0 16.3%
associate-*r/16.3%
metadata-eval16.3%
unpow216.3%
Simplified16.3%
Taylor expanded in x around inf 16.3%
Final simplification57.6%
(FPCore (x) :precision binary64 (if (or (<= x -27000.0) (not (<= x 9600000.0))) (/ 8.0 (sin x)) (/ 2.6666666666666665 (+ (* x -0.3333333333333333) (* 4.0 (/ 1.0 x))))))
double code(double x) {
double tmp;
if ((x <= -27000.0) || !(x <= 9600000.0)) {
tmp = 8.0 / sin(x);
} else {
tmp = 2.6666666666666665 / ((x * -0.3333333333333333) + (4.0 * (1.0 / x)));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-27000.0d0)) .or. (.not. (x <= 9600000.0d0))) then
tmp = 8.0d0 / sin(x)
else
tmp = 2.6666666666666665d0 / ((x * (-0.3333333333333333d0)) + (4.0d0 * (1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if ((x <= -27000.0) || !(x <= 9600000.0)) {
tmp = 8.0 / Math.sin(x);
} else {
tmp = 2.6666666666666665 / ((x * -0.3333333333333333) + (4.0 * (1.0 / x)));
}
return tmp;
}
def code(x): tmp = 0 if (x <= -27000.0) or not (x <= 9600000.0): tmp = 8.0 / math.sin(x) else: tmp = 2.6666666666666665 / ((x * -0.3333333333333333) + (4.0 * (1.0 / x))) return tmp
function code(x) tmp = 0.0 if ((x <= -27000.0) || !(x <= 9600000.0)) tmp = Float64(8.0 / sin(x)); else tmp = Float64(2.6666666666666665 / Float64(Float64(x * -0.3333333333333333) + Float64(4.0 * Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x <= -27000.0) || ~((x <= 9600000.0))) tmp = 8.0 / sin(x); else tmp = 2.6666666666666665 / ((x * -0.3333333333333333) + (4.0 * (1.0 / x))); end tmp_2 = tmp; end
code[x_] := If[Or[LessEqual[x, -27000.0], N[Not[LessEqual[x, 9600000.0]], $MachinePrecision]], N[(8.0 / N[Sin[x], $MachinePrecision]), $MachinePrecision], N[(2.6666666666666665 / N[(N[(x * -0.3333333333333333), $MachinePrecision] + N[(4.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -27000 \lor \neg \left(x \leq 9600000\right):\\
\;\;\;\;\frac{8}{\sin x}\\
\mathbf{else}:\\
\;\;\;\;\frac{2.6666666666666665}{x \cdot -0.3333333333333333 + 4 \cdot \frac{1}{x}}\\
\end{array}
\end{array}
if x < -27000 or 9.6e6 < x Initial program 98.8%
associate-/l*98.9%
associate-*r/98.9%
metadata-eval98.9%
associate-/l*98.8%
sqr-neg98.8%
sin-neg98.8%
distribute-lft-neg-out98.8%
sin-neg98.8%
distribute-lft-neg-out98.8%
associate-*r/98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
distribute-lft-neg-out98.8%
distribute-rgt-neg-in98.8%
metadata-eval98.8%
Simplified98.8%
associate-*r/98.8%
clear-num98.8%
sqr-sin-a98.2%
add-sqr-sqrt37.2%
sqrt-unprod45.7%
swap-sqr45.7%
metadata-eval45.7%
metadata-eval45.7%
swap-sqr45.7%
sqrt-unprod24.4%
add-sqr-sqrt98.2%
sqr-sin-a98.8%
pow298.8%
Applied egg-rr98.8%
div-inv98.8%
pow-flip98.9%
metadata-eval98.9%
Applied egg-rr98.9%
Taylor expanded in x around 0 16.1%
associate-*r/16.1%
metadata-eval16.1%
unpow216.1%
Simplified16.1%
Taylor expanded in x around inf 16.1%
if -27000 < x < 9.6e6Initial program 61.3%
associate-/l*99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-/l*61.3%
sqr-neg61.3%
sin-neg61.3%
distribute-lft-neg-out61.3%
sin-neg61.3%
distribute-lft-neg-out61.3%
associate-*r/99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
associate-/r/99.4%
clear-num99.3%
un-div-inv99.4%
associate-/l/61.3%
sqr-sin-a11.1%
add-sqr-sqrt4.4%
sqrt-unprod11.1%
swap-sqr11.1%
metadata-eval11.1%
metadata-eval11.1%
swap-sqr11.1%
sqrt-unprod6.6%
add-sqr-sqrt11.1%
Applied egg-rr61.3%
Taylor expanded in x around 0 94.9%
Final simplification57.4%
(FPCore (x) :precision binary64 (/ (sin (* x 0.5)) 0.75))
double code(double x) {
return sin((x * 0.5)) / 0.75;
}
real(8) function code(x)
real(8), intent (in) :: x
code = sin((x * 0.5d0)) / 0.75d0
end function
public static double code(double x) {
return Math.sin((x * 0.5)) / 0.75;
}
def code(x): return math.sin((x * 0.5)) / 0.75
function code(x) return Float64(sin(Float64(x * 0.5)) / 0.75) end
function tmp = code(x) tmp = sin((x * 0.5)) / 0.75; end
code[x_] := N[(N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] / 0.75), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin \left(x \cdot 0.5\right)}{0.75}
\end{array}
Initial program 79.2%
associate-/l*99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-/l*79.2%
sqr-neg79.2%
sin-neg79.2%
distribute-lft-neg-out79.2%
sin-neg79.2%
distribute-lft-neg-out79.2%
associate-*r/99.1%
distribute-lft-neg-out99.1%
distribute-rgt-neg-in99.1%
metadata-eval99.1%
distribute-lft-neg-out99.1%
distribute-rgt-neg-in99.1%
metadata-eval99.1%
Simplified99.1%
associate-*r/79.2%
clear-num79.1%
sqr-sin-a52.6%
add-sqr-sqrt20.0%
sqrt-unprod27.6%
swap-sqr27.6%
metadata-eval27.6%
metadata-eval27.6%
swap-sqr27.6%
sqrt-unprod15.1%
add-sqr-sqrt52.6%
sqr-sin-a79.1%
associate-/l/99.1%
Applied egg-rr99.5%
Taylor expanded in x around 0 55.1%
Final simplification55.1%
(FPCore (x) :precision binary64 (/ 2.6666666666666665 (+ (* x -0.3333333333333333) (* 4.0 (/ 1.0 x)))))
double code(double x) {
return 2.6666666666666665 / ((x * -0.3333333333333333) + (4.0 * (1.0 / x)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 2.6666666666666665d0 / ((x * (-0.3333333333333333d0)) + (4.0d0 * (1.0d0 / x)))
end function
public static double code(double x) {
return 2.6666666666666665 / ((x * -0.3333333333333333) + (4.0 * (1.0 / x)));
}
def code(x): return 2.6666666666666665 / ((x * -0.3333333333333333) + (4.0 * (1.0 / x)))
function code(x) return Float64(2.6666666666666665 / Float64(Float64(x * -0.3333333333333333) + Float64(4.0 * Float64(1.0 / x)))) end
function tmp = code(x) tmp = 2.6666666666666665 / ((x * -0.3333333333333333) + (4.0 * (1.0 / x))); end
code[x_] := N[(2.6666666666666665 / N[(N[(x * -0.3333333333333333), $MachinePrecision] + N[(4.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2.6666666666666665}{x \cdot -0.3333333333333333 + 4 \cdot \frac{1}{x}}
\end{array}
Initial program 79.2%
associate-/l*99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-/l*79.2%
sqr-neg79.2%
sin-neg79.2%
distribute-lft-neg-out79.2%
sin-neg79.2%
distribute-lft-neg-out79.2%
associate-*r/99.1%
distribute-lft-neg-out99.1%
distribute-rgt-neg-in99.1%
metadata-eval99.1%
distribute-lft-neg-out99.1%
distribute-rgt-neg-in99.1%
metadata-eval99.1%
Simplified99.1%
*-commutative99.1%
associate-/r/99.2%
clear-num99.1%
un-div-inv99.1%
associate-/l/79.2%
sqr-sin-a52.6%
add-sqr-sqrt20.0%
sqrt-unprod27.6%
swap-sqr27.6%
metadata-eval27.6%
metadata-eval27.6%
swap-sqr27.6%
sqrt-unprod15.1%
add-sqr-sqrt52.6%
Applied egg-rr79.2%
Taylor expanded in x around 0 51.5%
Final simplification51.5%
(FPCore (x) :precision binary64 (/ 2.6666666666666665 (/ 4.0 x)))
double code(double x) {
return 2.6666666666666665 / (4.0 / x);
}
real(8) function code(x)
real(8), intent (in) :: x
code = 2.6666666666666665d0 / (4.0d0 / x)
end function
public static double code(double x) {
return 2.6666666666666665 / (4.0 / x);
}
def code(x): return 2.6666666666666665 / (4.0 / x)
function code(x) return Float64(2.6666666666666665 / Float64(4.0 / x)) end
function tmp = code(x) tmp = 2.6666666666666665 / (4.0 / x); end
code[x_] := N[(2.6666666666666665 / N[(4.0 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2.6666666666666665}{\frac{4}{x}}
\end{array}
Initial program 79.2%
associate-/l*99.2%
associate-*r/99.2%
metadata-eval99.2%
associate-/l*79.2%
sqr-neg79.2%
sin-neg79.2%
distribute-lft-neg-out79.2%
sin-neg79.2%
distribute-lft-neg-out79.2%
associate-*r/99.1%
distribute-lft-neg-out99.1%
distribute-rgt-neg-in99.1%
metadata-eval99.1%
distribute-lft-neg-out99.1%
distribute-rgt-neg-in99.1%
metadata-eval99.1%
Simplified99.1%
associate-*r/79.2%
clear-num79.1%
sqr-sin-a52.6%
add-sqr-sqrt20.0%
sqrt-unprod27.6%
swap-sqr27.6%
metadata-eval27.6%
metadata-eval27.6%
swap-sqr27.6%
sqrt-unprod15.1%
add-sqr-sqrt52.6%
sqr-sin-a79.1%
pow279.1%
Applied egg-rr79.1%
Taylor expanded in x around 0 50.8%
un-div-inv50.8%
Applied egg-rr50.8%
Final simplification50.8%
(FPCore (x) :precision binary64 (* x 0.6666666666666666))
double code(double x) {
return x * 0.6666666666666666;
}
real(8) function code(x)
real(8), intent (in) :: x
code = x * 0.6666666666666666d0
end function
public static double code(double x) {
return x * 0.6666666666666666;
}
def code(x): return x * 0.6666666666666666
function code(x) return Float64(x * 0.6666666666666666) end
function tmp = code(x) tmp = x * 0.6666666666666666; end
code[x_] := N[(x * 0.6666666666666666), $MachinePrecision]
\begin{array}{l}
\\
x \cdot 0.6666666666666666
\end{array}
Initial program 79.2%
associate-/l*99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 50.8%
*-commutative50.8%
Simplified50.8%
Final simplification50.8%
(FPCore (x) :precision binary64 (let* ((t_0 (sin (* x 0.5)))) (/ (/ (* 8.0 t_0) 3.0) (/ (sin x) t_0))))
double code(double x) {
double t_0 = sin((x * 0.5));
return ((8.0 * t_0) / 3.0) / (sin(x) / t_0);
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = sin((x * 0.5d0))
code = ((8.0d0 * t_0) / 3.0d0) / (sin(x) / t_0)
end function
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
return ((8.0 * t_0) / 3.0) / (Math.sin(x) / t_0);
}
def code(x): t_0 = math.sin((x * 0.5)) return ((8.0 * t_0) / 3.0) / (math.sin(x) / t_0)
function code(x) t_0 = sin(Float64(x * 0.5)) return Float64(Float64(Float64(8.0 * t_0) / 3.0) / Float64(sin(x) / t_0)) end
function tmp = code(x) t_0 = sin((x * 0.5)); tmp = ((8.0 * t_0) / 3.0) / (sin(x) / t_0); end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[(8.0 * t$95$0), $MachinePrecision] / 3.0), $MachinePrecision] / N[(N[Sin[x], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\frac{\frac{8 \cdot t_0}{3}}{\frac{\sin x}{t_0}}
\end{array}
\end{array}
herbie shell --seed 2023268
(FPCore (x)
:name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, A"
:precision binary64
:herbie-target
(/ (/ (* 8.0 (sin (* x 0.5))) 3.0) (/ (sin x) (sin (* x 0.5))))
(/ (* (* (/ 8.0 3.0) (sin (* x 0.5))) (sin (* x 0.5))) (sin x)))