
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+45)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 10000000.0)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1e+45) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 10000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1d+45)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 10000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1e+45) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 10000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1e+45: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 10000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e+45) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 10000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1e+45) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 10000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 10000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+45}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 10000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -9.9999999999999993e44Initial program 51.7%
Taylor expanded in F around -inf 99.8%
div-inv99.8%
expm1-log1p-u77.5%
expm1-udef77.5%
Applied egg-rr77.5%
expm1-def77.5%
expm1-log1p99.8%
Simplified99.8%
if -9.9999999999999993e44 < F < 1e7Initial program 99.5%
div-inv42.2%
expm1-log1p-u24.0%
expm1-udef24.0%
Applied egg-rr59.5%
expm1-def24.0%
expm1-log1p42.2%
Simplified99.7%
if 1e7 < F Initial program 49.5%
div-inv44.4%
expm1-log1p-u21.0%
expm1-udef21.0%
Applied egg-rr27.6%
expm1-def21.0%
expm1-log1p44.4%
Simplified49.6%
Taylor expanded in F around inf 99.9%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(if (<= x -1.0)
(- (/ 1.0 (sin B)) (/ x (tan B)))
(+
(* x (/ -1.0 (tan B)))
(/ F (* (sin B) (hypot F (sqrt (fma 2.0 x 2.0))))))))
double code(double F, double B, double x) {
double tmp;
if (x <= -1.0) {
tmp = (1.0 / sin(B)) - (x / tan(B));
} else {
tmp = (x * (-1.0 / tan(B))) + (F / (sin(B) * hypot(F, sqrt(fma(2.0, x, 2.0)))));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(F / Float64(sin(B) * hypot(F, sqrt(fma(2.0, x, 2.0)))))); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -1.0], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[F ^ 2 + N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B \cdot \mathsf{hypot}\left(F, \sqrt{\mathsf{fma}\left(2, x, 2\right)}\right)}\\
\end{array}
\end{array}
if x < -1Initial program 73.0%
div-inv94.8%
expm1-log1p-u39.7%
expm1-udef39.7%
Applied egg-rr25.9%
expm1-def39.7%
expm1-log1p94.8%
Simplified73.1%
Taylor expanded in F around inf 99.8%
if -1 < x Initial program 74.3%
add-sqr-sqrt74.2%
unpow-prod-down74.2%
associate-+l+74.2%
*-commutative74.2%
+-commutative74.2%
fma-udef74.2%
add-sqr-sqrt74.2%
hypot-def74.2%
fma-udef74.2%
*-commutative74.2%
fma-def74.2%
metadata-eval74.2%
metadata-eval74.2%
Applied egg-rr89.7%
pow-sqr89.8%
metadata-eval89.8%
unpow-189.8%
Simplified89.8%
*-commutative89.8%
frac-times99.5%
*-un-lft-identity99.5%
Applied egg-rr99.5%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -19000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.25)
(+ (* x (/ -1.0 (tan B))) (/ F (* (sin B) (sqrt (+ 2.0 (* x 2.0))))))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -19000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.25) {
tmp = (x * (-1.0 / tan(B))) + (F / (sin(B) * sqrt((2.0 + (x * 2.0)))));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-19000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.25d0) then
tmp = (x * ((-1.0d0) / tan(b))) + (f / (sin(b) * sqrt((2.0d0 + (x * 2.0d0)))))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -19000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.25) {
tmp = (x * (-1.0 / Math.tan(B))) + (F / (Math.sin(B) * Math.sqrt((2.0 + (x * 2.0)))));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -19000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.25: tmp = (x * (-1.0 / math.tan(B))) + (F / (math.sin(B) * math.sqrt((2.0 + (x * 2.0))))) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -19000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.25) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(F / Float64(sin(B) * sqrt(Float64(2.0 + Float64(x * 2.0)))))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -19000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.25) tmp = (x * (-1.0 / tan(B))) + (F / (sin(B) * sqrt((2.0 + (x * 2.0))))); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -19000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.25], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -19000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.25:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.9e7Initial program 57.9%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u76.7%
expm1-udef76.7%
Applied egg-rr76.7%
expm1-def76.7%
expm1-log1p99.8%
Simplified99.8%
if -1.9e7 < F < 1.25Initial program 99.5%
add-sqr-sqrt99.4%
unpow-prod-down99.4%
associate-+l+99.4%
*-commutative99.4%
+-commutative99.4%
fma-udef99.4%
add-sqr-sqrt99.4%
hypot-def99.4%
fma-udef99.4%
*-commutative99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
Applied egg-rr99.4%
pow-sqr99.4%
metadata-eval99.4%
unpow-199.4%
Simplified99.4%
*-commutative99.4%
frac-times99.5%
*-un-lft-identity99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 99.0%
if 1.25 < F Initial program 51.3%
div-inv44.0%
expm1-log1p-u20.3%
expm1-udef20.3%
Applied egg-rr29.0%
expm1-def20.3%
expm1-log1p44.0%
Simplified51.4%
Taylor expanded in F around inf 99.3%
Final simplification99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1650000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1650000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1650000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1650000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1650000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1650000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1650000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.65e9Initial program 57.2%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u76.5%
expm1-udef76.5%
Applied egg-rr76.5%
expm1-def76.5%
expm1-log1p99.8%
Simplified99.8%
if -1.65e9 < F < 1.3999999999999999Initial program 99.5%
div-inv38.9%
expm1-log1p-u21.8%
expm1-udef21.8%
Applied egg-rr58.7%
expm1-def21.8%
expm1-log1p38.9%
Simplified99.7%
Taylor expanded in F around 0 99.2%
if 1.3999999999999999 < F Initial program 51.3%
div-inv44.0%
expm1-log1p-u20.3%
expm1-udef20.3%
Applied egg-rr29.0%
expm1-def20.3%
expm1-log1p44.0%
Simplified51.4%
Taylor expanded in F around inf 99.3%
Final simplification99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1650000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1650000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1650000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1650000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1650000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1650000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1650000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.65e9Initial program 57.2%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u76.5%
expm1-udef76.5%
Applied egg-rr76.5%
expm1-def76.5%
expm1-log1p99.8%
Simplified99.8%
if -1.65e9 < F < 1.3999999999999999Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.1%
Taylor expanded in x around 0 98.9%
if 1.3999999999999999 < F Initial program 51.3%
div-inv44.0%
expm1-log1p-u20.3%
expm1-udef20.3%
Applied egg-rr29.0%
expm1-def20.3%
expm1-log1p44.0%
Simplified51.4%
Taylor expanded in F around inf 99.3%
Final simplification99.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1650000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (/ F (* (sin B) (sqrt 2.0))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F / (sin(B) * sqrt(2.0))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1650000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = (f / (sin(b) * sqrt(2.0d0))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F / (Math.sin(B) * Math.sqrt(2.0))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1650000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = (F / (math.sin(B) * math.sqrt(2.0))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1650000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(2.0))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1650000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = (F / (sin(B) * sqrt(2.0))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1650000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1650000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.65e9Initial program 57.2%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u76.5%
expm1-udef76.5%
Applied egg-rr76.5%
expm1-def76.5%
expm1-log1p99.8%
Simplified99.8%
if -1.65e9 < F < 1.3999999999999999Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.1%
expm1-log1p-u90.3%
expm1-udef70.3%
associate-*r*70.3%
div-inv70.3%
sqrt-div70.3%
metadata-eval70.3%
+-commutative70.3%
fma-udef70.3%
frac-times70.3%
*-rgt-identity70.3%
Applied egg-rr70.3%
expm1-def90.3%
expm1-log1p99.2%
Simplified99.2%
Taylor expanded in x around 0 98.9%
if 1.3999999999999999 < F Initial program 51.3%
div-inv44.0%
expm1-log1p-u20.3%
expm1-udef20.3%
Applied egg-rr29.0%
expm1-def20.3%
expm1-log1p44.0%
Simplified51.4%
Taylor expanded in F around inf 99.3%
Final simplification99.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ 2.0 (* x 2.0))) (t_1 (sqrt (/ 1.0 t_0))) (t_2 (/ x (tan B))))
(if (<= F -1650000000.0)
(- (/ -1.0 (sin B)) t_2)
(if (<= F 1.35e-149)
(- (* t_1 (/ F B)) t_2)
(if (<= F 8.6e-122)
(- (* (/ F (sin B)) t_1) (/ x B))
(if (<= F 0.102)
(- (/ F (* B (sqrt t_0))) t_2)
(- (/ 1.0 (sin B)) t_2)))))))
double code(double F, double B, double x) {
double t_0 = 2.0 + (x * 2.0);
double t_1 = sqrt((1.0 / t_0));
double t_2 = x / tan(B);
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / sin(B)) - t_2;
} else if (F <= 1.35e-149) {
tmp = (t_1 * (F / B)) - t_2;
} else if (F <= 8.6e-122) {
tmp = ((F / sin(B)) * t_1) - (x / B);
} else if (F <= 0.102) {
tmp = (F / (B * sqrt(t_0))) - t_2;
} else {
tmp = (1.0 / sin(B)) - t_2;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 2.0d0 + (x * 2.0d0)
t_1 = sqrt((1.0d0 / t_0))
t_2 = x / tan(b)
if (f <= (-1650000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_2
else if (f <= 1.35d-149) then
tmp = (t_1 * (f / b)) - t_2
else if (f <= 8.6d-122) then
tmp = ((f / sin(b)) * t_1) - (x / b)
else if (f <= 0.102d0) then
tmp = (f / (b * sqrt(t_0))) - t_2
else
tmp = (1.0d0 / sin(b)) - t_2
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 2.0 + (x * 2.0);
double t_1 = Math.sqrt((1.0 / t_0));
double t_2 = x / Math.tan(B);
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_2;
} else if (F <= 1.35e-149) {
tmp = (t_1 * (F / B)) - t_2;
} else if (F <= 8.6e-122) {
tmp = ((F / Math.sin(B)) * t_1) - (x / B);
} else if (F <= 0.102) {
tmp = (F / (B * Math.sqrt(t_0))) - t_2;
} else {
tmp = (1.0 / Math.sin(B)) - t_2;
}
return tmp;
}
def code(F, B, x): t_0 = 2.0 + (x * 2.0) t_1 = math.sqrt((1.0 / t_0)) t_2 = x / math.tan(B) tmp = 0 if F <= -1650000000.0: tmp = (-1.0 / math.sin(B)) - t_2 elif F <= 1.35e-149: tmp = (t_1 * (F / B)) - t_2 elif F <= 8.6e-122: tmp = ((F / math.sin(B)) * t_1) - (x / B) elif F <= 0.102: tmp = (F / (B * math.sqrt(t_0))) - t_2 else: tmp = (1.0 / math.sin(B)) - t_2 return tmp
function code(F, B, x) t_0 = Float64(2.0 + Float64(x * 2.0)) t_1 = sqrt(Float64(1.0 / t_0)) t_2 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1650000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_2); elseif (F <= 1.35e-149) tmp = Float64(Float64(t_1 * Float64(F / B)) - t_2); elseif (F <= 8.6e-122) tmp = Float64(Float64(Float64(F / sin(B)) * t_1) - Float64(x / B)); elseif (F <= 0.102) tmp = Float64(Float64(F / Float64(B * sqrt(t_0))) - t_2); else tmp = Float64(Float64(1.0 / sin(B)) - t_2); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 2.0 + (x * 2.0); t_1 = sqrt((1.0 / t_0)); t_2 = x / tan(B); tmp = 0.0; if (F <= -1650000000.0) tmp = (-1.0 / sin(B)) - t_2; elseif (F <= 1.35e-149) tmp = (t_1 * (F / B)) - t_2; elseif (F <= 8.6e-122) tmp = ((F / sin(B)) * t_1) - (x / B); elseif (F <= 0.102) tmp = (F / (B * sqrt(t_0))) - t_2; else tmp = (1.0 / sin(B)) - t_2; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1650000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, 1.35e-149], N[(N[(t$95$1 * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, 8.6e-122], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.102], N[(N[(F / N[(B * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 + x \cdot 2\\
t_1 := \sqrt{\frac{1}{t_0}}\\
t_2 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1650000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_2\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{-149}:\\
\;\;\;\;t_1 \cdot \frac{F}{B} - t_2\\
\mathbf{elif}\;F \leq 8.6 \cdot 10^{-122}:\\
\;\;\;\;\frac{F}{\sin B} \cdot t_1 - \frac{x}{B}\\
\mathbf{elif}\;F \leq 0.102:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{t_0}} - t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_2\\
\end{array}
\end{array}
if F < -1.65e9Initial program 57.2%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u76.5%
expm1-udef76.5%
Applied egg-rr76.5%
expm1-def76.5%
expm1-log1p99.8%
Simplified99.8%
if -1.65e9 < F < 1.35000000000000007e-149Initial program 99.5%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 88.5%
if 1.35000000000000007e-149 < F < 8.60000000000000037e-122Initial program 99.2%
Taylor expanded in B around 0 98.7%
Taylor expanded in F around 0 98.7%
if 8.60000000000000037e-122 < F < 0.101999999999999993Initial program 99.7%
Simplified99.5%
Taylor expanded in F around 0 97.1%
expm1-log1p-u77.4%
expm1-udef59.7%
associate-*r*59.7%
div-inv59.7%
sqrt-div59.7%
metadata-eval59.7%
+-commutative59.7%
fma-udef59.7%
frac-times59.7%
*-rgt-identity59.7%
Applied egg-rr59.7%
expm1-def77.5%
expm1-log1p97.2%
Simplified97.2%
Taylor expanded in B around 0 77.7%
if 0.101999999999999993 < F Initial program 51.3%
div-inv44.0%
expm1-log1p-u20.3%
expm1-udef20.3%
Applied egg-rr29.0%
expm1-def20.3%
expm1-log1p44.0%
Simplified51.4%
Taylor expanded in F around inf 99.3%
Final simplification94.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1650000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.15)
(- (/ F (* B (sqrt (+ 2.0 (* x 2.0))))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.15) {
tmp = (F / (B * sqrt((2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1650000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.15d0) then
tmp = (f / (b * sqrt((2.0d0 + (x * 2.0d0))))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.15) {
tmp = (F / (B * Math.sqrt((2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1650000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.15: tmp = (F / (B * math.sqrt((2.0 + (x * 2.0))))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1650000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.15) tmp = Float64(Float64(F / Float64(B * sqrt(Float64(2.0 + Float64(x * 2.0))))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1650000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.15) tmp = (F / (B * sqrt((2.0 + (x * 2.0))))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1650000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.15], N[(N[(F / N[(B * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1650000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.15:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.65e9Initial program 57.2%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u76.5%
expm1-udef76.5%
Applied egg-rr76.5%
expm1-def76.5%
expm1-log1p99.8%
Simplified99.8%
if -1.65e9 < F < 0.149999999999999994Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.1%
expm1-log1p-u90.3%
expm1-udef70.3%
associate-*r*70.3%
div-inv70.3%
sqrt-div70.3%
metadata-eval70.3%
+-commutative70.3%
fma-udef70.3%
frac-times70.3%
*-rgt-identity70.3%
Applied egg-rr70.3%
expm1-def90.3%
expm1-log1p99.2%
Simplified99.2%
Taylor expanded in B around 0 83.6%
if 0.149999999999999994 < F Initial program 51.3%
div-inv44.0%
expm1-log1p-u20.3%
expm1-udef20.3%
Applied egg-rr29.0%
expm1-def20.3%
expm1-log1p44.0%
Simplified51.4%
Taylor expanded in F around inf 99.3%
Final simplification92.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1650000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.35e-49) (/ (- x) (tan B)) (- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.35e-49) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1650000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.35d-49) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.35e-49) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1650000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.35e-49: tmp = -x / math.tan(B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1650000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.35e-49) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1650000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.35e-49) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1650000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.35e-49], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1650000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 2.35 \cdot 10^{-49}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.65e9Initial program 57.2%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u76.5%
expm1-udef76.5%
Applied egg-rr76.5%
expm1-def76.5%
expm1-log1p99.8%
Simplified99.8%
if -1.65e9 < F < 2.35000000000000011e-49Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
expm1-log1p-u92.5%
expm1-udef72.3%
associate-*r*72.3%
div-inv72.3%
sqrt-div72.3%
metadata-eval72.3%
+-commutative72.3%
fma-udef72.3%
frac-times72.3%
*-rgt-identity72.3%
Applied egg-rr72.3%
expm1-def92.5%
expm1-log1p99.7%
Simplified99.7%
Taylor expanded in F around 0 67.9%
mul-1-neg67.9%
associate-/l*67.9%
distribute-neg-frac67.9%
Simplified67.9%
expm1-log1p-u59.7%
expm1-udef34.7%
quot-tan34.8%
Applied egg-rr34.8%
expm1-def59.8%
expm1-log1p68.0%
Simplified68.0%
if 2.35000000000000011e-49 < F Initial program 55.6%
div-inv43.4%
expm1-log1p-u19.5%
expm1-udef19.5%
Applied egg-rr31.9%
expm1-def19.5%
expm1-log1p43.4%
Simplified55.7%
Taylor expanded in F around inf 94.3%
Final simplification84.7%
(FPCore (F B x) :precision binary64 (if (<= F -1650000000.0) (- (/ -1.0 (sin B)) (/ x (tan B))) (if (<= F 1.1e-24) (/ (- x) (tan B)) (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1.1e-24) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1650000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1.1d-24) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1.1e-24) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1650000000.0: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1.1e-24: tmp = -x / math.tan(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1650000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1.1e-24) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1650000000.0) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1.1e-24) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1650000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e-24], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1650000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-24}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.65e9Initial program 57.2%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u76.5%
expm1-udef76.5%
Applied egg-rr76.5%
expm1-def76.5%
expm1-log1p99.8%
Simplified99.8%
if -1.65e9 < F < 1.10000000000000001e-24Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
expm1-log1p-u91.8%
expm1-udef71.5%
associate-*r*71.5%
div-inv71.5%
sqrt-div71.5%
metadata-eval71.5%
+-commutative71.5%
fma-udef71.5%
frac-times71.5%
*-rgt-identity71.5%
Applied egg-rr71.5%
expm1-def91.8%
expm1-log1p99.7%
Simplified99.7%
Taylor expanded in F around 0 67.3%
mul-1-neg67.3%
associate-/l*67.3%
distribute-neg-frac67.3%
Simplified67.3%
expm1-log1p-u59.5%
expm1-udef34.4%
quot-tan34.5%
Applied egg-rr34.5%
expm1-def59.5%
expm1-log1p67.4%
Simplified67.4%
if 1.10000000000000001e-24 < F Initial program 53.6%
Taylor expanded in B around 0 33.9%
Taylor expanded in F around inf 76.1%
Final simplification77.9%
(FPCore (F B x) :precision binary64 (if (<= F -3.05e+60) (/ -1.0 (sin B)) (if (<= F 5.6e-25) (/ (- x) (tan B)) (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.05e+60) {
tmp = -1.0 / sin(B);
} else if (F <= 5.6e-25) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.05d+60)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 5.6d-25) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.05e+60) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 5.6e-25) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.05e+60: tmp = -1.0 / math.sin(B) elif F <= 5.6e-25: tmp = -x / math.tan(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.05e+60) tmp = Float64(-1.0 / sin(B)); elseif (F <= 5.6e-25) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.05e+60) tmp = -1.0 / sin(B); elseif (F <= 5.6e-25) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.05e+60], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.6e-25], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.05 \cdot 10^{+60}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{-25}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -3.05e60Initial program 47.8%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 78.7%
Taylor expanded in x around 0 66.1%
if -3.05e60 < F < 5.59999999999999976e-25Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 95.8%
expm1-log1p-u86.9%
expm1-udef68.4%
associate-*r*68.4%
div-inv68.4%
sqrt-div68.4%
metadata-eval68.4%
+-commutative68.4%
fma-udef68.4%
frac-times68.4%
*-rgt-identity68.4%
Applied egg-rr68.4%
expm1-def86.9%
expm1-log1p95.8%
Simplified95.8%
Taylor expanded in F around 0 67.1%
mul-1-neg67.1%
associate-/l*67.2%
distribute-neg-frac67.2%
Simplified67.2%
expm1-log1p-u59.9%
expm1-udef34.7%
quot-tan34.8%
Applied egg-rr34.8%
expm1-def60.0%
expm1-log1p67.2%
Simplified67.2%
if 5.59999999999999976e-25 < F Initial program 53.6%
Taylor expanded in B around 0 33.9%
Taylor expanded in F around inf 76.1%
Final simplification70.0%
(FPCore (F B x) :precision binary64 (if (<= F -1650000000.0) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 1.1e-24) (/ (- x) (tan B)) (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.1e-24) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1650000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.1d-24) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1650000000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.1e-24) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1650000000.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.1e-24: tmp = -x / math.tan(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1650000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.1e-24) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1650000000.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.1e-24) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1650000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e-24], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1650000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-24}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.65e9Initial program 57.2%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 77.8%
if -1.65e9 < F < 1.10000000000000001e-24Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
expm1-log1p-u91.8%
expm1-udef71.5%
associate-*r*71.5%
div-inv71.5%
sqrt-div71.5%
metadata-eval71.5%
+-commutative71.5%
fma-udef71.5%
frac-times71.5%
*-rgt-identity71.5%
Applied egg-rr71.5%
expm1-def91.8%
expm1-log1p99.7%
Simplified99.7%
Taylor expanded in F around 0 67.3%
mul-1-neg67.3%
associate-/l*67.3%
distribute-neg-frac67.3%
Simplified67.3%
expm1-log1p-u59.5%
expm1-udef34.4%
quot-tan34.5%
Applied egg-rr34.5%
expm1-def59.5%
expm1-log1p67.4%
Simplified67.4%
if 1.10000000000000001e-24 < F Initial program 53.6%
Taylor expanded in B around 0 33.9%
Taylor expanded in F around inf 76.1%
Final simplification72.8%
(FPCore (F B x) :precision binary64 (if (<= F -2.1e+61) (/ -1.0 (sin B)) (if (<= F 8.6e+194) (/ (- x) (tan B)) (fabs (/ (+ x -1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e+61) {
tmp = -1.0 / sin(B);
} else if (F <= 8.6e+194) {
tmp = -x / tan(B);
} else {
tmp = fabs(((x + -1.0) / B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.1d+61)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 8.6d+194) then
tmp = -x / tan(b)
else
tmp = abs(((x + (-1.0d0)) / b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e+61) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 8.6e+194) {
tmp = -x / Math.tan(B);
} else {
tmp = Math.abs(((x + -1.0) / B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.1e+61: tmp = -1.0 / math.sin(B) elif F <= 8.6e+194: tmp = -x / math.tan(B) else: tmp = math.fabs(((x + -1.0) / B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.1e+61) tmp = Float64(-1.0 / sin(B)); elseif (F <= 8.6e+194) tmp = Float64(Float64(-x) / tan(B)); else tmp = abs(Float64(Float64(x + -1.0) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.1e+61) tmp = -1.0 / sin(B); elseif (F <= 8.6e+194) tmp = -x / tan(B); else tmp = abs(((x + -1.0) / B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.1e+61], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.6e+194], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[(x + -1.0), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{+61}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 8.6 \cdot 10^{+194}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + -1}{B}\right|\\
\end{array}
\end{array}
if F < -2.1000000000000001e61Initial program 47.8%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 78.7%
Taylor expanded in x around 0 66.1%
if -2.1000000000000001e61 < F < 8.59999999999999988e194Initial program 91.7%
Simplified96.3%
Taylor expanded in F around 0 76.7%
expm1-log1p-u66.9%
expm1-udef53.6%
associate-*r*52.5%
div-inv52.5%
sqrt-div52.5%
metadata-eval52.5%
+-commutative52.5%
fma-udef52.5%
frac-times53.6%
*-rgt-identity53.6%
Applied egg-rr53.6%
expm1-def66.9%
expm1-log1p76.8%
Simplified76.8%
Taylor expanded in F around 0 62.4%
mul-1-neg62.4%
associate-/l*62.5%
distribute-neg-frac62.5%
Simplified62.5%
expm1-log1p-u55.0%
expm1-udef30.4%
quot-tan30.5%
Applied egg-rr30.5%
expm1-def55.1%
expm1-log1p62.5%
Simplified62.5%
if 8.59999999999999988e194 < F Initial program 24.7%
Taylor expanded in F around -inf 32.9%
Taylor expanded in B around 0 11.2%
associate-*r/11.2%
distribute-lft-in11.2%
metadata-eval11.2%
neg-mul-111.2%
Simplified11.2%
add-sqr-sqrt4.4%
sqrt-unprod22.6%
pow222.6%
+-commutative22.6%
add-sqr-sqrt7.3%
sqrt-unprod22.5%
sqr-neg22.5%
sqrt-unprod15.3%
add-sqr-sqrt24.8%
Applied egg-rr24.8%
unpow224.8%
rem-sqrt-square27.5%
Simplified27.5%
Final simplification58.4%
(FPCore (F B x) :precision binary64 (if (or (<= x -1e-101) (not (<= x 6.8e-165))) (/ (- x) (tan B)) (/ -1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -1e-101) || !(x <= 6.8e-165)) {
tmp = -x / tan(B);
} else {
tmp = -1.0 / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-1d-101)) .or. (.not. (x <= 6.8d-165))) then
tmp = -x / tan(b)
else
tmp = (-1.0d0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -1e-101) || !(x <= 6.8e-165)) {
tmp = -x / Math.tan(B);
} else {
tmp = -1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -1e-101) or not (x <= 6.8e-165): tmp = -x / math.tan(B) else: tmp = -1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -1e-101) || !(x <= 6.8e-165)) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(-1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -1e-101) || ~((x <= 6.8e-165))) tmp = -x / tan(B); else tmp = -1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -1e-101], N[Not[LessEqual[x, 6.8e-165]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-101} \lor \neg \left(x \leq 6.8 \cdot 10^{-165}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\end{array}
\end{array}
if x < -1.00000000000000005e-101 or 6.8e-165 < x Initial program 81.1%
Simplified88.8%
Taylor expanded in F around 0 63.4%
expm1-log1p-u53.0%
expm1-udef51.3%
associate-*r*50.1%
div-inv50.1%
sqrt-div50.1%
metadata-eval50.1%
+-commutative50.1%
fma-udef50.1%
frac-times51.3%
*-rgt-identity51.3%
Applied egg-rr51.3%
expm1-def53.0%
expm1-log1p63.4%
Simplified63.4%
Taylor expanded in F around 0 78.9%
mul-1-neg78.9%
associate-/l*79.0%
distribute-neg-frac79.0%
Simplified79.0%
expm1-log1p-u70.0%
expm1-udef41.2%
quot-tan41.3%
Applied egg-rr41.3%
expm1-def70.1%
expm1-log1p79.1%
Simplified79.1%
if -1.00000000000000005e-101 < x < 6.8e-165Initial program 61.9%
Taylor expanded in F around -inf 29.7%
Taylor expanded in B around 0 29.7%
Taylor expanded in x around 0 29.7%
Final simplification61.2%
(FPCore (F B x) :precision binary64 (if (<= F -3.05e+60) (/ -1.0 (sin B)) (- (/ (- x) B) (* B (* x -0.3333333333333333)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.05e+60) {
tmp = -1.0 / sin(B);
} else {
tmp = (-x / B) - (B * (x * -0.3333333333333333));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.05d+60)) then
tmp = (-1.0d0) / sin(b)
else
tmp = (-x / b) - (b * (x * (-0.3333333333333333d0)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.05e+60) {
tmp = -1.0 / Math.sin(B);
} else {
tmp = (-x / B) - (B * (x * -0.3333333333333333));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.05e+60: tmp = -1.0 / math.sin(B) else: tmp = (-x / B) - (B * (x * -0.3333333333333333)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.05e+60) tmp = Float64(-1.0 / sin(B)); else tmp = Float64(Float64(Float64(-x) / B) - Float64(B * Float64(x * -0.3333333333333333))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.05e+60) tmp = -1.0 / sin(B); else tmp = (-x / B) - (B * (x * -0.3333333333333333)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.05e+60], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[((-x) / B), $MachinePrecision] - N[(B * N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.05 \cdot 10^{+60}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\
\end{array}
\end{array}
if F < -3.05e60Initial program 47.8%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 78.7%
Taylor expanded in x around 0 66.1%
if -3.05e60 < F Initial program 80.4%
Simplified85.8%
Taylor expanded in F around 0 66.1%
expm1-log1p-u56.7%
expm1-udef45.7%
associate-*r*44.8%
div-inv44.8%
sqrt-div44.8%
metadata-eval44.8%
+-commutative44.8%
fma-udef44.8%
frac-times45.7%
*-rgt-identity45.7%
Applied egg-rr45.7%
expm1-def56.8%
expm1-log1p66.2%
Simplified66.2%
Taylor expanded in F around 0 57.7%
mul-1-neg57.7%
associate-/l*57.7%
distribute-neg-frac57.7%
Simplified57.7%
Taylor expanded in B around 0 31.6%
distribute-lft-out31.6%
distribute-rgt-out--31.6%
metadata-eval31.6%
Simplified31.6%
Final simplification38.2%
(FPCore (F B x) :precision binary64 (if (<= F -1.8e-129) (/ (- -1.0 x) B) (- (/ (- x) B) (* B (* x -0.3333333333333333)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e-129) {
tmp = (-1.0 - x) / B;
} else {
tmp = (-x / B) - (B * (x * -0.3333333333333333));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.8d-129)) then
tmp = ((-1.0d0) - x) / b
else
tmp = (-x / b) - (b * (x * (-0.3333333333333333d0)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e-129) {
tmp = (-1.0 - x) / B;
} else {
tmp = (-x / B) - (B * (x * -0.3333333333333333));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.8e-129: tmp = (-1.0 - x) / B else: tmp = (-x / B) - (B * (x * -0.3333333333333333)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.8e-129) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(Float64(-x) / B) - Float64(B * Float64(x * -0.3333333333333333))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.8e-129) tmp = (-1.0 - x) / B; else tmp = (-x / B) - (B * (x * -0.3333333333333333)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.8e-129], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(N[((-x) / B), $MachinePrecision] - N[(B * N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.8 \cdot 10^{-129}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\
\end{array}
\end{array}
if F < -1.8e-129Initial program 70.7%
Taylor expanded in F around -inf 82.8%
Taylor expanded in B around 0 41.2%
associate-*r/41.2%
distribute-lft-in41.2%
metadata-eval41.2%
neg-mul-141.2%
Simplified41.2%
if -1.8e-129 < F Initial program 76.0%
Simplified82.6%
Taylor expanded in F around 0 61.1%
expm1-log1p-u53.5%
expm1-udef43.6%
associate-*r*42.5%
div-inv42.5%
sqrt-div42.5%
metadata-eval42.5%
+-commutative42.5%
fma-udef42.5%
frac-times43.6%
*-rgt-identity43.6%
Applied egg-rr43.6%
expm1-def53.5%
expm1-log1p61.1%
Simplified61.1%
Taylor expanded in F around 0 58.5%
mul-1-neg58.5%
associate-/l*58.5%
distribute-neg-frac58.5%
Simplified58.5%
Taylor expanded in B around 0 31.1%
distribute-lft-out31.1%
distribute-rgt-out--31.1%
metadata-eval31.1%
Simplified31.1%
Final simplification34.6%
(FPCore (F B x) :precision binary64 (if (<= F -3.05e-120) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.05e-120) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.05d-120)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -x / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.05e-120) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.05e-120: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.05e-120) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.05e-120) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.05e-120], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.05 \cdot 10^{-120}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -3.05e-120Initial program 70.0%
Taylor expanded in F around -inf 82.4%
Taylor expanded in B around 0 40.9%
associate-*r/40.9%
distribute-lft-in40.9%
metadata-eval40.9%
neg-mul-140.9%
Simplified40.9%
if -3.05e-120 < F Initial program 76.3%
Taylor expanded in F around -inf 40.7%
Taylor expanded in B around 0 21.8%
associate-*r/21.8%
distribute-lft-in21.8%
metadata-eval21.8%
neg-mul-121.8%
Simplified21.8%
Taylor expanded in x around inf 30.4%
mul-1-neg30.4%
distribute-neg-frac30.4%
Simplified30.4%
Final simplification33.9%
(FPCore (F B x) :precision binary64 (if (<= F -6.5e+63) (/ -1.0 B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.5e+63) {
tmp = -1.0 / B;
} else {
tmp = -x / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-6.5d+63)) then
tmp = (-1.0d0) / b
else
tmp = -x / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.5e+63) {
tmp = -1.0 / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.5e+63: tmp = -1.0 / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.5e+63) tmp = Float64(-1.0 / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.5e+63) tmp = -1.0 / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.5e+63], N[(-1.0 / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.5 \cdot 10^{+63}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -6.49999999999999992e63Initial program 46.7%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 45.9%
associate-*r/45.9%
distribute-lft-in45.9%
metadata-eval45.9%
neg-mul-145.9%
Simplified45.9%
Taylor expanded in x around 0 33.1%
if -6.49999999999999992e63 < F Initial program 80.5%
Taylor expanded in F around -inf 44.3%
Taylor expanded in B around 0 24.1%
associate-*r/24.1%
distribute-lft-in24.1%
metadata-eval24.1%
neg-mul-124.1%
Simplified24.1%
Taylor expanded in x around inf 30.7%
mul-1-neg30.7%
distribute-neg-frac30.7%
Simplified30.7%
Final simplification31.1%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 74.2%
Taylor expanded in F around -inf 54.7%
Taylor expanded in B around 0 28.2%
associate-*r/28.2%
distribute-lft-in28.2%
metadata-eval28.2%
neg-mul-128.2%
Simplified28.2%
Taylor expanded in x around 0 9.4%
Final simplification9.4%
herbie shell --seed 2024024
(FPCore (F B x)
:name "VandenBroeck and Keller, Equation (23)"
:precision binary64
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))