
(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 21 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 -3.1e+14)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 75000000.0)
(-
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* 2.0 x)) -0.5))
(* x (/ 1.0 (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 <= -3.1e+14) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 75000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (2.0 * x)), -0.5)) - (x * (1.0 / 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 <= (-3.1d+14)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 75000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (2.0d0 * x)) ** (-0.5d0))) - (x * (1.0d0 / 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 <= -3.1e+14) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 75000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (2.0 * x)), -0.5)) - (x * (1.0 / 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 <= -3.1e+14: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 75000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (2.0 * x)), -0.5)) - (x * (1.0 / 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 <= -3.1e+14) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 75000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(2.0 * x)) ^ -0.5)) - Float64(x * Float64(1.0 / 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 <= -3.1e+14) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 75000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (2.0 * x)) ^ -0.5)) - (x * (1.0 / 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, -3.1e+14], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 75000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $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 -3.1 \cdot 10^{+14}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 75000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{-0.5} - x \cdot \frac{1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -3.1e14Initial program 68.2%
+-commutative68.2%
unsub-neg68.2%
associate-*l/77.3%
associate-*r/77.2%
*-commutative77.2%
Simplified77.4%
clear-num77.4%
inv-pow77.4%
fma-def77.4%
fma-udef77.4%
*-commutative77.4%
fma-def77.4%
fma-def77.4%
Applied egg-rr77.4%
unpow-177.4%
fma-udef77.4%
fma-udef77.4%
unpow277.4%
+-commutative77.4%
associate-+r+77.4%
+-commutative77.4%
+-commutative77.4%
unpow277.4%
fma-def77.4%
+-commutative77.4%
fma-def77.4%
Simplified77.4%
Taylor expanded in F around -inf 99.8%
if -3.1e14 < F < 7.5e7Initial program 99.5%
if 7.5e7 < F Initial program 56.3%
+-commutative56.3%
unsub-neg56.3%
associate-*l/70.8%
associate-*r/70.7%
*-commutative70.7%
Simplified70.8%
clear-num70.8%
inv-pow70.8%
fma-def70.8%
fma-udef70.8%
*-commutative70.8%
fma-def70.8%
fma-def70.8%
Applied egg-rr70.8%
unpow-170.8%
fma-udef70.8%
fma-udef70.8%
unpow270.8%
+-commutative70.8%
associate-+r+70.8%
+-commutative70.8%
+-commutative70.8%
unpow270.8%
fma-def70.8%
+-commutative70.8%
fma-def70.8%
Simplified70.8%
Taylor expanded in F around inf 99.8%
Final simplification99.7%
(FPCore (F B x) :precision binary64 (- (/ F (* (sin B) (hypot F (sqrt 2.0)))) (/ x (tan B))))
double code(double F, double B, double x) {
return (F / (sin(B) * hypot(F, sqrt(2.0)))) - (x / tan(B));
}
public static double code(double F, double B, double x) {
return (F / (Math.sin(B) * Math.hypot(F, Math.sqrt(2.0)))) - (x / Math.tan(B));
}
def code(F, B, x): return (F / (math.sin(B) * math.hypot(F, math.sqrt(2.0)))) - (x / math.tan(B))
function code(F, B, x) return Float64(Float64(F / Float64(sin(B) * hypot(F, sqrt(2.0)))) - Float64(x / tan(B))) end
function tmp = code(F, B, x) tmp = (F / (sin(B) * hypot(F, sqrt(2.0)))) - (x / tan(B)); end
code[F_, B_, x_] := N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[F ^ 2 + N[Sqrt[2.0], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{F}{\sin B \cdot \mathsf{hypot}\left(F, \sqrt{2}\right)} - \frac{x}{\tan B}
\end{array}
Initial program 78.6%
+-commutative78.6%
unsub-neg78.6%
associate-*l/85.2%
associate-*r/85.1%
*-commutative85.1%
Simplified85.2%
clear-num85.2%
inv-pow85.2%
fma-def85.2%
fma-udef85.2%
*-commutative85.2%
fma-def85.2%
fma-def85.2%
Applied egg-rr85.2%
unpow-185.2%
fma-udef85.2%
fma-udef85.2%
unpow285.2%
+-commutative85.2%
associate-+r+85.2%
+-commutative85.2%
+-commutative85.2%
unpow285.2%
fma-def85.2%
+-commutative85.2%
fma-def85.2%
Simplified85.2%
un-div-inv85.3%
div-inv85.2%
fma-def85.2%
pow-flip85.3%
metadata-eval85.3%
pow1/285.3%
add-sqr-sqrt73.2%
hypot-def87.5%
Applied egg-rr87.5%
Taylor expanded in x around 0 85.3%
*-commutative85.3%
unpow285.3%
unpow285.3%
hypot-def99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4e+18)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 92000000.0)
(- (* F (/ 1.0 (* (sin B) (sqrt (+ 2.0 (* F F)))))) 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 <= -4e+18) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 92000000.0) {
tmp = (F * (1.0 / (sin(B) * sqrt((2.0 + (F * F)))))) - 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 <= (-4d+18)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 92000000.0d0) then
tmp = (f * (1.0d0 / (sin(b) * sqrt((2.0d0 + (f * f)))))) - 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 <= -4e+18) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 92000000.0) {
tmp = (F * (1.0 / (Math.sin(B) * Math.sqrt((2.0 + (F * F)))))) - 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 <= -4e+18: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 92000000.0: tmp = (F * (1.0 / (math.sin(B) * math.sqrt((2.0 + (F * F)))))) - 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 <= -4e+18) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 92000000.0) tmp = Float64(Float64(F * Float64(1.0 / Float64(sin(B) * sqrt(Float64(2.0 + Float64(F * F)))))) - 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 <= -4e+18) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 92000000.0) tmp = (F * (1.0 / (sin(B) * sqrt((2.0 + (F * F)))))) - 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, -4e+18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 92000000.0], N[(N[(F * N[(1.0 / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 + N[(F * F), $MachinePrecision]), $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 -4 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 92000000:\\
\;\;\;\;F \cdot \frac{1}{\sin B \cdot \sqrt{2 + F \cdot F}} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -4e18Initial program 67.3%
+-commutative67.3%
unsub-neg67.3%
associate-*l/76.6%
associate-*r/76.5%
*-commutative76.5%
Simplified76.7%
clear-num76.7%
inv-pow76.7%
fma-def76.7%
fma-udef76.7%
*-commutative76.7%
fma-def76.7%
fma-def76.7%
Applied egg-rr76.7%
unpow-176.7%
fma-udef76.7%
fma-udef76.7%
unpow276.7%
+-commutative76.7%
associate-+r+76.7%
+-commutative76.7%
+-commutative76.7%
unpow276.7%
fma-def76.7%
+-commutative76.7%
fma-def76.7%
Simplified76.7%
Taylor expanded in F around -inf 99.7%
if -4e18 < F < 9.2e7Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.5%
clear-num99.5%
inv-pow99.5%
fma-def99.5%
fma-udef99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
Applied egg-rr99.5%
unpow-199.5%
fma-udef99.5%
fma-udef99.5%
unpow299.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
+-commutative99.5%
unpow299.5%
fma-def99.5%
+-commutative99.5%
fma-def99.5%
Simplified99.5%
Taylor expanded in x around 0 99.5%
+-commutative99.5%
unpow299.5%
Simplified99.5%
if 9.2e7 < F Initial program 56.3%
+-commutative56.3%
unsub-neg56.3%
associate-*l/70.8%
associate-*r/70.7%
*-commutative70.7%
Simplified70.8%
clear-num70.8%
inv-pow70.8%
fma-def70.8%
fma-udef70.8%
*-commutative70.8%
fma-def70.8%
fma-def70.8%
Applied egg-rr70.8%
unpow-170.8%
fma-udef70.8%
fma-udef70.8%
unpow270.8%
+-commutative70.8%
associate-+r+70.8%
+-commutative70.8%
+-commutative70.8%
unpow270.8%
fma-def70.8%
+-commutative70.8%
fma-def70.8%
Simplified70.8%
Taylor expanded in F around inf 99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.42)
(- (/ 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 <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.42) {
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 <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.42d0) 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 <= -1.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.42) {
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 <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.42: 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 <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.42) 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 <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.42) 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, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.42], 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 -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 70.0%
+-commutative70.0%
unsub-neg70.0%
associate-*l/78.5%
associate-*r/78.4%
*-commutative78.4%
Simplified78.6%
clear-num78.6%
inv-pow78.6%
fma-def78.6%
fma-udef78.6%
*-commutative78.6%
fma-def78.6%
fma-def78.6%
Applied egg-rr78.6%
unpow-178.6%
fma-udef78.6%
fma-udef78.6%
unpow278.6%
+-commutative78.6%
associate-+r+78.6%
+-commutative78.6%
+-commutative78.6%
unpow278.6%
fma-def78.6%
+-commutative78.6%
fma-def78.6%
Simplified78.6%
Taylor expanded in F around -inf 97.7%
if -1.3999999999999999 < F < 1.4199999999999999Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.4%
associate-*r/99.5%
*-commutative99.5%
Simplified99.5%
clear-num99.5%
inv-pow99.5%
fma-def99.5%
fma-udef99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
Applied egg-rr99.5%
unpow-199.5%
fma-udef99.5%
fma-udef99.5%
unpow299.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
+-commutative99.5%
unpow299.5%
fma-def99.5%
+-commutative99.5%
fma-def99.5%
Simplified99.5%
un-div-inv99.5%
div-inv99.5%
fma-def99.5%
pow-flip99.5%
metadata-eval99.5%
pow1/299.5%
add-sqr-sqrt99.5%
hypot-def99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 99.5%
*-commutative99.5%
unpow299.5%
unpow299.5%
hypot-def99.5%
Simplified99.5%
Taylor expanded in F around 0 98.3%
if 1.4199999999999999 < F Initial program 56.9%
+-commutative56.9%
unsub-neg56.9%
associate-*l/71.2%
associate-*r/71.1%
*-commutative71.1%
Simplified71.1%
clear-num71.1%
inv-pow71.1%
fma-def71.1%
fma-udef71.1%
*-commutative71.1%
fma-def71.1%
fma-def71.1%
Applied egg-rr71.1%
unpow-171.1%
fma-udef71.1%
fma-udef71.1%
unpow271.1%
+-commutative71.1%
associate-+r+71.1%
+-commutative71.1%
+-commutative71.1%
unpow271.1%
fma-def71.1%
+-commutative71.1%
fma-def71.1%
Simplified71.1%
Taylor expanded in F around inf 99.2%
Final simplification98.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.039)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.75e-100)
(+ (* x (/ -1.0 (tan B))) (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* 2.0 x))))))
(if (<= F 49000.0)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* 2.0 x)) -0.5)) (/ x 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 <= -0.039) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.75e-100) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (2.0 + (2.0 * x)))));
} else if (F <= 49000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (2.0 * x)), -0.5)) - (x / 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 <= (-0.039d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.75d-100) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / b) * sqrt((1.0d0 / (2.0d0 + (2.0d0 * x)))))
else if (f <= 49000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (2.0d0 * x)) ** (-0.5d0))) - (x / 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 <= -0.039) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.75e-100) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / B) * Math.sqrt((1.0 / (2.0 + (2.0 * x)))));
} else if (F <= 49000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (2.0 * x)), -0.5)) - (x / 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 <= -0.039: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.75e-100: tmp = (x * (-1.0 / math.tan(B))) + ((F / B) * math.sqrt((1.0 / (2.0 + (2.0 * x))))) elif F <= 49000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (2.0 * x)), -0.5)) - (x / 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 <= -0.039) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.75e-100) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(2.0 * x)))))); elseif (F <= 49000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(2.0 * x)) ^ -0.5)) - Float64(x / 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 <= -0.039) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.75e-100) tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (2.0 + (2.0 * x))))); elseif (F <= 49000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (2.0 * x)) ^ -0.5)) - (x / 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, -0.039], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.75e-100], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 49000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / 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 -0.039:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.75 \cdot 10^{-100}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}\\
\mathbf{elif}\;F \leq 49000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -0.0389999999999999999Initial program 70.3%
+-commutative70.3%
unsub-neg70.3%
associate-*l/78.8%
associate-*r/78.7%
*-commutative78.7%
Simplified78.9%
clear-num78.9%
inv-pow78.9%
fma-def78.9%
fma-udef78.9%
*-commutative78.9%
fma-def78.9%
fma-def78.9%
Applied egg-rr78.9%
unpow-178.9%
fma-udef78.9%
fma-udef78.9%
unpow278.9%
+-commutative78.9%
associate-+r+78.9%
+-commutative78.9%
+-commutative78.9%
unpow278.9%
fma-def78.9%
+-commutative78.9%
fma-def78.9%
Simplified78.9%
Taylor expanded in F around -inf 96.6%
if -0.0389999999999999999 < F < 1.75e-100Initial program 99.5%
Taylor expanded in B around 0 86.1%
Taylor expanded in F around 0 86.1%
if 1.75e-100 < F < 49000Initial program 99.5%
Taylor expanded in B around 0 99.5%
if 49000 < F Initial program 56.3%
+-commutative56.3%
unsub-neg56.3%
associate-*l/70.8%
associate-*r/70.7%
*-commutative70.7%
Simplified70.8%
clear-num70.8%
inv-pow70.8%
fma-def70.8%
fma-udef70.8%
*-commutative70.8%
fma-def70.8%
fma-def70.8%
Applied egg-rr70.8%
unpow-170.8%
fma-udef70.8%
fma-udef70.8%
unpow270.8%
+-commutative70.8%
associate-+r+70.8%
+-commutative70.8%
+-commutative70.8%
unpow270.8%
fma-def70.8%
+-commutative70.8%
fma-def70.8%
Simplified70.8%
Taylor expanded in F around inf 99.8%
Final simplification93.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (+ (+ 2.0 (* F F)) (* 2.0 x)) -0.5)) (t_1 (/ x (tan B))))
(if (<= F -0.1)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 1.06e-100)
(+ (* x (/ -1.0 (tan B))) (* t_0 (/ F B)))
(if (<= F 1560000.0)
(- (* (/ F (sin B)) t_0) (/ x B))
(- (/ 1.0 (sin B)) t_1))))))
double code(double F, double B, double x) {
double t_0 = pow(((2.0 + (F * F)) + (2.0 * x)), -0.5);
double t_1 = x / tan(B);
double tmp;
if (F <= -0.1) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 1.06e-100) {
tmp = (x * (-1.0 / tan(B))) + (t_0 * (F / B));
} else if (F <= 1560000.0) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_1;
}
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 = ((2.0d0 + (f * f)) + (2.0d0 * x)) ** (-0.5d0)
t_1 = x / tan(b)
if (f <= (-0.1d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 1.06d-100) then
tmp = (x * ((-1.0d0) / tan(b))) + (t_0 * (f / b))
else if (f <= 1560000.0d0) then
tmp = ((f / sin(b)) * t_0) - (x / b)
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.pow(((2.0 + (F * F)) + (2.0 * x)), -0.5);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -0.1) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 1.06e-100) {
tmp = (x * (-1.0 / Math.tan(B))) + (t_0 * (F / B));
} else if (F <= 1560000.0) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = math.pow(((2.0 + (F * F)) + (2.0 * x)), -0.5) t_1 = x / math.tan(B) tmp = 0 if F <= -0.1: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 1.06e-100: tmp = (x * (-1.0 / math.tan(B))) + (t_0 * (F / B)) elif F <= 1560000.0: tmp = ((F / math.sin(B)) * t_0) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(2.0 + Float64(F * F)) + Float64(2.0 * x)) ^ -0.5 t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.1) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 1.06e-100) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(t_0 * Float64(F / B))); elseif (F <= 1560000.0) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((2.0 + (F * F)) + (2.0 * x)) ^ -0.5; t_1 = x / tan(B); tmp = 0.0; if (F <= -0.1) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 1.06e-100) tmp = (x * (-1.0 / tan(B))) + (t_0 * (F / B)); elseif (F <= 1560000.0) tmp = ((F / sin(B)) * t_0) - (x / B); else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.1], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 1.06e-100], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1560000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{-0.5}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.1:\\
\;\;\;\;\frac{-1}{\sin B} - t_1\\
\mathbf{elif}\;F \leq 1.06 \cdot 10^{-100}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t_0 \cdot \frac{F}{B}\\
\mathbf{elif}\;F \leq 1560000:\\
\;\;\;\;\frac{F}{\sin B} \cdot t_0 - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_1\\
\end{array}
\end{array}
if F < -0.10000000000000001Initial program 70.3%
+-commutative70.3%
unsub-neg70.3%
associate-*l/78.8%
associate-*r/78.7%
*-commutative78.7%
Simplified78.9%
clear-num78.9%
inv-pow78.9%
fma-def78.9%
fma-udef78.9%
*-commutative78.9%
fma-def78.9%
fma-def78.9%
Applied egg-rr78.9%
unpow-178.9%
fma-udef78.9%
fma-udef78.9%
unpow278.9%
+-commutative78.9%
associate-+r+78.9%
+-commutative78.9%
+-commutative78.9%
unpow278.9%
fma-def78.9%
+-commutative78.9%
fma-def78.9%
Simplified78.9%
Taylor expanded in F around -inf 96.6%
if -0.10000000000000001 < F < 1.0600000000000001e-100Initial program 99.5%
Taylor expanded in B around 0 86.1%
if 1.0600000000000001e-100 < F < 1.56e6Initial program 99.5%
Taylor expanded in B around 0 99.5%
if 1.56e6 < F Initial program 56.3%
+-commutative56.3%
unsub-neg56.3%
associate-*l/70.8%
associate-*r/70.7%
*-commutative70.7%
Simplified70.8%
clear-num70.8%
inv-pow70.8%
fma-def70.8%
fma-udef70.8%
*-commutative70.8%
fma-def70.8%
fma-def70.8%
Applied egg-rr70.8%
unpow-170.8%
fma-udef70.8%
fma-udef70.8%
unpow270.8%
+-commutative70.8%
associate-+r+70.8%
+-commutative70.8%
+-commutative70.8%
unpow270.8%
fma-def70.8%
+-commutative70.8%
fma-def70.8%
Simplified70.8%
Taylor expanded in F around inf 99.8%
Final simplification93.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.046)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.9e-18)
(+ (* x (/ -1.0 (tan B))) (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* 2.0 x))))))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.046) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.9e-18) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (2.0 + (2.0 * x)))));
} 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 <= (-0.046d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.9d-18) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / b) * sqrt((1.0d0 / (2.0d0 + (2.0d0 * x)))))
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 <= -0.046) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.9e-18) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / B) * Math.sqrt((1.0 / (2.0 + (2.0 * x)))));
} 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 <= -0.046: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.9e-18: tmp = (x * (-1.0 / math.tan(B))) + ((F / B) * math.sqrt((1.0 / (2.0 + (2.0 * x))))) 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 <= -0.046) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.9e-18) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(2.0 * x)))))); 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 <= -0.046) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.9e-18) tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (2.0 + (2.0 * x))))); 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, -0.046], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.9e-18], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x), $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 -0.046:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-18}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -0.045999999999999999Initial program 70.3%
+-commutative70.3%
unsub-neg70.3%
associate-*l/78.8%
associate-*r/78.7%
*-commutative78.7%
Simplified78.9%
clear-num78.9%
inv-pow78.9%
fma-def78.9%
fma-udef78.9%
*-commutative78.9%
fma-def78.9%
fma-def78.9%
Applied egg-rr78.9%
unpow-178.9%
fma-udef78.9%
fma-udef78.9%
unpow278.9%
+-commutative78.9%
associate-+r+78.9%
+-commutative78.9%
+-commutative78.9%
unpow278.9%
fma-def78.9%
+-commutative78.9%
fma-def78.9%
Simplified78.9%
Taylor expanded in F around -inf 96.6%
if -0.045999999999999999 < F < 1.8999999999999999e-18Initial program 99.6%
Taylor expanded in B around 0 85.2%
Taylor expanded in F around 0 85.2%
if 1.8999999999999999e-18 < F Initial program 58.0%
+-commutative58.0%
unsub-neg58.0%
associate-*l/71.9%
associate-*r/71.8%
*-commutative71.8%
Simplified71.8%
clear-num71.9%
inv-pow71.9%
fma-def71.9%
fma-udef71.9%
*-commutative71.9%
fma-def71.9%
fma-def71.9%
Applied egg-rr71.9%
unpow-171.9%
fma-udef71.9%
fma-udef71.9%
unpow271.9%
+-commutative71.9%
associate-+r+71.9%
+-commutative71.9%
+-commutative71.9%
unpow271.9%
fma-def71.9%
+-commutative71.9%
fma-def71.9%
Simplified71.9%
Taylor expanded in F around inf 96.9%
Final simplification92.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ 1.0 (tan B)))))
(if (<= F -2.7e+185)
(- (/ -1.0 B) t_0)
(if (<= F -9e-38)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 2800.0) (* x (/ (- (cos B)) (sin B))) (- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
double t_0 = x * (1.0 / tan(B));
double tmp;
if (F <= -2.7e+185) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -9e-38) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 2800.0) {
tmp = x * (-cos(B) / sin(B));
} else {
tmp = (1.0 / 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 * (1.0d0 / tan(b))
if (f <= (-2.7d+185)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= (-9d-38)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 2800.0d0) then
tmp = x * (-cos(b) / sin(b))
else
tmp = (1.0d0 / b) - t_0
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 <= -2.7e+185) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -9e-38) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 2800.0) {
tmp = x * (-Math.cos(B) / Math.sin(B));
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x * (1.0 / math.tan(B)) tmp = 0 if F <= -2.7e+185: tmp = (-1.0 / B) - t_0 elif F <= -9e-38: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 2800.0: tmp = x * (-math.cos(B) / math.sin(B)) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x * Float64(1.0 / tan(B))) tmp = 0.0 if (F <= -2.7e+185) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= -9e-38) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 2800.0) tmp = Float64(x * Float64(Float64(-cos(B)) / sin(B))); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (1.0 / tan(B)); tmp = 0.0; if (F <= -2.7e+185) tmp = (-1.0 / B) - t_0; elseif (F <= -9e-38) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 2800.0) tmp = x * (-cos(B) / sin(B)); else tmp = (1.0 / B) - t_0; 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, -2.7e+185], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -9e-38], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2800.0], N[(x * N[((-N[Cos[B], $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -2.7 \cdot 10^{+185}:\\
\;\;\;\;\frac{-1}{B} - t_0\\
\mathbf{elif}\;F \leq -9 \cdot 10^{-38}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2800:\\
\;\;\;\;x \cdot \frac{-\cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\
\end{array}
\end{array}
if F < -2.70000000000000007e185Initial program 50.6%
Taylor expanded in F around -inf 75.3%
Taylor expanded in B around 0 85.6%
if -2.70000000000000007e185 < F < -9.00000000000000018e-38Initial program 79.2%
Taylor expanded in F around -inf 82.5%
Taylor expanded in B around 0 69.3%
Taylor expanded in x around 0 77.8%
mul-1-neg77.8%
Simplified77.8%
if -9.00000000000000018e-38 < F < 2800Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.5%
clear-num99.5%
inv-pow99.5%
fma-def99.5%
fma-udef99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
Applied egg-rr99.5%
unpow-199.5%
fma-udef99.5%
fma-udef99.5%
unpow299.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
+-commutative99.5%
unpow299.5%
fma-def99.5%
+-commutative99.5%
fma-def99.5%
Simplified99.5%
un-div-inv99.6%
div-inv99.5%
fma-def99.5%
pow-flip99.5%
metadata-eval99.5%
pow1/299.5%
add-sqr-sqrt99.5%
hypot-def99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 70.7%
mul-1-neg70.7%
associate-/l*70.5%
associate-/r/70.7%
distribute-rgt-neg-in70.7%
Simplified70.7%
if 2800 < F Initial program 56.3%
Taylor expanded in B around 0 41.1%
Taylor expanded in F around inf 68.7%
Final simplification72.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ 1.0 (tan B)))))
(if (<= F -2.8e+187)
(- (/ -1.0 B) t_0)
(if (<= F -9e-38)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 2800.0) (/ (* x (- (cos B))) (sin B)) (- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
double t_0 = x * (1.0 / tan(B));
double tmp;
if (F <= -2.8e+187) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -9e-38) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 2800.0) {
tmp = (x * -cos(B)) / sin(B);
} else {
tmp = (1.0 / 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 * (1.0d0 / tan(b))
if (f <= (-2.8d+187)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= (-9d-38)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 2800.0d0) then
tmp = (x * -cos(b)) / sin(b)
else
tmp = (1.0d0 / b) - t_0
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 <= -2.8e+187) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -9e-38) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 2800.0) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x * (1.0 / math.tan(B)) tmp = 0 if F <= -2.8e+187: tmp = (-1.0 / B) - t_0 elif F <= -9e-38: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 2800.0: tmp = (x * -math.cos(B)) / math.sin(B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x * Float64(1.0 / tan(B))) tmp = 0.0 if (F <= -2.8e+187) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= -9e-38) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 2800.0) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (1.0 / tan(B)); tmp = 0.0; if (F <= -2.8e+187) tmp = (-1.0 / B) - t_0; elseif (F <= -9e-38) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 2800.0) tmp = (x * -cos(B)) / sin(B); else tmp = (1.0 / B) - t_0; 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, -2.8e+187], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -9e-38], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2800.0], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -2.8 \cdot 10^{+187}:\\
\;\;\;\;\frac{-1}{B} - t_0\\
\mathbf{elif}\;F \leq -9 \cdot 10^{-38}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2800:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\
\end{array}
\end{array}
if F < -2.79999999999999989e187Initial program 50.6%
Taylor expanded in F around -inf 75.3%
Taylor expanded in B around 0 85.6%
if -2.79999999999999989e187 < F < -9.00000000000000018e-38Initial program 79.2%
Taylor expanded in F around -inf 82.5%
Taylor expanded in B around 0 69.3%
Taylor expanded in x around 0 77.8%
mul-1-neg77.8%
Simplified77.8%
if -9.00000000000000018e-38 < F < 2800Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in F around 0 70.7%
associate-*r/70.7%
*-commutative70.7%
associate-*r*70.7%
mul-1-neg70.7%
Simplified70.7%
if 2800 < F Initial program 56.3%
Taylor expanded in B around 0 41.1%
Taylor expanded in F around inf 68.7%
Final simplification72.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.25e-43)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 5.8e-30)
(/ (* x (- (cos B))) (sin 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 <= -2.25e-43) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 5.8e-30) {
tmp = (x * -cos(B)) / sin(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 <= (-2.25d-43)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 5.8d-30) then
tmp = (x * -cos(b)) / sin(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 <= -2.25e-43) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 5.8e-30) {
tmp = (x * -Math.cos(B)) / Math.sin(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 <= -2.25e-43: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 5.8e-30: tmp = (x * -math.cos(B)) / math.sin(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 <= -2.25e-43) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 5.8e-30) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(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 <= -2.25e-43) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 5.8e-30) tmp = (x * -cos(B)) / sin(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, -2.25e-43], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5.8e-30], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[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 -2.25 \cdot 10^{-43}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-30}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -2.25000000000000012e-43Initial program 71.8%
+-commutative71.8%
unsub-neg71.8%
associate-*l/79.8%
associate-*r/79.8%
*-commutative79.8%
Simplified79.9%
clear-num79.9%
inv-pow79.9%
fma-def79.9%
fma-udef79.9%
*-commutative79.9%
fma-def79.9%
fma-def79.9%
Applied egg-rr79.9%
unpow-179.9%
fma-udef79.9%
fma-udef79.9%
unpow279.9%
+-commutative79.9%
associate-+r+79.9%
+-commutative79.9%
+-commutative79.9%
unpow279.9%
fma-def79.9%
+-commutative79.9%
fma-def79.9%
Simplified79.9%
Taylor expanded in F around -inf 93.3%
if -2.25000000000000012e-43 < F < 5.79999999999999978e-30Initial program 99.6%
+-commutative99.6%
fma-def99.6%
+-commutative99.6%
*-commutative99.6%
fma-def99.6%
fma-def99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-in99.6%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in F around 0 72.6%
associate-*r/72.6%
*-commutative72.6%
associate-*r*72.6%
mul-1-neg72.6%
Simplified72.6%
if 5.79999999999999978e-30 < F Initial program 58.0%
+-commutative58.0%
unsub-neg58.0%
associate-*l/71.9%
associate-*r/71.8%
*-commutative71.8%
Simplified71.8%
clear-num71.9%
inv-pow71.9%
fma-def71.9%
fma-udef71.9%
*-commutative71.9%
fma-def71.9%
fma-def71.9%
Applied egg-rr71.9%
unpow-171.9%
fma-udef71.9%
fma-udef71.9%
unpow271.9%
+-commutative71.9%
associate-+r+71.9%
+-commutative71.9%
+-commutative71.9%
unpow271.9%
fma-def71.9%
+-commutative71.9%
fma-def71.9%
Simplified71.9%
Taylor expanded in F around inf 96.9%
Final simplification86.2%
(FPCore (F B x)
:precision binary64
(if (<= F -6.2e-38)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 2800.0)
(/ (* x (- (cos B))) (sin B))
(- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.2e-38) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 2800.0) {
tmp = (x * -cos(B)) / sin(B);
} else {
tmp = (1.0 / B) - (x * (1.0 / tan(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.2d-38)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 2800.0d0) then
tmp = (x * -cos(b)) / sin(b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.2e-38) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 2800.0) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.2e-38: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 2800.0: tmp = (x * -math.cos(B)) / math.sin(B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.2e-38) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 2800.0) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.2e-38) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 2800.0) tmp = (x * -cos(B)) / sin(B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.2e-38], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2800.0], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.2 \cdot 10^{-38}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2800:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < -6.19999999999999966e-38Initial program 71.8%
+-commutative71.8%
unsub-neg71.8%
associate-*l/79.8%
associate-*r/79.8%
*-commutative79.8%
Simplified79.9%
clear-num79.9%
inv-pow79.9%
fma-def79.9%
fma-udef79.9%
*-commutative79.9%
fma-def79.9%
fma-def79.9%
Applied egg-rr79.9%
unpow-179.9%
fma-udef79.9%
fma-udef79.9%
unpow279.9%
+-commutative79.9%
associate-+r+79.9%
+-commutative79.9%
+-commutative79.9%
unpow279.9%
fma-def79.9%
+-commutative79.9%
fma-def79.9%
Simplified79.9%
Taylor expanded in F around -inf 93.3%
if -6.19999999999999966e-38 < F < 2800Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in F around 0 70.7%
associate-*r/70.7%
*-commutative70.7%
associate-*r*70.7%
mul-1-neg70.7%
Simplified70.7%
if 2800 < F Initial program 56.3%
Taylor expanded in B around 0 41.1%
Taylor expanded in F around inf 68.7%
Final simplification77.0%
(FPCore (F B x)
:precision binary64
(if (<= F -4.2e+187)
(- (/ -1.0 B) (* x (/ 1.0 (tan B))))
(if (<= F -9e-38)
(- (/ -1.0 (sin B)) (/ x B))
(if (or (<= F 1.9e-18) (and (not (<= F 1.26e+151)) (<= F 5.8e+177)))
(/ (- x) (tan B))
(+ (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.2e+187) {
tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
} else if (F <= -9e-38) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if ((F <= 1.9e-18) || (!(F <= 1.26e+151) && (F <= 5.8e+177))) {
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 <= (-4.2d+187)) then
tmp = ((-1.0d0) / b) - (x * (1.0d0 / tan(b)))
else if (f <= (-9d-38)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if ((f <= 1.9d-18) .or. (.not. (f <= 1.26d+151)) .and. (f <= 5.8d+177)) 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 <= -4.2e+187) {
tmp = (-1.0 / B) - (x * (1.0 / Math.tan(B)));
} else if (F <= -9e-38) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if ((F <= 1.9e-18) || (!(F <= 1.26e+151) && (F <= 5.8e+177))) {
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 <= -4.2e+187: tmp = (-1.0 / B) - (x * (1.0 / math.tan(B))) elif F <= -9e-38: tmp = (-1.0 / math.sin(B)) - (x / B) elif (F <= 1.9e-18) or (not (F <= 1.26e+151) and (F <= 5.8e+177)): 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 <= -4.2e+187) tmp = Float64(Float64(-1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); elseif (F <= -9e-38) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif ((F <= 1.9e-18) || (!(F <= 1.26e+151) && (F <= 5.8e+177))) 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 <= -4.2e+187) tmp = (-1.0 / B) - (x * (1.0 / tan(B))); elseif (F <= -9e-38) tmp = (-1.0 / sin(B)) - (x / B); elseif ((F <= 1.9e-18) || (~((F <= 1.26e+151)) && (F <= 5.8e+177))) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) + (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.2e+187], N[(N[(-1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9e-38], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.9e-18], And[N[Not[LessEqual[F, 1.26e+151]], $MachinePrecision], LessEqual[F, 5.8e+177]]], 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 -4.2 \cdot 10^{+187}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \leq -9 \cdot 10^{-38}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-18} \lor \neg \left(F \leq 1.26 \cdot 10^{+151}\right) \land F \leq 5.8 \cdot 10^{+177}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} + \frac{x}{B}\\
\end{array}
\end{array}
if F < -4.2e187Initial program 50.6%
Taylor expanded in F around -inf 75.3%
Taylor expanded in B around 0 85.6%
if -4.2e187 < F < -9.00000000000000018e-38Initial program 79.2%
Taylor expanded in F around -inf 82.5%
Taylor expanded in B around 0 69.3%
Taylor expanded in x around 0 77.8%
mul-1-neg77.8%
Simplified77.8%
if -9.00000000000000018e-38 < F < 1.8999999999999999e-18 or 1.26000000000000006e151 < F < 5.80000000000000027e177Initial program 97.8%
+-commutative97.8%
unsub-neg97.8%
associate-*l/97.7%
associate-*r/97.7%
*-commutative97.7%
Simplified97.8%
clear-num97.8%
inv-pow97.8%
fma-def97.8%
fma-udef97.8%
*-commutative97.8%
fma-def97.8%
fma-def97.8%
Applied egg-rr97.8%
unpow-197.8%
fma-udef97.8%
fma-udef97.8%
unpow297.8%
+-commutative97.8%
associate-+r+97.8%
+-commutative97.8%
+-commutative97.8%
unpow297.8%
fma-def97.8%
+-commutative97.8%
fma-def97.8%
Simplified97.8%
un-div-inv97.8%
div-inv97.7%
fma-def97.7%
pow-flip97.8%
metadata-eval97.8%
pow1/297.8%
add-sqr-sqrt94.1%
hypot-def95.9%
Applied egg-rr95.9%
Taylor expanded in F around 0 73.1%
mul-1-neg73.1%
associate-/l*72.9%
associate-/r/73.0%
distribute-rgt-neg-in73.0%
Simplified73.0%
*-commutative73.0%
add-sqr-sqrt14.2%
sqrt-unprod10.1%
sqr-neg10.1%
sqrt-unprod1.0%
add-sqr-sqrt2.2%
clear-num2.2%
tan-quot2.2%
div-inv2.2%
frac-2neg2.2%
neg-sub02.2%
metadata-eval2.2%
div-sub2.2%
metadata-eval2.2%
add-sqr-sqrt1.0%
sqrt-unprod10.2%
sqr-neg10.2%
sqrt-unprod14.2%
add-sqr-sqrt73.0%
frac-2neg73.0%
Applied egg-rr73.0%
div073.0%
neg-sub073.0%
distribute-neg-frac73.0%
Simplified73.0%
if 1.8999999999999999e-18 < F < 1.26000000000000006e151 or 5.80000000000000027e177 < F Initial program 55.4%
Taylor expanded in F around -inf 28.6%
Taylor expanded in B around 0 13.4%
expm1-log1p-u9.0%
expm1-udef9.0%
Applied egg-rr31.9%
expm1-def32.0%
expm1-log1p60.1%
+-commutative60.1%
associate-/r*60.3%
*-inverses60.3%
Simplified60.3%
Final simplification71.7%
(FPCore (F B x)
:precision binary64
(if (or (<= x -1.35e-93)
(not (or (<= x 9.5e-206) (and (not (<= x 1.25e-61)) (<= x 2.2e-14)))))
(/ (- x) (tan B))
(+ (/ 1.0 (sin B)) (/ x B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -1.35e-93) || !((x <= 9.5e-206) || (!(x <= 1.25e-61) && (x <= 2.2e-14)))) {
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 ((x <= (-1.35d-93)) .or. (.not. (x <= 9.5d-206) .or. (.not. (x <= 1.25d-61)) .and. (x <= 2.2d-14))) 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 ((x <= -1.35e-93) || !((x <= 9.5e-206) || (!(x <= 1.25e-61) && (x <= 2.2e-14)))) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) + (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -1.35e-93) or not ((x <= 9.5e-206) or (not (x <= 1.25e-61) and (x <= 2.2e-14))): 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 ((x <= -1.35e-93) || !((x <= 9.5e-206) || (!(x <= 1.25e-61) && (x <= 2.2e-14)))) 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 ((x <= -1.35e-93) || ~(((x <= 9.5e-206) || (~((x <= 1.25e-61)) && (x <= 2.2e-14))))) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) + (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.35e-93], N[Not[Or[LessEqual[x, 9.5e-206], And[N[Not[LessEqual[x, 1.25e-61]], $MachinePrecision], LessEqual[x, 2.2e-14]]]], $MachinePrecision]], 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}\;x \leq -1.35 \cdot 10^{-93} \lor \neg \left(x \leq 9.5 \cdot 10^{-206} \lor \neg \left(x \leq 1.25 \cdot 10^{-61}\right) \land x \leq 2.2 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} + \frac{x}{B}\\
\end{array}
\end{array}
if x < -1.3500000000000001e-93 or 9.49999999999999979e-206 < x < 1.25e-61 or 2.2000000000000001e-14 < x Initial program 87.6%
+-commutative87.6%
unsub-neg87.6%
associate-*l/95.4%
associate-*r/95.4%
*-commutative95.4%
Simplified95.5%
clear-num95.6%
inv-pow95.6%
fma-def95.6%
fma-udef95.6%
*-commutative95.6%
fma-def95.6%
fma-def95.6%
Applied egg-rr95.6%
unpow-195.6%
fma-udef95.6%
fma-udef95.6%
unpow295.6%
+-commutative95.6%
associate-+r+95.6%
+-commutative95.6%
+-commutative95.6%
unpow295.6%
fma-def95.6%
+-commutative95.6%
fma-def95.6%
Simplified95.6%
un-div-inv95.6%
div-inv95.5%
fma-def95.5%
pow-flip95.6%
metadata-eval95.6%
pow1/295.6%
add-sqr-sqrt76.6%
hypot-def80.7%
Applied egg-rr80.7%
Taylor expanded in F around 0 79.4%
mul-1-neg79.4%
associate-/l*79.2%
associate-/r/79.3%
distribute-rgt-neg-in79.3%
Simplified79.3%
*-commutative79.3%
add-sqr-sqrt23.0%
sqrt-unprod17.6%
sqr-neg17.6%
sqrt-unprod0.9%
add-sqr-sqrt1.4%
clear-num1.4%
tan-quot1.4%
div-inv1.4%
frac-2neg1.4%
neg-sub01.4%
metadata-eval1.4%
div-sub1.4%
metadata-eval1.4%
add-sqr-sqrt0.9%
sqrt-unprod17.7%
sqr-neg17.7%
sqrt-unprod23.0%
add-sqr-sqrt79.4%
frac-2neg79.4%
Applied egg-rr79.4%
div079.4%
neg-sub079.4%
distribute-neg-frac79.4%
Simplified79.4%
if -1.3500000000000001e-93 < x < 9.49999999999999979e-206 or 1.25e-61 < x < 2.2000000000000001e-14Initial program 62.9%
Taylor expanded in F around -inf 22.1%
Taylor expanded in B around 0 22.0%
expm1-log1p-u4.7%
expm1-udef4.7%
Applied egg-rr18.7%
expm1-def18.8%
expm1-log1p38.6%
+-commutative38.6%
associate-/r*38.7%
*-inverses38.7%
Simplified38.7%
Final simplification64.6%
(FPCore (F B x)
:precision binary64
(if (<= F -9e-38)
(- (/ -1.0 (sin B)) (/ x B))
(if (or (<= F 1.9e-18) (and (not (<= F 5.8e+153)) (<= F 8.5e+176)))
(/ (- x) (tan B))
(+ (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e-38) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if ((F <= 1.9e-18) || (!(F <= 5.8e+153) && (F <= 8.5e+176))) {
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 <= (-9d-38)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if ((f <= 1.9d-18) .or. (.not. (f <= 5.8d+153)) .and. (f <= 8.5d+176)) 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 <= -9e-38) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if ((F <= 1.9e-18) || (!(F <= 5.8e+153) && (F <= 8.5e+176))) {
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 <= -9e-38: tmp = (-1.0 / math.sin(B)) - (x / B) elif (F <= 1.9e-18) or (not (F <= 5.8e+153) and (F <= 8.5e+176)): 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 <= -9e-38) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif ((F <= 1.9e-18) || (!(F <= 5.8e+153) && (F <= 8.5e+176))) 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 <= -9e-38) tmp = (-1.0 / sin(B)) - (x / B); elseif ((F <= 1.9e-18) || (~((F <= 5.8e+153)) && (F <= 8.5e+176))) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) + (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9e-38], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.9e-18], And[N[Not[LessEqual[F, 5.8e+153]], $MachinePrecision], LessEqual[F, 8.5e+176]]], 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 -9 \cdot 10^{-38}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-18} \lor \neg \left(F \leq 5.8 \cdot 10^{+153}\right) \land F \leq 8.5 \cdot 10^{+176}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} + \frac{x}{B}\\
\end{array}
\end{array}
if F < -9.00000000000000018e-38Initial program 71.8%
Taylor expanded in F around -inf 80.6%
Taylor expanded in B around 0 59.2%
Taylor expanded in x around 0 71.7%
mul-1-neg71.7%
Simplified71.7%
if -9.00000000000000018e-38 < F < 1.8999999999999999e-18 or 5.80000000000000004e153 < F < 8.4999999999999995e176Initial program 97.8%
+-commutative97.8%
unsub-neg97.8%
associate-*l/97.7%
associate-*r/97.7%
*-commutative97.7%
Simplified97.8%
clear-num97.8%
inv-pow97.8%
fma-def97.8%
fma-udef97.8%
*-commutative97.8%
fma-def97.8%
fma-def97.8%
Applied egg-rr97.8%
unpow-197.8%
fma-udef97.8%
fma-udef97.8%
unpow297.8%
+-commutative97.8%
associate-+r+97.8%
+-commutative97.8%
+-commutative97.8%
unpow297.8%
fma-def97.8%
+-commutative97.8%
fma-def97.8%
Simplified97.8%
un-div-inv97.8%
div-inv97.7%
fma-def97.7%
pow-flip97.8%
metadata-eval97.8%
pow1/297.8%
add-sqr-sqrt94.1%
hypot-def95.9%
Applied egg-rr95.9%
Taylor expanded in F around 0 73.1%
mul-1-neg73.1%
associate-/l*72.9%
associate-/r/73.0%
distribute-rgt-neg-in73.0%
Simplified73.0%
*-commutative73.0%
add-sqr-sqrt14.2%
sqrt-unprod10.1%
sqr-neg10.1%
sqrt-unprod1.0%
add-sqr-sqrt2.2%
clear-num2.2%
tan-quot2.2%
div-inv2.2%
frac-2neg2.2%
neg-sub02.2%
metadata-eval2.2%
div-sub2.2%
metadata-eval2.2%
add-sqr-sqrt1.0%
sqrt-unprod10.2%
sqr-neg10.2%
sqrt-unprod14.2%
add-sqr-sqrt73.0%
frac-2neg73.0%
Applied egg-rr73.0%
div073.0%
neg-sub073.0%
distribute-neg-frac73.0%
Simplified73.0%
if 1.8999999999999999e-18 < F < 5.80000000000000004e153 or 8.4999999999999995e176 < F Initial program 55.4%
Taylor expanded in F around -inf 28.6%
Taylor expanded in B around 0 13.4%
expm1-log1p-u9.0%
expm1-udef9.0%
Applied egg-rr31.9%
expm1-def32.0%
expm1-log1p60.1%
+-commutative60.1%
associate-/r*60.3%
*-inverses60.3%
Simplified60.3%
Final simplification69.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ 1.0 (tan B)))))
(if (<= F -1.35e+187)
(- (/ -1.0 B) t_0)
(if (<= F -9e-38)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 2800.0) (/ (- x) (tan B)) (- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
double t_0 = x * (1.0 / tan(B));
double tmp;
if (F <= -1.35e+187) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -9e-38) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 2800.0) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / 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 * (1.0d0 / tan(b))
if (f <= (-1.35d+187)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= (-9d-38)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 2800.0d0) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / b) - t_0
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.35e+187) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -9e-38) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 2800.0) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x * (1.0 / math.tan(B)) tmp = 0 if F <= -1.35e+187: tmp = (-1.0 / B) - t_0 elif F <= -9e-38: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 2800.0: tmp = -x / math.tan(B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x * Float64(1.0 / tan(B))) tmp = 0.0 if (F <= -1.35e+187) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= -9e-38) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 2800.0) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (1.0 / tan(B)); tmp = 0.0; if (F <= -1.35e+187) tmp = (-1.0 / B) - t_0; elseif (F <= -9e-38) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 2800.0) tmp = -x / tan(B); else tmp = (1.0 / B) - t_0; 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.35e+187], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -9e-38], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2800.0], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -1.35 \cdot 10^{+187}:\\
\;\;\;\;\frac{-1}{B} - t_0\\
\mathbf{elif}\;F \leq -9 \cdot 10^{-38}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2800:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\
\end{array}
\end{array}
if F < -1.35000000000000004e187Initial program 50.6%
Taylor expanded in F around -inf 75.3%
Taylor expanded in B around 0 85.6%
if -1.35000000000000004e187 < F < -9.00000000000000018e-38Initial program 79.2%
Taylor expanded in F around -inf 82.5%
Taylor expanded in B around 0 69.3%
Taylor expanded in x around 0 77.8%
mul-1-neg77.8%
Simplified77.8%
if -9.00000000000000018e-38 < F < 2800Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.5%
clear-num99.5%
inv-pow99.5%
fma-def99.5%
fma-udef99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
Applied egg-rr99.5%
unpow-199.5%
fma-udef99.5%
fma-udef99.5%
unpow299.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
+-commutative99.5%
unpow299.5%
fma-def99.5%
+-commutative99.5%
fma-def99.5%
Simplified99.5%
un-div-inv99.6%
div-inv99.5%
fma-def99.5%
pow-flip99.5%
metadata-eval99.5%
pow1/299.5%
add-sqr-sqrt99.5%
hypot-def99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 70.7%
mul-1-neg70.7%
associate-/l*70.5%
associate-/r/70.7%
distribute-rgt-neg-in70.7%
Simplified70.7%
*-commutative70.7%
add-sqr-sqrt11.3%
sqrt-unprod9.6%
sqr-neg9.6%
sqrt-unprod1.1%
add-sqr-sqrt2.3%
clear-num2.3%
tan-quot2.3%
div-inv2.3%
frac-2neg2.3%
neg-sub02.3%
metadata-eval2.3%
div-sub2.3%
metadata-eval2.3%
add-sqr-sqrt1.1%
sqrt-unprod9.7%
sqr-neg9.7%
sqrt-unprod11.3%
add-sqr-sqrt70.7%
frac-2neg70.7%
Applied egg-rr70.7%
div070.7%
neg-sub070.7%
distribute-neg-frac70.7%
Simplified70.7%
if 2800 < F Initial program 56.3%
Taylor expanded in B around 0 41.1%
Taylor expanded in F around inf 68.7%
Final simplification72.9%
(FPCore (F B x) :precision binary64 (if (or (<= B -5.4e-69) (not (<= B 1.02e-122))) (/ (- x) (tan B)) (/ (- -1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if ((B <= -5.4e-69) || !(B <= 1.02e-122)) {
tmp = -x / tan(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 ((b <= (-5.4d-69)) .or. (.not. (b <= 1.02d-122))) then
tmp = -x / tan(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 ((B <= -5.4e-69) || !(B <= 1.02e-122)) {
tmp = -x / Math.tan(B);
} else {
tmp = (-1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (B <= -5.4e-69) or not (B <= 1.02e-122): tmp = -x / math.tan(B) else: tmp = (-1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if ((B <= -5.4e-69) || !(B <= 1.02e-122)) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(-1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((B <= -5.4e-69) || ~((B <= 1.02e-122))) tmp = -x / tan(B); else tmp = (-1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[B, -5.4e-69], N[Not[LessEqual[B, 1.02e-122]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -5.4 \cdot 10^{-69} \lor \neg \left(B \leq 1.02 \cdot 10^{-122}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\end{array}
\end{array}
if B < -5.3999999999999995e-69 or 1.02000000000000002e-122 < B Initial program 83.5%
+-commutative83.5%
unsub-neg83.5%
associate-*l/84.1%
associate-*r/84.1%
*-commutative84.1%
Simplified84.2%
clear-num84.1%
inv-pow84.1%
fma-def84.1%
fma-udef84.1%
*-commutative84.1%
fma-def84.1%
fma-def84.1%
Applied egg-rr84.1%
unpow-184.1%
fma-udef84.1%
fma-udef84.1%
unpow284.1%
+-commutative84.1%
associate-+r+84.1%
+-commutative84.1%
+-commutative84.1%
unpow284.1%
fma-def84.1%
+-commutative84.1%
fma-def84.1%
Simplified84.1%
un-div-inv84.2%
div-inv84.2%
fma-def84.2%
pow-flip84.2%
metadata-eval84.2%
pow1/284.2%
add-sqr-sqrt71.7%
hypot-def87.1%
Applied egg-rr87.1%
Taylor expanded in F around 0 55.4%
mul-1-neg55.4%
associate-/l*55.3%
associate-/r/55.4%
distribute-rgt-neg-in55.4%
Simplified55.4%
*-commutative55.4%
add-sqr-sqrt18.4%
sqrt-unprod12.8%
sqr-neg12.8%
sqrt-unprod1.2%
add-sqr-sqrt2.6%
clear-num2.6%
tan-quot2.6%
div-inv2.6%
frac-2neg2.6%
neg-sub02.6%
metadata-eval2.6%
div-sub2.6%
metadata-eval2.6%
add-sqr-sqrt1.2%
sqrt-unprod12.8%
sqr-neg12.8%
sqrt-unprod18.4%
add-sqr-sqrt55.4%
frac-2neg55.4%
Applied egg-rr55.4%
div055.4%
neg-sub055.4%
distribute-neg-frac55.4%
Simplified55.4%
if -5.3999999999999995e-69 < B < 1.02000000000000002e-122Initial program 67.9%
+-commutative67.9%
fma-def67.9%
+-commutative67.9%
*-commutative67.9%
fma-def67.9%
fma-def67.9%
metadata-eval67.9%
metadata-eval67.9%
distribute-lft-neg-in67.9%
associate-*r/67.9%
*-rgt-identity67.9%
Simplified67.9%
Taylor expanded in B around 0 87.7%
fma-def87.7%
unpow287.7%
+-commutative87.7%
fma-def87.7%
mul-1-neg87.7%
Simplified87.7%
Taylor expanded in F around -inf 66.1%
distribute-lft-in66.1%
metadata-eval66.1%
mul-1-neg66.1%
unsub-neg66.1%
Simplified66.1%
Final simplification58.8%
(FPCore (F B x) :precision binary64 (if (<= F -9.5e-91) (- (* B -0.16666666666666666) (/ (+ x 1.0) B)) (if (<= F 8.2e-30) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.5e-91) {
tmp = (B * -0.16666666666666666) - ((x + 1.0) / B);
} else if (F <= 8.2e-30) {
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 <= (-9.5d-91)) then
tmp = (b * (-0.16666666666666666d0)) - ((x + 1.0d0) / b)
else if (f <= 8.2d-30) 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 <= -9.5e-91) {
tmp = (B * -0.16666666666666666) - ((x + 1.0) / B);
} else if (F <= 8.2e-30) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9.5e-91: tmp = (B * -0.16666666666666666) - ((x + 1.0) / B) elif F <= 8.2e-30: tmp = -(x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -9.5e-91) tmp = Float64(Float64(B * -0.16666666666666666) - Float64(Float64(x + 1.0) / B)); elseif (F <= 8.2e-30) 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 <= -9.5e-91) tmp = (B * -0.16666666666666666) - ((x + 1.0) / B); elseif (F <= 8.2e-30) tmp = -(x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9.5e-91], N[(N[(B * -0.16666666666666666), $MachinePrecision] - N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.2e-30], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5 \cdot 10^{-91}:\\
\;\;\;\;B \cdot -0.16666666666666666 - \frac{x + 1}{B}\\
\mathbf{elif}\;F \leq 8.2 \cdot 10^{-30}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -9.5e-91Initial program 75.3%
Taylor expanded in F around -inf 78.8%
Taylor expanded in B around 0 55.7%
Taylor expanded in B around 0 45.9%
+-commutative45.9%
*-commutative45.9%
mul-1-neg45.9%
unsub-neg45.9%
Simplified45.9%
if -9.5e-91 < F < 8.2000000000000007e-30Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in B around 0 48.1%
fma-def48.1%
unpow248.1%
+-commutative48.1%
fma-def48.1%
mul-1-neg48.1%
Simplified48.1%
Taylor expanded in F around 0 35.8%
mul-1-neg35.8%
Simplified35.8%
if 8.2000000000000007e-30 < F Initial program 58.0%
+-commutative58.0%
fma-def58.0%
+-commutative58.0%
*-commutative58.0%
fma-def58.0%
fma-def58.0%
metadata-eval58.0%
metadata-eval58.0%
distribute-lft-neg-in58.0%
associate-*r/58.1%
*-rgt-identity58.1%
Simplified58.1%
Taylor expanded in B around 0 31.0%
fma-def31.0%
unpow231.0%
+-commutative31.0%
fma-def31.0%
mul-1-neg31.0%
Simplified31.0%
Taylor expanded in F around inf 45.0%
Final simplification42.1%
(FPCore (F B x) :precision binary64 (if (<= F -1.75e-109) (/ (- -1.0 x) B) (if (<= F 4.2e-33) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.75e-109) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.2e-33) {
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.75d-109)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 4.2d-33) 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.75e-109) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.2e-33) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.75e-109: tmp = (-1.0 - x) / B elif F <= 4.2e-33: tmp = -(x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.75e-109) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4.2e-33) 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.75e-109) tmp = (-1.0 - x) / B; elseif (F <= 4.2e-33) tmp = -(x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.75e-109], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.2e-33], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.75 \cdot 10^{-109}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-33}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.75e-109Initial program 76.1%
+-commutative76.1%
fma-def76.1%
+-commutative76.1%
*-commutative76.1%
fma-def76.1%
fma-def76.1%
metadata-eval76.1%
metadata-eval76.1%
distribute-lft-neg-in76.1%
associate-*r/76.2%
*-rgt-identity76.2%
Simplified76.2%
Taylor expanded in B around 0 42.3%
fma-def42.3%
unpow242.3%
+-commutative42.3%
fma-def42.3%
mul-1-neg42.3%
Simplified42.3%
Taylor expanded in F around -inf 44.5%
distribute-lft-in44.5%
metadata-eval44.5%
mul-1-neg44.5%
unsub-neg44.5%
Simplified44.5%
if -1.75e-109 < F < 4.2e-33Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in B around 0 48.6%
fma-def48.6%
unpow248.6%
+-commutative48.6%
fma-def48.6%
mul-1-neg48.6%
Simplified48.6%
Taylor expanded in F around 0 36.8%
mul-1-neg36.8%
Simplified36.8%
if 4.2e-33 < F Initial program 58.0%
+-commutative58.0%
fma-def58.0%
+-commutative58.0%
*-commutative58.0%
fma-def58.0%
fma-def58.0%
metadata-eval58.0%
metadata-eval58.0%
distribute-lft-neg-in58.0%
associate-*r/58.1%
*-rgt-identity58.1%
Simplified58.1%
Taylor expanded in B around 0 31.0%
fma-def31.0%
unpow231.0%
+-commutative31.0%
fma-def31.0%
mul-1-neg31.0%
Simplified31.0%
Taylor expanded in F around inf 45.0%
Final simplification42.0%
(FPCore (F B x) :precision binary64 (if (<= F -1.75e-109) (/ (- -1.0 x) B) (- (/ x B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.75e-109) {
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 <= (-1.75d-109)) 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 <= -1.75e-109) {
tmp = (-1.0 - x) / B;
} else {
tmp = -(x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.75e-109: tmp = (-1.0 - x) / B else: tmp = -(x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.75e-109) 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 <= -1.75e-109) tmp = (-1.0 - x) / B; else tmp = -(x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.75e-109], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], (-N[(x / B), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.75 \cdot 10^{-109}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x}{B}\\
\end{array}
\end{array}
if F < -1.75e-109Initial program 76.1%
+-commutative76.1%
fma-def76.1%
+-commutative76.1%
*-commutative76.1%
fma-def76.1%
fma-def76.1%
metadata-eval76.1%
metadata-eval76.1%
distribute-lft-neg-in76.1%
associate-*r/76.2%
*-rgt-identity76.2%
Simplified76.2%
Taylor expanded in B around 0 42.3%
fma-def42.3%
unpow242.3%
+-commutative42.3%
fma-def42.3%
mul-1-neg42.3%
Simplified42.3%
Taylor expanded in F around -inf 44.5%
distribute-lft-in44.5%
metadata-eval44.5%
mul-1-neg44.5%
unsub-neg44.5%
Simplified44.5%
if -1.75e-109 < F Initial program 80.0%
+-commutative80.0%
fma-def80.0%
+-commutative80.0%
*-commutative80.0%
fma-def80.0%
fma-def80.0%
metadata-eval80.0%
metadata-eval80.0%
distribute-lft-neg-in80.0%
associate-*r/80.1%
*-rgt-identity80.1%
Simplified80.1%
Taylor expanded in B around 0 40.3%
fma-def40.3%
unpow240.3%
+-commutative40.3%
fma-def40.3%
mul-1-neg40.3%
Simplified40.3%
Taylor expanded in F around 0 29.8%
mul-1-neg29.8%
Simplified29.8%
Final simplification35.0%
(FPCore (F B x) :precision binary64 (- (/ x B)))
double code(double F, double B, double x) {
return -(x / B);
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x / b)
end function
public static double code(double F, double B, double x) {
return -(x / B);
}
def code(F, B, x): return -(x / B)
function code(F, B, x) return Float64(-Float64(x / B)) end
function tmp = code(F, B, x) tmp = -(x / B); end
code[F_, B_, x_] := (-N[(x / B), $MachinePrecision])
\begin{array}{l}
\\
-\frac{x}{B}
\end{array}
Initial program 78.6%
+-commutative78.6%
fma-def78.6%
+-commutative78.6%
*-commutative78.6%
fma-def78.6%
fma-def78.6%
metadata-eval78.6%
metadata-eval78.6%
distribute-lft-neg-in78.6%
associate-*r/78.7%
*-rgt-identity78.7%
Simplified78.7%
Taylor expanded in B around 0 41.0%
fma-def41.0%
unpow241.0%
+-commutative41.0%
fma-def41.0%
mul-1-neg41.0%
Simplified41.0%
Taylor expanded in F around 0 27.0%
mul-1-neg27.0%
Simplified27.0%
Final simplification27.0%
(FPCore (F B x) :precision binary64 (* B -0.16666666666666666))
double code(double F, double B, double x) {
return B * -0.16666666666666666;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = b * (-0.16666666666666666d0)
end function
public static double code(double F, double B, double x) {
return B * -0.16666666666666666;
}
def code(F, B, x): return B * -0.16666666666666666
function code(F, B, x) return Float64(B * -0.16666666666666666) end
function tmp = code(F, B, x) tmp = B * -0.16666666666666666; end
code[F_, B_, x_] := N[(B * -0.16666666666666666), $MachinePrecision]
\begin{array}{l}
\\
B \cdot -0.16666666666666666
\end{array}
Initial program 78.6%
Taylor expanded in F around -inf 51.7%
Taylor expanded in B around 0 38.5%
Taylor expanded in B around inf 3.3%
*-commutative3.3%
Simplified3.3%
Final simplification3.3%
herbie shell --seed 2023213
(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))))))