
(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 18 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 (/ -1.0 (tan B)))))
(if (<= F -155000000.0)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 6100000000.0)
(-
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
(/ x (tan B)))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -155000000.0) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 6100000000.0) {
tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / tan(B));
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b))
if (f <= (-155000000.0d0)) then
tmp = t_0 + ((-1.0d0) / sin(b))
else if (f <= 6100000000.0d0) then
tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - (x / tan(b))
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -155000000.0) {
tmp = t_0 + (-1.0 / Math.sin(B));
} else if (F <= 6100000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / Math.tan(B));
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -155000000.0: tmp = t_0 + (-1.0 / math.sin(B)) elif F <= 6100000000.0: tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / math.tan(B)) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -155000000.0) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 6100000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / tan(B))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -155000000.0) tmp = t_0 + (-1.0 / sin(B)); elseif (F <= 6100000000.0) tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - (x / tan(B)); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -155000000.0], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6100000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -155000000:\\
\;\;\;\;t_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 6100000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.55e8Initial program 62.1%
Taylor expanded in F around -inf 99.8%
if -1.55e8 < F < 6.1e9Initial program 99.5%
div-inv99.6%
expm1-log1p-u67.4%
expm1-udef45.6%
Applied egg-rr45.6%
expm1-def67.4%
expm1-log1p99.6%
Simplified99.6%
if 6.1e9 < F Initial program 61.4%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -1.5)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 1.4)
(+ t_0 (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -1.5) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 1.4) {
tmp = t_0 + ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0)))));
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b))
if (f <= (-1.5d0)) then
tmp = t_0 + ((-1.0d0) / sin(b))
else if (f <= 1.4d0) then
tmp = t_0 + ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -1.5) {
tmp = t_0 + (-1.0 / Math.sin(B));
} else if (F <= 1.4) {
tmp = t_0 + ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))));
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -1.5: tmp = t_0 + (-1.0 / math.sin(B)) elif F <= 1.4: tmp = t_0 + ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -1.5) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 1.4) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -1.5) tmp = t_0 + (-1.0 / sin(B)); elseif (F <= 1.4) tmp = t_0 + ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(t$95$0 + 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]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -1.5:\\
\;\;\;\;t_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t_0 + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.5Initial program 64.0%
Taylor expanded in F around -inf 97.9%
if -1.5 < F < 1.3999999999999999Initial program 99.5%
Taylor expanded in F around 0 98.1%
if 1.3999999999999999 < F Initial program 61.4%
Taylor expanded in F around inf 99.7%
Final simplification98.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -1.4)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 1.4)
(+ t_0 (/ (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (sin B)))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -1.4) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 1.4) {
tmp = t_0 + ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) / sin(B));
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b))
if (f <= (-1.4d0)) then
tmp = t_0 + ((-1.0d0) / sin(b))
else if (f <= 1.4d0) then
tmp = t_0 + ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) / sin(b))
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -1.4) {
tmp = t_0 + (-1.0 / Math.sin(B));
} else if (F <= 1.4) {
tmp = t_0 + ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) / Math.sin(B));
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -1.4: tmp = t_0 + (-1.0 / math.sin(B)) elif F <= 1.4: tmp = t_0 + ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) / math.sin(B)) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -1.4) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 1.4) tmp = Float64(t_0 + Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) / sin(B))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -1.4) tmp = t_0 + (-1.0 / sin(B)); elseif (F <= 1.4) tmp = t_0 + ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) / sin(B)); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(t$95$0 + N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;t_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t_0 + \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 64.0%
Taylor expanded in F around -inf 97.9%
if -1.3999999999999999 < F < 1.3999999999999999Initial program 99.5%
associate-*l/99.5%
+-commutative99.5%
*-commutative99.5%
fma-udef99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
fma-def99.5%
fma-udef99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 98.1%
if 1.3999999999999999 < F Initial program 61.4%
Taylor expanded in F around inf 99.7%
Final simplification98.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
(/ x B)))
(t_1 (* x (/ -1.0 (tan B)))))
(if (<= F -13000000.0)
(+ t_1 (/ -1.0 (sin B)))
(if (<= F -6.2e-77)
t_0
(if (<= F 6.4e-121)
(/ (- x) (tan B))
(if (<= F 108000.0) t_0 (+ t_1 (/ 1.0 (sin B)))))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x * (-1.0 / tan(B));
double tmp;
if (F <= -13000000.0) {
tmp = t_1 + (-1.0 / sin(B));
} else if (F <= -6.2e-77) {
tmp = t_0;
} else if (F <= 6.4e-121) {
tmp = -x / tan(B);
} else if (F <= 108000.0) {
tmp = t_0;
} else {
tmp = t_1 + (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
t_1 = x * ((-1.0d0) / tan(b))
if (f <= (-13000000.0d0)) then
tmp = t_1 + ((-1.0d0) / sin(b))
else if (f <= (-6.2d-77)) then
tmp = t_0
else if (f <= 6.4d-121) then
tmp = -x / tan(b)
else if (f <= 108000.0d0) then
tmp = t_0
else
tmp = t_1 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -13000000.0) {
tmp = t_1 + (-1.0 / Math.sin(B));
} else if (F <= -6.2e-77) {
tmp = t_0;
} else if (F <= 6.4e-121) {
tmp = -x / Math.tan(B);
} else if (F <= 108000.0) {
tmp = t_0;
} else {
tmp = t_1 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B) t_1 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -13000000.0: tmp = t_1 + (-1.0 / math.sin(B)) elif F <= -6.2e-77: tmp = t_0 elif F <= 6.4e-121: tmp = -x / math.tan(B) elif F <= 108000.0: tmp = t_0 else: tmp = t_1 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)) t_1 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -13000000.0) tmp = Float64(t_1 + Float64(-1.0 / sin(B))); elseif (F <= -6.2e-77) tmp = t_0; elseif (F <= 6.4e-121) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 108000.0) tmp = t_0; else tmp = Float64(t_1 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - (x / B); t_1 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -13000000.0) tmp = t_1 + (-1.0 / sin(B)); elseif (F <= -6.2e-77) tmp = t_0; elseif (F <= 6.4e-121) tmp = -x / tan(B); elseif (F <= 108000.0) tmp = t_0; else tmp = t_1 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -13000000.0], N[(t$95$1 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6.2e-77], t$95$0, If[LessEqual[F, 6.4e-121], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 108000.0], t$95$0, N[(t$95$1 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
t_1 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -13000000:\\
\;\;\;\;t_1 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -6.2 \cdot 10^{-77}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 6.4 \cdot 10^{-121}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 108000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.3e7Initial program 62.1%
Taylor expanded in F around -inf 99.8%
if -1.3e7 < F < -6.20000000000000016e-77 or 6.40000000000000038e-121 < F < 108000Initial program 99.5%
Taylor expanded in B around 0 84.7%
if -6.20000000000000016e-77 < F < 6.40000000000000038e-121Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 81.8%
mul-1-neg81.8%
associate-*l/81.7%
distribute-rgt-neg-in81.7%
Simplified81.7%
distribute-rgt-neg-out81.7%
neg-sub081.7%
clear-num81.6%
associate-*l/81.7%
*-un-lft-identity81.7%
Applied egg-rr81.7%
neg-sub081.7%
distribute-neg-frac81.7%
Simplified81.7%
associate-/r/81.7%
clear-num81.6%
add-sqr-sqrt35.2%
sqrt-unprod36.4%
sqr-neg36.4%
sqrt-unprod1.2%
add-sqr-sqrt2.2%
tan-quot2.2%
*-commutative2.2%
add-sqr-sqrt1.2%
sqrt-unprod26.6%
sqr-neg26.6%
sqrt-unprod45.6%
add-sqr-sqrt81.6%
neg-sub081.6%
un-div-inv81.9%
Applied egg-rr81.9%
neg-sub081.9%
distribute-neg-frac81.9%
Simplified81.9%
if 108000 < F Initial program 61.4%
Taylor expanded in F around inf 99.7%
Final simplification92.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
(t_1 (* x (/ -1.0 (tan B)))))
(if (<= F -15200.0)
(+ t_1 (/ -1.0 (sin B)))
(if (<= F 1.8e-86)
(+ t_1 (* t_0 (/ F B)))
(if (<= F 920.0)
(- (* (/ F (sin B)) t_0) (/ x B))
(+ t_1 (/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
double t_0 = pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
double t_1 = x * (-1.0 / tan(B));
double tmp;
if (F <= -15200.0) {
tmp = t_1 + (-1.0 / sin(B));
} else if (F <= 1.8e-86) {
tmp = t_1 + (t_0 * (F / B));
} else if (F <= 920.0) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} else {
tmp = t_1 + (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)
t_1 = x * ((-1.0d0) / tan(b))
if (f <= (-15200.0d0)) then
tmp = t_1 + ((-1.0d0) / sin(b))
else if (f <= 1.8d-86) then
tmp = t_1 + (t_0 * (f / b))
else if (f <= 920.0d0) then
tmp = ((f / sin(b)) * t_0) - (x / b)
else
tmp = t_1 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
double t_1 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -15200.0) {
tmp = t_1 + (-1.0 / Math.sin(B));
} else if (F <= 1.8e-86) {
tmp = t_1 + (t_0 * (F / B));
} else if (F <= 920.0) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else {
tmp = t_1 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) t_1 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -15200.0: tmp = t_1 + (-1.0 / math.sin(B)) elif F <= 1.8e-86: tmp = t_1 + (t_0 * (F / B)) elif F <= 920.0: tmp = ((F / math.sin(B)) * t_0) - (x / B) else: tmp = t_1 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5 t_1 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -15200.0) tmp = Float64(t_1 + Float64(-1.0 / sin(B))); elseif (F <= 1.8e-86) tmp = Float64(t_1 + Float64(t_0 * Float64(F / B))); elseif (F <= 920.0) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); else tmp = Float64(t_1 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (((F * F) + 2.0) + (x * 2.0)) ^ -0.5; t_1 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -15200.0) tmp = t_1 + (-1.0 / sin(B)); elseif (F <= 1.8e-86) tmp = t_1 + (t_0 * (F / B)); elseif (F <= 920.0) tmp = ((F / sin(B)) * t_0) - (x / B); else tmp = t_1 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -15200.0], N[(t$95$1 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-86], N[(t$95$1 + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 920.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\
t_1 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -15200:\\
\;\;\;\;t_1 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-86}:\\
\;\;\;\;t_1 + t_0 \cdot \frac{F}{B}\\
\mathbf{elif}\;F \leq 920:\\
\;\;\;\;\frac{F}{\sin B} \cdot t_0 - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t_1 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -15200Initial program 63.1%
Taylor expanded in F around -inf 99.4%
if -15200 < F < 1.79999999999999983e-86Initial program 99.5%
Taylor expanded in B around 0 85.6%
if 1.79999999999999983e-86 < F < 920Initial program 99.5%
Taylor expanded in B around 0 93.2%
if 920 < F Initial program 61.4%
Taylor expanded in F around inf 99.7%
Final simplification93.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -9e-18)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 2.7e-31) (/ (- x) (tan B)) (+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -9e-18) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 2.7e-31) {
tmp = -x / tan(B);
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b))
if (f <= (-9d-18)) then
tmp = t_0 + ((-1.0d0) / sin(b))
else if (f <= 2.7d-31) then
tmp = -x / tan(b)
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -9e-18) {
tmp = t_0 + (-1.0 / Math.sin(B));
} else if (F <= 2.7e-31) {
tmp = -x / Math.tan(B);
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -9e-18: tmp = t_0 + (-1.0 / math.sin(B)) elif F <= 2.7e-31: tmp = -x / math.tan(B) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -9e-18) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 2.7e-31) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -9e-18) tmp = t_0 + (-1.0 / sin(B)); elseif (F <= 2.7e-31) tmp = -x / tan(B); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -9e-18], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.7e-31], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -9 \cdot 10^{-18}:\\
\;\;\;\;t_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{-31}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -8.99999999999999987e-18Initial program 66.1%
Taylor expanded in F around -inf 94.9%
if -8.99999999999999987e-18 < F < 2.70000000000000014e-31Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 69.1%
mul-1-neg69.1%
associate-*l/69.0%
distribute-rgt-neg-in69.0%
Simplified69.0%
distribute-rgt-neg-out69.0%
neg-sub069.0%
clear-num68.9%
associate-*l/68.9%
*-un-lft-identity68.9%
Applied egg-rr68.9%
neg-sub068.9%
distribute-neg-frac68.9%
Simplified68.9%
associate-/r/69.0%
clear-num68.9%
add-sqr-sqrt24.6%
sqrt-unprod26.0%
sqr-neg26.0%
sqrt-unprod1.3%
add-sqr-sqrt2.3%
tan-quot2.3%
*-commutative2.3%
add-sqr-sqrt1.2%
sqrt-unprod23.0%
sqr-neg23.0%
sqrt-unprod38.4%
add-sqr-sqrt68.9%
neg-sub068.9%
un-div-inv69.1%
Applied egg-rr69.1%
neg-sub069.1%
distribute-neg-frac69.1%
Simplified69.1%
if 2.70000000000000014e-31 < F Initial program 65.3%
Taylor expanded in F around inf 92.0%
Final simplification83.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -1.2e-17)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 2.8e-11) (/ (- x) (tan B)) (+ t_0 (/ 1.0 B))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -1.2e-17) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 2.8e-11) {
tmp = -x / tan(B);
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b))
if (f <= (-1.2d-17)) then
tmp = t_0 + ((-1.0d0) / sin(b))
else if (f <= 2.8d-11) then
tmp = -x / tan(b)
else
tmp = t_0 + (1.0d0 / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -1.2e-17) {
tmp = t_0 + (-1.0 / Math.sin(B));
} else if (F <= 2.8e-11) {
tmp = -x / Math.tan(B);
} else {
tmp = t_0 + (1.0 / B);
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -1.2e-17: tmp = t_0 + (-1.0 / math.sin(B)) elif F <= 2.8e-11: tmp = -x / math.tan(B) else: tmp = t_0 + (1.0 / B) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -1.2e-17) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 2.8e-11) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(t_0 + Float64(1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -1.2e-17) tmp = t_0 + (-1.0 / sin(B)); elseif (F <= 2.8e-11) tmp = -x / tan(B); else tmp = t_0 + (1.0 / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.2e-17], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e-11], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{-17}:\\
\;\;\;\;t_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{B}\\
\end{array}
\end{array}
if F < -1.19999999999999993e-17Initial program 66.1%
Taylor expanded in F around -inf 94.9%
if -1.19999999999999993e-17 < F < 2.8e-11Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 67.5%
mul-1-neg67.5%
associate-*l/67.4%
distribute-rgt-neg-in67.4%
Simplified67.4%
distribute-rgt-neg-out67.4%
neg-sub067.4%
clear-num67.3%
associate-*l/67.4%
*-un-lft-identity67.4%
Applied egg-rr67.4%
neg-sub067.4%
distribute-neg-frac67.4%
Simplified67.4%
associate-/r/67.4%
clear-num67.3%
add-sqr-sqrt23.7%
sqrt-unprod25.2%
sqr-neg25.2%
sqrt-unprod1.4%
add-sqr-sqrt2.4%
tan-quot2.4%
*-commutative2.4%
add-sqr-sqrt1.4%
sqrt-unprod23.3%
sqr-neg23.3%
sqrt-unprod37.9%
add-sqr-sqrt67.3%
neg-sub067.3%
un-div-inv67.5%
Applied egg-rr67.5%
neg-sub067.5%
distribute-neg-frac67.5%
Simplified67.5%
if 2.8e-11 < F Initial program 63.2%
Taylor expanded in B around 0 44.1%
Taylor expanded in F around inf 69.0%
Final simplification77.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= F -1.25e-15)
t_0
(if (<= F 5600.0)
(/ (- x) (tan B))
(if (or (<= F 3e+82) (not (<= F 1.9e+153)))
(+ (* 0.3333333333333333 (* x B)) (/ (- 1.0 x) B))
t_0)))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / tan(B));
double tmp;
if (F <= -1.25e-15) {
tmp = t_0;
} else if (F <= 5600.0) {
tmp = -x / tan(B);
} else if ((F <= 3e+82) || !(F <= 1.9e+153)) {
tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B);
} else {
tmp = 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 = ((-1.0d0) / b) - (x / tan(b))
if (f <= (-1.25d-15)) then
tmp = t_0
else if (f <= 5600.0d0) then
tmp = -x / tan(b)
else if ((f <= 3d+82) .or. (.not. (f <= 1.9d+153))) then
tmp = (0.3333333333333333d0 * (x * b)) + ((1.0d0 - x) / b)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (F <= -1.25e-15) {
tmp = t_0;
} else if (F <= 5600.0) {
tmp = -x / Math.tan(B);
} else if ((F <= 3e+82) || !(F <= 1.9e+153)) {
tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B);
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 / B) - (x / math.tan(B)) tmp = 0 if F <= -1.25e-15: tmp = t_0 elif F <= 5600.0: tmp = -x / math.tan(B) elif (F <= 3e+82) or not (F <= 1.9e+153): tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (F <= -1.25e-15) tmp = t_0; elseif (F <= 5600.0) tmp = Float64(Float64(-x) / tan(B)); elseif ((F <= 3e+82) || !(F <= 1.9e+153)) tmp = Float64(Float64(0.3333333333333333 * Float64(x * B)) + Float64(Float64(1.0 - x) / B)); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 / B) - (x / tan(B)); tmp = 0.0; if (F <= -1.25e-15) tmp = t_0; elseif (F <= 5600.0) tmp = -x / tan(B); elseif ((F <= 3e+82) || ~((F <= 1.9e+153))) tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B); else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.25e-15], t$95$0, If[LessEqual[F, 5600.0], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 3e+82], N[Not[LessEqual[F, 1.9e+153]], $MachinePrecision]], N[(N[(0.3333333333333333 * N[(x * B), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.25 \cdot 10^{-15}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 5600:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 3 \cdot 10^{+82} \lor \neg \left(F \leq 1.9 \cdot 10^{+153}\right):\\
\;\;\;\;0.3333333333333333 \cdot \left(x \cdot B\right) + \frac{1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if F < -1.25e-15 or 2.99999999999999989e82 < F < 1.89999999999999983e153Initial program 69.8%
Taylor expanded in B around 0 46.7%
Taylor expanded in F around inf 34.7%
neg-sub034.7%
associate-+l-34.7%
add-sqr-sqrt15.8%
sqrt-unprod10.3%
sqr-neg10.3%
sqrt-unprod0.9%
add-sqr-sqrt1.8%
*-commutative1.8%
cancel-sign-sub-inv1.8%
Applied egg-rr65.5%
associate--r+65.5%
neg-sub065.5%
distribute-neg-frac65.5%
metadata-eval65.5%
Simplified65.5%
if -1.25e-15 < F < 5600Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 65.2%
mul-1-neg65.2%
associate-*l/65.2%
distribute-rgt-neg-in65.2%
Simplified65.2%
distribute-rgt-neg-out65.2%
neg-sub065.2%
clear-num65.1%
associate-*l/65.2%
*-un-lft-identity65.2%
Applied egg-rr65.2%
neg-sub065.2%
distribute-neg-frac65.2%
Simplified65.2%
associate-/r/65.2%
clear-num65.1%
add-sqr-sqrt22.8%
sqrt-unprod24.4%
sqr-neg24.4%
sqrt-unprod1.5%
add-sqr-sqrt2.4%
tan-quot2.4%
*-commutative2.4%
add-sqr-sqrt1.3%
sqrt-unprod22.6%
sqr-neg22.6%
sqrt-unprod36.7%
add-sqr-sqrt65.1%
neg-sub065.1%
un-div-inv65.3%
Applied egg-rr65.3%
neg-sub065.3%
distribute-neg-frac65.3%
Simplified65.3%
if 5600 < F < 2.99999999999999989e82 or 1.89999999999999983e153 < F Initial program 51.4%
Taylor expanded in B around 0 43.5%
Taylor expanded in F around inf 47.1%
Taylor expanded in B around 0 61.7%
associate--l+61.7%
div-sub61.7%
Simplified61.7%
Final simplification64.7%
(FPCore (F B x) :precision binary64 (if (<= F -2.35e-17) (- (/ -1.0 B) (/ x (tan B))) (if (<= F 4.5e-12) (/ (- x) (tan B)) (+ (* x (/ -1.0 (tan B))) (/ 1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.35e-17) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 4.5e-12) {
tmp = -x / tan(B);
} else {
tmp = (x * (-1.0 / tan(B))) + (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.35d-17)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 4.5d-12) then
tmp = -x / tan(b)
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.35e-17) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 4.5e-12) {
tmp = -x / Math.tan(B);
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.35e-17: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 4.5e-12: tmp = -x / math.tan(B) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.35e-17) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 4.5e-12) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.35e-17) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 4.5e-12) tmp = -x / tan(B); else tmp = (x * (-1.0 / tan(B))) + (1.0 / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.35e-17], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.5e-12], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.35 \cdot 10^{-17}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\end{array}
\end{array}
if F < -2.35e-17Initial program 65.7%
Taylor expanded in B around 0 46.6%
Taylor expanded in F around inf 32.4%
neg-sub032.4%
associate-+l-32.4%
add-sqr-sqrt14.9%
sqrt-unprod9.4%
sqr-neg9.4%
sqrt-unprod0.9%
add-sqr-sqrt1.6%
*-commutative1.6%
cancel-sign-sub-inv1.6%
Applied egg-rr67.4%
associate--r+67.4%
neg-sub067.4%
distribute-neg-frac67.4%
metadata-eval67.4%
Simplified67.4%
if -2.35e-17 < F < 4.49999999999999981e-12Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 66.9%
mul-1-neg66.9%
associate-*l/66.9%
distribute-rgt-neg-in66.9%
Simplified66.9%
distribute-rgt-neg-out66.9%
neg-sub066.9%
clear-num66.8%
associate-*l/66.8%
*-un-lft-identity66.8%
Applied egg-rr66.8%
neg-sub066.8%
distribute-neg-frac66.8%
Simplified66.8%
associate-/r/66.8%
clear-num66.8%
add-sqr-sqrt23.5%
sqrt-unprod24.9%
sqr-neg24.9%
sqrt-unprod1.4%
add-sqr-sqrt2.4%
tan-quot2.4%
*-commutative2.4%
add-sqr-sqrt1.4%
sqrt-unprod23.1%
sqr-neg23.1%
sqrt-unprod37.5%
add-sqr-sqrt66.8%
neg-sub066.8%
un-div-inv67.0%
Applied egg-rr67.0%
neg-sub067.0%
distribute-neg-frac67.0%
Simplified67.0%
if 4.49999999999999981e-12 < F Initial program 63.2%
Taylor expanded in B around 0 44.1%
Taylor expanded in F around inf 69.0%
Final simplification67.6%
(FPCore (F B x) :precision binary64 (if (<= F -2.9e-5) (- (/ (- F) (* F (sin B))) (/ x B)) (if (<= F 6.4e-13) (/ (- x) (tan B)) (+ (* x (/ -1.0 (tan B))) (/ 1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.9e-5) {
tmp = (-F / (F * sin(B))) - (x / B);
} else if (F <= 6.4e-13) {
tmp = -x / tan(B);
} else {
tmp = (x * (-1.0 / tan(B))) + (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.9d-5)) then
tmp = (-f / (f * sin(b))) - (x / b)
else if (f <= 6.4d-13) then
tmp = -x / tan(b)
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.9e-5) {
tmp = (-F / (F * Math.sin(B))) - (x / B);
} else if (F <= 6.4e-13) {
tmp = -x / Math.tan(B);
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.9e-5: tmp = (-F / (F * math.sin(B))) - (x / B) elif F <= 6.4e-13: tmp = -x / math.tan(B) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.9e-5) tmp = Float64(Float64(Float64(-F) / Float64(F * sin(B))) - Float64(x / B)); elseif (F <= 6.4e-13) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.9e-5) tmp = (-F / (F * sin(B))) - (x / B); elseif (F <= 6.4e-13) tmp = -x / tan(B); else tmp = (x * (-1.0 / tan(B))) + (1.0 / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.9e-5], N[(N[((-F) / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.4e-13], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.9 \cdot 10^{-5}:\\
\;\;\;\;\frac{-F}{F \cdot \sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 6.4 \cdot 10^{-13}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\end{array}
\end{array}
if F < -2.9e-5Initial program 64.4%
Taylor expanded in F around -inf 82.8%
*-commutative82.8%
frac-times96.7%
neg-mul-196.7%
Applied egg-rr96.7%
Taylor expanded in B around 0 78.5%
if -2.9e-5 < F < 6.39999999999999999e-13Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 66.9%
mul-1-neg66.9%
associate-*l/66.9%
distribute-rgt-neg-in66.9%
Simplified66.9%
distribute-rgt-neg-out66.9%
neg-sub066.9%
clear-num66.8%
associate-*l/66.8%
*-un-lft-identity66.8%
Applied egg-rr66.8%
neg-sub066.8%
distribute-neg-frac66.8%
Simplified66.8%
associate-/r/66.8%
clear-num66.8%
add-sqr-sqrt23.8%
sqrt-unprod25.2%
sqr-neg25.2%
sqrt-unprod1.4%
add-sqr-sqrt2.4%
tan-quot2.4%
*-commutative2.4%
add-sqr-sqrt1.4%
sqrt-unprod23.5%
sqr-neg23.5%
sqrt-unprod38.3%
add-sqr-sqrt66.8%
neg-sub066.8%
un-div-inv67.0%
Applied egg-rr67.0%
neg-sub067.0%
distribute-neg-frac67.0%
Simplified67.0%
if 6.39999999999999999e-13 < F Initial program 63.2%
Taylor expanded in B around 0 44.1%
Taylor expanded in F around inf 69.0%
Final simplification71.1%
(FPCore (F B x)
:precision binary64
(if (<= F -6.1e-5)
(+ (* B (* x 0.3333333333333333)) (/ (- -1.0 x) B))
(if (or (<= F 44.0) (and (not (<= F 8e+81)) (<= F 1.45e+153)))
(/ (- x) (tan B))
(+ (* 0.3333333333333333 (* x B)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.1e-5) {
tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B);
} else if ((F <= 44.0) || (!(F <= 8e+81) && (F <= 1.45e+153))) {
tmp = -x / tan(B);
} else {
tmp = (0.3333333333333333 * (x * B)) + ((1.0 - 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.1d-5)) then
tmp = (b * (x * 0.3333333333333333d0)) + (((-1.0d0) - x) / b)
else if ((f <= 44.0d0) .or. (.not. (f <= 8d+81)) .and. (f <= 1.45d+153)) then
tmp = -x / tan(b)
else
tmp = (0.3333333333333333d0 * (x * b)) + ((1.0d0 - x) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.1e-5) {
tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B);
} else if ((F <= 44.0) || (!(F <= 8e+81) && (F <= 1.45e+153))) {
tmp = -x / Math.tan(B);
} else {
tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.1e-5: tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B) elif (F <= 44.0) or (not (F <= 8e+81) and (F <= 1.45e+153)): tmp = -x / math.tan(B) else: tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.1e-5) tmp = Float64(Float64(B * Float64(x * 0.3333333333333333)) + Float64(Float64(-1.0 - x) / B)); elseif ((F <= 44.0) || (!(F <= 8e+81) && (F <= 1.45e+153))) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(0.3333333333333333 * Float64(x * B)) + Float64(Float64(1.0 - x) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.1e-5) tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B); elseif ((F <= 44.0) || (~((F <= 8e+81)) && (F <= 1.45e+153))) tmp = -x / tan(B); else tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.1e-5], N[(N[(B * N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 44.0], And[N[Not[LessEqual[F, 8e+81]], $MachinePrecision], LessEqual[F, 1.45e+153]]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 * N[(x * B), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.1 \cdot 10^{-5}:\\
\;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 44 \lor \neg \left(F \leq 8 \cdot 10^{+81}\right) \land F \leq 1.45 \cdot 10^{+153}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(x \cdot B\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.09999999999999987e-5Initial program 64.4%
Taylor expanded in B around 0 44.6%
Taylor expanded in F around inf 31.1%
neg-sub031.1%
associate-+l-31.1%
add-sqr-sqrt15.5%
sqrt-unprod9.7%
sqr-neg9.7%
sqrt-unprod0.9%
add-sqr-sqrt1.6%
*-commutative1.6%
cancel-sign-sub-inv1.6%
Applied egg-rr67.3%
associate--r+67.3%
neg-sub067.3%
distribute-neg-frac67.3%
metadata-eval67.3%
Simplified67.3%
Taylor expanded in B around 0 51.1%
+-commutative51.1%
mul-1-neg51.1%
unsub-neg51.1%
*-commutative51.1%
associate-*l*51.1%
Simplified51.1%
if -6.09999999999999987e-5 < F < 44 or 7.99999999999999937e81 < F < 1.45000000000000001e153Initial program 98.7%
distribute-lft-neg-in98.7%
+-commutative98.7%
fma-def98.7%
+-commutative98.7%
*-commutative98.7%
fma-def98.7%
fma-def98.7%
metadata-eval98.7%
metadata-eval98.7%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
Taylor expanded in F around 0 64.0%
mul-1-neg64.0%
associate-*l/64.0%
distribute-rgt-neg-in64.0%
Simplified64.0%
distribute-rgt-neg-out64.0%
neg-sub064.0%
clear-num63.9%
associate-*l/63.9%
*-un-lft-identity63.9%
Applied egg-rr63.9%
neg-sub063.9%
distribute-neg-frac63.9%
Simplified63.9%
associate-/r/63.9%
clear-num63.9%
add-sqr-sqrt22.8%
sqrt-unprod24.4%
sqr-neg24.4%
sqrt-unprod1.5%
add-sqr-sqrt2.5%
tan-quot2.5%
*-commutative2.5%
add-sqr-sqrt1.5%
sqrt-unprod22.3%
sqr-neg22.3%
sqrt-unprod36.2%
add-sqr-sqrt63.9%
neg-sub063.9%
un-div-inv64.1%
Applied egg-rr64.1%
neg-sub064.1%
distribute-neg-frac64.1%
Simplified64.1%
if 44 < F < 7.99999999999999937e81 or 1.45000000000000001e153 < F Initial program 51.4%
Taylor expanded in B around 0 43.5%
Taylor expanded in F around inf 47.1%
Taylor expanded in B around 0 61.7%
associate--l+61.7%
div-sub61.7%
Simplified61.7%
Final simplification59.5%
(FPCore (F B x)
:precision binary64
(if (<= F -2.4e-116)
(- (/ -1.0 B) (/ x B))
(if (<= F 1.4e-9)
(/ (- x) B)
(+ (* 0.3333333333333333 (* x B)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.4e-116) {
tmp = (-1.0 / B) - (x / B);
} else if (F <= 1.4e-9) {
tmp = -x / B;
} else {
tmp = (0.3333333333333333 * (x * B)) + ((1.0 - 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 <= (-2.4d-116)) then
tmp = ((-1.0d0) / b) - (x / b)
else if (f <= 1.4d-9) then
tmp = -x / b
else
tmp = (0.3333333333333333d0 * (x * b)) + ((1.0d0 - x) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.4e-116) {
tmp = (-1.0 / B) - (x / B);
} else if (F <= 1.4e-9) {
tmp = -x / B;
} else {
tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.4e-116: tmp = (-1.0 / B) - (x / B) elif F <= 1.4e-9: tmp = -x / B else: tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.4e-116) tmp = Float64(Float64(-1.0 / B) - Float64(x / B)); elseif (F <= 1.4e-9) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(0.3333333333333333 * Float64(x * B)) + Float64(Float64(1.0 - x) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.4e-116) tmp = (-1.0 / B) - (x / B); elseif (F <= 1.4e-9) tmp = -x / B; else tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.4e-116], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e-9], N[((-x) / B), $MachinePrecision], N[(N[(0.3333333333333333 * N[(x * B), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.4 \cdot 10^{-116}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-9}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(x \cdot B\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.39999999999999993e-116Initial program 72.5%
Taylor expanded in B around 0 49.5%
Taylor expanded in B around 0 29.7%
Taylor expanded in F around -inf 43.8%
distribute-lft-in43.8%
neg-mul-143.8%
unsub-neg43.8%
associate-*r/43.8%
metadata-eval43.8%
Simplified43.8%
if -2.39999999999999993e-116 < F < 1.39999999999999992e-9Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 70.8%
mul-1-neg70.8%
associate-*l/70.8%
distribute-rgt-neg-in70.8%
Simplified70.8%
Taylor expanded in B around 0 35.6%
associate-*r/35.6%
neg-mul-135.6%
Simplified35.6%
if 1.39999999999999992e-9 < F Initial program 62.6%
Taylor expanded in B around 0 44.8%
Taylor expanded in F around inf 46.1%
Taylor expanded in B around 0 51.0%
associate--l+51.0%
div-sub51.0%
Simplified51.0%
Final simplification42.8%
(FPCore (F B x)
:precision binary64
(if (<= F -4.4e-126)
(+ (* B (* x 0.3333333333333333)) (/ (- -1.0 x) B))
(if (<= F 1.4e-9)
(/ (- x) B)
(+ (* 0.3333333333333333 (* x B)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.4e-126) {
tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B);
} else if (F <= 1.4e-9) {
tmp = -x / B;
} else {
tmp = (0.3333333333333333 * (x * B)) + ((1.0 - 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 <= (-4.4d-126)) then
tmp = (b * (x * 0.3333333333333333d0)) + (((-1.0d0) - x) / b)
else if (f <= 1.4d-9) then
tmp = -x / b
else
tmp = (0.3333333333333333d0 * (x * b)) + ((1.0d0 - x) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.4e-126) {
tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B);
} else if (F <= 1.4e-9) {
tmp = -x / B;
} else {
tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.4e-126: tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B) elif F <= 1.4e-9: tmp = -x / B else: tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.4e-126) tmp = Float64(Float64(B * Float64(x * 0.3333333333333333)) + Float64(Float64(-1.0 - x) / B)); elseif (F <= 1.4e-9) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(0.3333333333333333 * Float64(x * B)) + Float64(Float64(1.0 - x) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.4e-126) tmp = (B * (x * 0.3333333333333333)) + ((-1.0 - x) / B); elseif (F <= 1.4e-9) tmp = -x / B; else tmp = (0.3333333333333333 * (x * B)) + ((1.0 - x) / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.4e-126], N[(N[(B * N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e-9], N[((-x) / B), $MachinePrecision], N[(N[(0.3333333333333333 * N[(x * B), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.4 \cdot 10^{-126}:\\
\;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-9}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(x \cdot B\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4.40000000000000029e-126Initial program 72.7%
Taylor expanded in B around 0 50.0%
Taylor expanded in F around inf 34.3%
neg-sub034.3%
associate-+l-34.3%
add-sqr-sqrt12.7%
sqrt-unprod8.6%
sqr-neg8.6%
sqrt-unprod1.0%
add-sqr-sqrt1.9%
*-commutative1.9%
cancel-sign-sub-inv1.9%
Applied egg-rr62.3%
associate--r+62.3%
neg-sub062.3%
distribute-neg-frac62.3%
metadata-eval62.3%
Simplified62.3%
Taylor expanded in B around 0 44.0%
+-commutative44.0%
mul-1-neg44.0%
unsub-neg44.0%
*-commutative44.0%
associate-*l*44.0%
Simplified44.0%
if -4.40000000000000029e-126 < F < 1.39999999999999992e-9Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 70.5%
mul-1-neg70.5%
associate-*l/70.5%
distribute-rgt-neg-in70.5%
Simplified70.5%
Taylor expanded in B around 0 36.0%
associate-*r/36.0%
neg-mul-136.0%
Simplified36.0%
if 1.39999999999999992e-9 < F Initial program 62.6%
Taylor expanded in B around 0 44.8%
Taylor expanded in F around inf 46.1%
Taylor expanded in B around 0 51.0%
associate--l+51.0%
div-sub51.0%
Simplified51.0%
Final simplification43.1%
(FPCore (F B x) :precision binary64 (if (<= F -2.3e-116) (/ (- -1.0 x) B) (if (<= F 1.4e-9) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e-116) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4e-9) {
tmp = -x / B;
} else {
tmp = (1.0 - 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 <= (-2.3d-116)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.4d-9) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e-116) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4e-9) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.3e-116: tmp = (-1.0 - x) / B elif F <= 1.4e-9: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.3e-116) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.4e-9) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.3e-116) tmp = (-1.0 - x) / B; elseif (F <= 1.4e-9) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.3e-116], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.4e-9], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{-116}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-9}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.30000000000000002e-116Initial program 72.5%
Taylor expanded in B around 0 49.5%
Taylor expanded in F around inf 33.6%
neg-sub033.6%
associate-+l-33.6%
add-sqr-sqrt12.8%
sqrt-unprod8.7%
sqr-neg8.7%
sqrt-unprod1.0%
add-sqr-sqrt1.9%
*-commutative1.9%
cancel-sign-sub-inv1.9%
Applied egg-rr61.9%
associate--r+61.9%
neg-sub061.9%
distribute-neg-frac61.9%
metadata-eval61.9%
Simplified61.9%
Taylor expanded in B around 0 43.8%
associate-*r/43.8%
distribute-lft-in43.8%
metadata-eval43.8%
neg-mul-143.8%
Simplified43.8%
if -2.30000000000000002e-116 < F < 1.39999999999999992e-9Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 70.8%
mul-1-neg70.8%
associate-*l/70.8%
distribute-rgt-neg-in70.8%
Simplified70.8%
Taylor expanded in B around 0 35.6%
associate-*r/35.6%
neg-mul-135.6%
Simplified35.6%
if 1.39999999999999992e-9 < F Initial program 62.6%
Taylor expanded in B around 0 44.8%
Taylor expanded in F around inf 46.1%
Taylor expanded in B around 0 50.5%
Final simplification42.7%
(FPCore (F B x) :precision binary64 (if (<= F -2.4e-116) (- (/ -1.0 B) (/ x B)) (if (<= F 1.4e-9) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.4e-116) {
tmp = (-1.0 / B) - (x / B);
} else if (F <= 1.4e-9) {
tmp = -x / B;
} else {
tmp = (1.0 - 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 <= (-2.4d-116)) then
tmp = ((-1.0d0) / b) - (x / b)
else if (f <= 1.4d-9) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.4e-116) {
tmp = (-1.0 / B) - (x / B);
} else if (F <= 1.4e-9) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.4e-116: tmp = (-1.0 / B) - (x / B) elif F <= 1.4e-9: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.4e-116) tmp = Float64(Float64(-1.0 / B) - Float64(x / B)); elseif (F <= 1.4e-9) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.4e-116) tmp = (-1.0 / B) - (x / B); elseif (F <= 1.4e-9) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.4e-116], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e-9], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.4 \cdot 10^{-116}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-9}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.39999999999999993e-116Initial program 72.5%
Taylor expanded in B around 0 49.5%
Taylor expanded in B around 0 29.7%
Taylor expanded in F around -inf 43.8%
distribute-lft-in43.8%
neg-mul-143.8%
unsub-neg43.8%
associate-*r/43.8%
metadata-eval43.8%
Simplified43.8%
if -2.39999999999999993e-116 < F < 1.39999999999999992e-9Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 70.8%
mul-1-neg70.8%
associate-*l/70.8%
distribute-rgt-neg-in70.8%
Simplified70.8%
Taylor expanded in B around 0 35.6%
associate-*r/35.6%
neg-mul-135.6%
Simplified35.6%
if 1.39999999999999992e-9 < F Initial program 62.6%
Taylor expanded in B around 0 44.8%
Taylor expanded in F around inf 46.1%
Taylor expanded in B around 0 50.5%
Final simplification42.7%
(FPCore (F B x) :precision binary64 (if (or (<= x -2.3e-122) (not (<= x 0.00166))) (/ (- x) B) (/ -1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -2.3e-122) || !(x <= 0.00166)) {
tmp = -x / B;
} else {
tmp = -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 ((x <= (-2.3d-122)) .or. (.not. (x <= 0.00166d0))) then
tmp = -x / b
else
tmp = (-1.0d0) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -2.3e-122) || !(x <= 0.00166)) {
tmp = -x / B;
} else {
tmp = -1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -2.3e-122) or not (x <= 0.00166): tmp = -x / B else: tmp = -1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -2.3e-122) || !(x <= 0.00166)) tmp = Float64(Float64(-x) / B); else tmp = Float64(-1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -2.3e-122) || ~((x <= 0.00166))) tmp = -x / B; else tmp = -1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.3e-122], N[Not[LessEqual[x, 0.00166]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{-122} \lor \neg \left(x \leq 0.00166\right):\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B}\\
\end{array}
\end{array}
if x < -2.30000000000000007e-122 or 0.00166 < x Initial program 85.3%
distribute-lft-neg-in85.3%
+-commutative85.3%
fma-def85.3%
+-commutative85.3%
*-commutative85.3%
fma-def85.3%
fma-def85.3%
metadata-eval85.3%
metadata-eval85.3%
associate-*r/85.4%
*-rgt-identity85.4%
Simplified85.4%
Taylor expanded in F around 0 83.4%
mul-1-neg83.4%
associate-*l/83.4%
distribute-rgt-neg-in83.4%
Simplified83.4%
Taylor expanded in B around 0 45.7%
associate-*r/45.7%
neg-mul-145.7%
Simplified45.7%
if -2.30000000000000007e-122 < x < 0.00166Initial program 72.1%
Taylor expanded in B around 0 39.6%
Taylor expanded in F around inf 17.1%
neg-sub017.1%
associate-+l-17.1%
add-sqr-sqrt9.2%
sqrt-unprod12.8%
sqr-neg12.8%
sqrt-unprod4.3%
add-sqr-sqrt8.6%
*-commutative8.6%
cancel-sign-sub-inv8.6%
Applied egg-rr21.8%
associate--r+21.8%
neg-sub021.8%
distribute-neg-frac21.8%
metadata-eval21.8%
Simplified21.8%
Taylor expanded in x around 0 15.3%
Final simplification31.7%
(FPCore (F B x) :precision binary64 (if (<= F 1.4e-9) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.4e-9) {
tmp = -x / B;
} else {
tmp = (1.0 - 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 <= 1.4d-9) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 1.4e-9) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 1.4e-9: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 1.4e-9) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 1.4e-9) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 1.4e-9], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.4 \cdot 10^{-9}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 1.39999999999999992e-9Initial program 84.7%
distribute-lft-neg-in84.7%
+-commutative84.7%
fma-def84.7%
+-commutative84.7%
*-commutative84.7%
fma-def84.7%
fma-def84.7%
metadata-eval84.7%
metadata-eval84.7%
associate-*r/84.8%
*-rgt-identity84.8%
Simplified84.8%
Taylor expanded in F around 0 56.9%
mul-1-neg56.9%
associate-*l/56.8%
distribute-rgt-neg-in56.8%
Simplified56.8%
Taylor expanded in B around 0 30.1%
associate-*r/30.1%
neg-mul-130.1%
Simplified30.1%
if 1.39999999999999992e-9 < F Initial program 62.6%
Taylor expanded in B around 0 44.8%
Taylor expanded in F around inf 46.1%
Taylor expanded in B around 0 50.5%
Final simplification35.2%
(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 79.2%
Taylor expanded in B around 0 59.9%
Taylor expanded in F around inf 43.0%
neg-sub043.0%
associate-+l-43.0%
add-sqr-sqrt19.2%
sqrt-unprod15.8%
sqr-neg15.8%
sqrt-unprod2.4%
add-sqr-sqrt5.2%
*-commutative5.2%
cancel-sign-sub-inv5.2%
Applied egg-rr52.4%
associate--r+52.4%
neg-sub052.4%
distribute-neg-frac52.4%
metadata-eval52.4%
Simplified52.4%
Taylor expanded in x around 0 11.0%
Final simplification11.0%
herbie shell --seed 2023299
(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))))))