
(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 (tan B))))
(if (<= F -4e+115)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3e+77)
(- (/ F (* (sin B) (sqrt (fma F F (fma 2.0 x 2.0))))) t_0)
(fma (/ (/ 1.0 (sin B)) F) F (/ x (- 0.0 (tan B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -4e+115) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3e+77) {
tmp = (F / (sin(B) * sqrt(fma(F, F, fma(2.0, x, 2.0))))) - t_0;
} else {
tmp = fma(((1.0 / sin(B)) / F), F, (x / (0.0 - tan(B))));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -4e+115) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3e+77) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, fma(2.0, x, 2.0))))) - t_0); else tmp = fma(Float64(Float64(1.0 / sin(B)) / F), F, Float64(x / Float64(0.0 - tan(B)))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+115], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3e+77], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] * F + N[(x / N[(0.0 - N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4 \cdot 10^{+115}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 3 \cdot 10^{+77}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{1}{\sin B}}{F}, F, \frac{x}{0 - \tan B}\right)\\
\end{array}
\end{array}
if F < -4.0000000000000001e115Initial program 38.6%
Taylor expanded in F around -inf
/-lowering-/.f64N/A
sin-lowering-sin.f6499.7
Simplified99.7%
+-commutativeN/A
div-invN/A
unsub-negN/A
+-lft-identityN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-lft-identityN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.7
Applied egg-rr99.7%
if -4.0000000000000001e115 < F < 2.9999999999999998e77Initial program 95.5%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr99.6%
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
associate-*l/N/A
associate-+r-N/A
+-lft-identityN/A
+-rgt-identityN/A
--lowering--.f64N/A
Applied egg-rr99.6%
if 2.9999999999999998e77 < F Initial program 45.2%
+-commutativeN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr57.1%
Taylor expanded in F around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.5
Simplified99.5%
*-commutativeN/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
/-lowering-/.f64N/A
sin-lowering-sin.f6499.8
Applied egg-rr99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.45)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (/ F (* (sin B) (sqrt (fma x 2.0 2.0)))) t_0)
(fma (/ (/ 1.0 (sin B)) F) F (/ x (- 0.0 (tan B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.45) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F / (sin(B) * sqrt(fma(x, 2.0, 2.0)))) - t_0;
} else {
tmp = fma(((1.0 / sin(B)) / F), F, (x / (0.0 - tan(B))));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.45) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(x, 2.0, 2.0)))) - t_0); else tmp = fma(Float64(Float64(1.0 / sin(B)) / F), F, Float64(x / Float64(0.0 - tan(B)))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(x * 2.0 + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] * F + N[(x / N[(0.0 - N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.45:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, 2\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{1}{\sin B}}{F}, F, \frac{x}{0 - \tan B}\right)\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 51.0%
Taylor expanded in F around -inf
/-lowering-/.f64N/A
sin-lowering-sin.f6498.4
Simplified98.4%
+-commutativeN/A
div-invN/A
unsub-negN/A
+-lft-identityN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-lft-identityN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6498.5
Applied egg-rr98.5%
if -1.44999999999999996 < F < 1.3999999999999999Initial program 99.4%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr99.6%
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
associate-*l/N/A
associate-+r-N/A
+-lft-identityN/A
+-rgt-identityN/A
--lowering--.f64N/A
Applied egg-rr99.7%
Taylor expanded in F around 0
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6499.5
Simplified99.5%
if 1.3999999999999999 < F Initial program 57.9%
+-commutativeN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr68.9%
Taylor expanded in F around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6498.5
Simplified98.5%
*-commutativeN/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
/-lowering-/.f64N/A
sin-lowering-sin.f6498.8
Applied egg-rr98.8%
Final simplification99.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1400.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 60000.0)
(- (/ F (* B (sqrt (fma F F 2.0)))) t_0)
(fma (/ (/ 1.0 (sin B)) F) F (/ x (- 0.0 (tan B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1400.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 60000.0) {
tmp = (F / (B * sqrt(fma(F, F, 2.0)))) - t_0;
} else {
tmp = fma(((1.0 / sin(B)) / F), F, (x / (0.0 - tan(B))));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1400.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 60000.0) tmp = Float64(Float64(F / Float64(B * sqrt(fma(F, F, 2.0)))) - t_0); else tmp = fma(Float64(Float64(1.0 / sin(B)) / F), F, Float64(x / Float64(0.0 - tan(B)))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1400.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 60000.0], N[(N[(F / N[(B * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] * F + N[(x / N[(0.0 - N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1400:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 60000:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{1}{\sin B}}{F}, F, \frac{x}{0 - \tan B}\right)\\
\end{array}
\end{array}
if F < -1400Initial program 50.5%
Taylor expanded in F around -inf
/-lowering-/.f64N/A
sin-lowering-sin.f6499.0
Simplified99.0%
+-commutativeN/A
div-invN/A
unsub-negN/A
+-lft-identityN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-lft-identityN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.1
Applied egg-rr99.1%
if -1400 < F < 6e4Initial program 99.4%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr99.6%
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
associate-*l/N/A
associate-+r-N/A
+-lft-identityN/A
+-rgt-identityN/A
--lowering--.f64N/A
Applied egg-rr99.7%
Taylor expanded in B around 0
Simplified82.5%
Taylor expanded in x around 0
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f6482.5
Simplified82.5%
if 6e4 < F Initial program 56.7%
+-commutativeN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr68.1%
Taylor expanded in F around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.5
Simplified99.5%
*-commutativeN/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
/-lowering-/.f64N/A
sin-lowering-sin.f6499.7
Applied egg-rr99.7%
Final simplification92.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1520.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 62000.0)
(- (/ F (* B (sqrt (fma F F 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 <= -1520.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 62000.0) {
tmp = (F / (B * sqrt(fma(F, F, 2.0)))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1520.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 62000.0) tmp = Float64(Float64(F / Float64(B * sqrt(fma(F, F, 2.0)))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1520.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 62000.0], N[(N[(F / N[(B * N[Sqrt[N[(F * F + 2.0), $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 -1520:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 62000:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1520Initial program 50.5%
Taylor expanded in F around -inf
/-lowering-/.f64N/A
sin-lowering-sin.f6499.0
Simplified99.0%
+-commutativeN/A
div-invN/A
unsub-negN/A
+-lft-identityN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-lft-identityN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.1
Applied egg-rr99.1%
if -1520 < F < 62000Initial program 99.4%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr99.6%
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
associate-*l/N/A
associate-+r-N/A
+-lft-identityN/A
+-rgt-identityN/A
--lowering--.f64N/A
Applied egg-rr99.7%
Taylor expanded in B around 0
Simplified82.5%
Taylor expanded in x around 0
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f6482.5
Simplified82.5%
if 62000 < F Initial program 56.7%
+-commutativeN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr68.1%
Taylor expanded in F around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.5
Simplified99.5%
associate-+r-N/A
+-rgt-identityN/A
+-lft-identityN/A
--lowering--.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-lft-identityN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.7
Applied egg-rr99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1520.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7e+162)
(- (/ F (* B (sqrt (fma F F 2.0)))) t_0)
(fma (/ 1.0 (* F (sin B))) F (/ (- 0.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1520.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7e+162) {
tmp = (F / (B * sqrt(fma(F, F, 2.0)))) - t_0;
} else {
tmp = fma((1.0 / (F * sin(B))), F, ((0.0 - x) / B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1520.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7e+162) tmp = Float64(Float64(F / Float64(B * sqrt(fma(F, F, 2.0)))) - t_0); else tmp = fma(Float64(1.0 / Float64(F * sin(B))), F, Float64(Float64(0.0 - x) / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1520.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7e+162], N[(N[(F / N[(B * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + N[(N[(0.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1520:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 7 \cdot 10^{+162}:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{F \cdot \sin B}, F, \frac{0 - x}{B}\right)\\
\end{array}
\end{array}
if F < -1520Initial program 50.5%
Taylor expanded in F around -inf
/-lowering-/.f64N/A
sin-lowering-sin.f6499.0
Simplified99.0%
+-commutativeN/A
div-invN/A
unsub-negN/A
+-lft-identityN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-lft-identityN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.1
Applied egg-rr99.1%
if -1520 < F < 7.00000000000000036e162Initial program 96.7%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr99.6%
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
associate-*l/N/A
associate-+r-N/A
+-lft-identityN/A
+-rgt-identityN/A
--lowering--.f64N/A
Applied egg-rr99.6%
Taylor expanded in B around 0
Simplified79.4%
Taylor expanded in x around 0
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f6479.4
Simplified79.4%
if 7.00000000000000036e162 < F Initial program 11.3%
+-commutativeN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr25.5%
Taylor expanded in F around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.5
Simplified99.5%
Taylor expanded in B around 0
/-lowering-/.f6491.4
Simplified91.4%
Final simplification87.2%
(FPCore (F B x)
:precision binary64
(if (<= F -5.2e-96)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F 3.1e-144)
(/ (- (/ F (sqrt (fma F F (fma 2.0 x 2.0)))) x) B)
(if (<= F 1.32e+22)
(* F (/ (sqrt (/ 1.0 (fma F F 2.0))) (sin B)))
(if (<= F 1.6e+173)
(fma (/ 1.0 (* F B)) F (/ x (- 0.0 (tan B))))
(fma (/ 1.0 (* F (sin B))) F (/ (- 0.0 x) B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.2e-96) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 3.1e-144) {
tmp = ((F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B;
} else if (F <= 1.32e+22) {
tmp = F * (sqrt((1.0 / fma(F, F, 2.0))) / sin(B));
} else if (F <= 1.6e+173) {
tmp = fma((1.0 / (F * B)), F, (x / (0.0 - tan(B))));
} else {
tmp = fma((1.0 / (F * sin(B))), F, ((0.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.2e-96) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 3.1e-144) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B); elseif (F <= 1.32e+22) tmp = Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / sin(B))); elseif (F <= 1.6e+173) tmp = fma(Float64(1.0 / Float64(F * B)), F, Float64(x / Float64(0.0 - tan(B)))); else tmp = fma(Float64(1.0 / Float64(F * sin(B))), F, Float64(Float64(0.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.2e-96], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.1e-144], N[(N[(N[(F / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.32e+22], N[(F * N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.6e+173], N[(N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision] * F + N[(x / N[(0.0 - N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + N[(N[(0.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.2 \cdot 10^{-96}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 3.1 \cdot 10^{-144}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - x}{B}\\
\mathbf{elif}\;F \leq 1.32 \cdot 10^{+22}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\\
\mathbf{elif}\;F \leq 1.6 \cdot 10^{+173}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{F \cdot B}, F, \frac{x}{0 - \tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{F \cdot \sin B}, F, \frac{0 - x}{B}\right)\\
\end{array}
\end{array}
if F < -5.2000000000000003e-96Initial program 57.1%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr70.9%
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
associate-*l/N/A
associate-+r-N/A
+-lft-identityN/A
+-rgt-identityN/A
--lowering--.f64N/A
Applied egg-rr70.9%
Taylor expanded in B around 0
Simplified62.8%
Taylor expanded in F around -inf
/-lowering-/.f6474.9
Simplified74.9%
if -5.2000000000000003e-96 < F < 3.1000000000000001e-144Initial program 99.5%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6454.8
Simplified54.8%
/-lowering-/.f64N/A
Applied egg-rr54.9%
if 3.1000000000000001e-144 < F < 1.32e22Initial program 99.2%
Taylor expanded in x around 0
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
sin-lowering-sin.f6468.3
Simplified68.3%
if 1.32e22 < F < 1.6000000000000001e173Initial program 83.6%
+-commutativeN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr92.9%
Taylor expanded in F around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.4
Simplified99.4%
Taylor expanded in B around 0
Simplified74.9%
if 1.6000000000000001e173 < F Initial program 9.0%
+-commutativeN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr25.1%
Taylor expanded in F around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.5
Simplified99.5%
Taylor expanded in B around 0
/-lowering-/.f6493.7
Simplified93.7%
Final simplification71.3%
(FPCore (F B x)
:precision binary64
(if (<= F -8.2e+153)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 7e+162)
(- (/ F (* B (sqrt (fma F F 2.0)))) (/ x (tan B)))
(fma (/ 1.0 (* F (sin B))) F (/ (- 0.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.2e+153) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 7e+162) {
tmp = (F / (B * sqrt(fma(F, F, 2.0)))) - (x / tan(B));
} else {
tmp = fma((1.0 / (F * sin(B))), F, ((0.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -8.2e+153) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 7e+162) tmp = Float64(Float64(F / Float64(B * sqrt(fma(F, F, 2.0)))) - Float64(x / tan(B))); else tmp = fma(Float64(1.0 / Float64(F * sin(B))), F, Float64(Float64(0.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -8.2e+153], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e+162], N[(N[(F / N[(B * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + N[(N[(0.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.2 \cdot 10^{+153}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{+162}:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{F \cdot \sin B}, F, \frac{0 - x}{B}\right)\\
\end{array}
\end{array}
if F < -8.20000000000000033e153Initial program 29.8%
Taylor expanded in F around -inf
/-lowering-/.f64N/A
sin-lowering-sin.f6499.7
Simplified99.7%
Taylor expanded in B around 0
/-lowering-/.f6479.5
Simplified79.5%
if -8.20000000000000033e153 < F < 7.00000000000000036e162Initial program 94.5%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr99.6%
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
associate-*l/N/A
associate-+r-N/A
+-lft-identityN/A
+-rgt-identityN/A
--lowering--.f64N/A
Applied egg-rr99.6%
Taylor expanded in B around 0
Simplified79.7%
Taylor expanded in x around 0
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f6479.7
Simplified79.7%
if 7.00000000000000036e162 < F Initial program 11.3%
+-commutativeN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr25.5%
Taylor expanded in F around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.5
Simplified99.5%
Taylor expanded in B around 0
/-lowering-/.f6491.4
Simplified91.4%
Final simplification81.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1.4e-109)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F 1e-117)
(/ (- (/ F (sqrt (fma F F (fma 2.0 x 2.0)))) x) B)
(if (<= F 7e+172)
(fma (/ 1.0 (* F B)) F (/ x (- 0.0 (tan B))))
(fma (/ 1.0 (* F (sin B))) F (/ (- 0.0 x) B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4e-109) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 1e-117) {
tmp = ((F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B;
} else if (F <= 7e+172) {
tmp = fma((1.0 / (F * B)), F, (x / (0.0 - tan(B))));
} else {
tmp = fma((1.0 / (F * sin(B))), F, ((0.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.4e-109) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 1e-117) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B); elseif (F <= 7e+172) tmp = fma(Float64(1.0 / Float64(F * B)), F, Float64(x / Float64(0.0 - tan(B)))); else tmp = fma(Float64(1.0 / Float64(F * sin(B))), F, Float64(Float64(0.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.4e-109], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e-117], N[(N[(N[(F / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7e+172], N[(N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision] * F + N[(x / N[(0.0 - N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + N[(N[(0.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4 \cdot 10^{-109}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 10^{-117}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - x}{B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{+172}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{F \cdot B}, F, \frac{x}{0 - \tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{F \cdot \sin B}, F, \frac{0 - x}{B}\right)\\
\end{array}
\end{array}
if F < -1.39999999999999989e-109Initial program 57.1%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr70.9%
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
associate-*l/N/A
associate-+r-N/A
+-lft-identityN/A
+-rgt-identityN/A
--lowering--.f64N/A
Applied egg-rr70.9%
Taylor expanded in B around 0
Simplified62.8%
Taylor expanded in F around -inf
/-lowering-/.f6474.9
Simplified74.9%
if -1.39999999999999989e-109 < F < 1.00000000000000003e-117Initial program 99.5%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6456.1
Simplified56.1%
/-lowering-/.f64N/A
Applied egg-rr56.2%
if 1.00000000000000003e-117 < F < 6.99999999999999955e172Initial program 89.4%
+-commutativeN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr95.3%
Taylor expanded in F around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6478.1
Simplified78.1%
Taylor expanded in B around 0
Simplified62.0%
if 6.99999999999999955e172 < F Initial program 9.0%
+-commutativeN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr25.1%
Taylor expanded in F around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.5
Simplified99.5%
Taylor expanded in B around 0
/-lowering-/.f6493.7
Simplified93.7%
Final simplification68.6%
(FPCore (F B x)
:precision binary64
(if (<= F -6.8e-98)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F 4.9e-118)
(/ (- (/ F (sqrt (fma F F (fma 2.0 x 2.0)))) x) B)
(fma (/ 1.0 (* F B)) F (/ x (- 0.0 (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.8e-98) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 4.9e-118) {
tmp = ((F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B;
} else {
tmp = fma((1.0 / (F * B)), F, (x / (0.0 - tan(B))));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6.8e-98) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 4.9e-118) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B); else tmp = fma(Float64(1.0 / Float64(F * B)), F, Float64(x / Float64(0.0 - tan(B)))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6.8e-98], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.9e-118], N[(N[(N[(F / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision] * F + N[(x / N[(0.0 - N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.8 \cdot 10^{-98}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 4.9 \cdot 10^{-118}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{F \cdot B}, F, \frac{x}{0 - \tan B}\right)\\
\end{array}
\end{array}
if F < -6.8000000000000003e-98Initial program 57.1%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr70.9%
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
associate-*l/N/A
associate-+r-N/A
+-lft-identityN/A
+-rgt-identityN/A
--lowering--.f64N/A
Applied egg-rr70.9%
Taylor expanded in B around 0
Simplified62.8%
Taylor expanded in F around -inf
/-lowering-/.f6474.9
Simplified74.9%
if -6.8000000000000003e-98 < F < 4.8999999999999998e-118Initial program 99.5%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6456.1
Simplified56.1%
/-lowering-/.f64N/A
Applied egg-rr56.2%
if 4.8999999999999998e-118 < F Initial program 66.5%
+-commutativeN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr75.3%
Taylor expanded in F around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6484.2
Simplified84.2%
Taylor expanded in B around 0
Simplified62.7%
Final simplification65.5%
(FPCore (F B x)
:precision binary64
(if (<= B 0.052)
(/
(-
(fma
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
(fma 0.16666666666666666 (* F (* B B)) F)
(* (* x (* B B)) 0.3333333333333333))
x)
B)
(- (/ -1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.052) {
tmp = (fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma(0.16666666666666666, (F * (B * B)), F), ((x * (B * B)) * 0.3333333333333333)) - x) / B;
} else {
tmp = (-1.0 / B) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.052) tmp = Float64(Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma(0.16666666666666666, Float64(F * Float64(B * B)), F), Float64(Float64(x * Float64(B * B)) * 0.3333333333333333)) - x) / B); else tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.052], N[(N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.16666666666666666 * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision] + F), $MachinePrecision] + N[(N[(x * N[(B * B), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.052:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666, F \cdot \left(B \cdot B\right), F\right), \left(x \cdot \left(B \cdot B\right)\right) \cdot 0.3333333333333333\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 0.0519999999999999976Initial program 67.6%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr79.1%
Taylor expanded in B around 0
/-lowering-/.f64N/A
Simplified53.0%
if 0.0519999999999999976 < B Initial program 82.4%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr82.4%
associate-*l/N/A
*-lft-identityN/A
*-commutativeN/A
associate-*l/N/A
associate-+r-N/A
+-lft-identityN/A
+-rgt-identityN/A
--lowering--.f64N/A
Applied egg-rr82.4%
Taylor expanded in B around 0
Simplified53.1%
Taylor expanded in F around -inf
/-lowering-/.f6448.0
Simplified48.0%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+154)
(/ (- -1.0 x) B)
(if (<= F 62000.0)
(/ (- (/ F (sqrt (fma F F (fma 2.0 x 2.0)))) x) B)
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+154) {
tmp = (-1.0 - x) / B;
} else if (F <= 62000.0) {
tmp = ((F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2e+154) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 62000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2e+154], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 62000.0], N[(N[(N[(F / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+154}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 62000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2.00000000000000007e154Initial program 29.8%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6427.8
Simplified27.8%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6456.7
Simplified56.7%
if -2.00000000000000007e154 < F < 62000Initial program 95.9%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6451.7
Simplified51.7%
/-lowering-/.f64N/A
Applied egg-rr51.8%
if 62000 < F Initial program 56.7%
+-commutativeN/A
*-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr68.1%
Taylor expanded in F around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.5
Simplified99.5%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6459.9
Simplified59.9%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+154)
(/ (- -1.0 x) B)
(if (<= F 4.5e-42)
(/ (- (/ F (sqrt (fma F F (fma 2.0 x 2.0)))) x) B)
(fma -0.5 (/ 2.0 (* F (* F B))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+154) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.5e-42) {
tmp = ((F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B;
} else {
tmp = fma(-0.5, (2.0 / (F * (F * B))), ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2e+154) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4.5e-42) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B); else tmp = fma(-0.5, Float64(2.0 / Float64(F * Float64(F * B))), Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2e+154], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.5e-42], N[(N[(N[(F / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(-0.5 * N[(2.0 / N[(F * N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+154}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-42}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \frac{2}{F \cdot \left(F \cdot B\right)}, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -2.00000000000000007e154Initial program 29.8%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6427.8
Simplified27.8%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6456.7
Simplified56.7%
if -2.00000000000000007e154 < F < 4.5e-42Initial program 95.7%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6452.5
Simplified52.5%
/-lowering-/.f64N/A
Applied egg-rr52.6%
if 4.5e-42 < F Initial program 60.9%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6428.4
Simplified28.4%
Taylor expanded in F around inf
associate--l+N/A
div-subN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6443.2
Simplified43.2%
Taylor expanded in x around 0
Simplified44.3%
(FPCore (F B x)
:precision binary64
(if (<= F -0.22)
(/ (fma 0.5 (/ (fma 2.0 x 2.0) (* F F)) (- -1.0 x)) B)
(if (<= F 4.5e-42)
(/ (- 0.0 x) B)
(fma -0.5 (/ 2.0 (* F (* F B))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.22) {
tmp = fma(0.5, (fma(2.0, x, 2.0) / (F * F)), (-1.0 - x)) / B;
} else if (F <= 4.5e-42) {
tmp = (0.0 - x) / B;
} else {
tmp = fma(-0.5, (2.0 / (F * (F * B))), ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.22) tmp = Float64(fma(0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), Float64(-1.0 - x)) / B); elseif (F <= 4.5e-42) tmp = Float64(Float64(0.0 - x) / B); else tmp = fma(-0.5, Float64(2.0 / Float64(F * Float64(F * B))), Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.22], N[(N[(0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.5e-42], N[(N[(0.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(-0.5 * N[(2.0 / N[(F * N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.22:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-42}:\\
\;\;\;\;\frac{0 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \frac{2}{F \cdot \left(F \cdot B\right)}, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -0.220000000000000001Initial program 51.6%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6437.8
Simplified37.8%
Taylor expanded in F around -inf
sub-negN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6455.1
Simplified55.1%
if -0.220000000000000001 < F < 4.5e-42Initial program 99.4%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6452.3
Simplified52.3%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f6433.2
Simplified33.2%
if 4.5e-42 < F Initial program 60.9%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6428.4
Simplified28.4%
Taylor expanded in F around inf
associate--l+N/A
div-subN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6443.2
Simplified43.2%
Taylor expanded in x around 0
Simplified44.3%
(FPCore (F B x)
:precision binary64
(if (<= F -5.1e-36)
(/ (- -1.0 x) B)
(if (<= F 4.5e-42)
(/ (- 0.0 x) B)
(fma -0.5 (/ 2.0 (* F (* F B))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.1e-36) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.5e-42) {
tmp = (0.0 - x) / B;
} else {
tmp = fma(-0.5, (2.0 / (F * (F * B))), ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.1e-36) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4.5e-42) tmp = Float64(Float64(0.0 - x) / B); else tmp = fma(-0.5, Float64(2.0 / Float64(F * Float64(F * B))), Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.1e-36], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.5e-42], N[(N[(0.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(-0.5 * N[(2.0 / N[(F * N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.1 \cdot 10^{-36}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-42}:\\
\;\;\;\;\frac{0 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \frac{2}{F \cdot \left(F \cdot B\right)}, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -5.09999999999999973e-36Initial program 53.8%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6439.5
Simplified39.5%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6453.6
Simplified53.6%
if -5.09999999999999973e-36 < F < 4.5e-42Initial program 99.4%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6451.2
Simplified51.2%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f6433.5
Simplified33.5%
if 4.5e-42 < F Initial program 60.9%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6428.4
Simplified28.4%
Taylor expanded in F around inf
associate--l+N/A
div-subN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6443.2
Simplified43.2%
Taylor expanded in x around 0
Simplified44.3%
(FPCore (F B x) :precision binary64 (if (<= F -5.4e-36) (/ (- -1.0 x) B) (if (<= F 2.8e-115) (/ (- 0.0 x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.4e-36) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.8e-115) {
tmp = (0.0 - 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 <= (-5.4d-36)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.8d-115) then
tmp = (0.0d0 - 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 <= -5.4e-36) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.8e-115) {
tmp = (0.0 - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.4e-36: tmp = (-1.0 - x) / B elif F <= 2.8e-115: tmp = (0.0 - x) / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.4e-36) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.8e-115) tmp = Float64(Float64(0.0 - 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 <= -5.4e-36) tmp = (-1.0 - x) / B; elseif (F <= 2.8e-115) tmp = (0.0 - x) / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.4e-36], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.8e-115], N[(N[(0.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.4 \cdot 10^{-36}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{-115}:\\
\;\;\;\;\frac{0 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5.40000000000000015e-36Initial program 53.8%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6439.5
Simplified39.5%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6453.6
Simplified53.6%
if -5.40000000000000015e-36 < F < 2.79999999999999987e-115Initial program 99.5%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6454.3
Simplified54.3%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f6437.5
Simplified37.5%
if 2.79999999999999987e-115 < F Initial program 66.2%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6429.0
Simplified29.0%
Taylor expanded in F around inf
/-lowering-/.f64N/A
--lowering--.f6438.9
Simplified38.9%
(FPCore (F B x) :precision binary64 (if (<= F -7.5e-36) (/ (- -1.0 x) B) (/ (- 0.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.5e-36) {
tmp = (-1.0 - x) / B;
} else {
tmp = (0.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 <= (-7.5d-36)) then
tmp = ((-1.0d0) - x) / b
else
tmp = (0.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7.5e-36) {
tmp = (-1.0 - x) / B;
} else {
tmp = (0.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.5e-36: tmp = (-1.0 - x) / B else: tmp = (0.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.5e-36) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(0.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7.5e-36) tmp = (-1.0 - x) / B; else tmp = (0.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.5e-36], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(0.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.5 \cdot 10^{-36}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{0 - x}{B}\\
\end{array}
\end{array}
if F < -7.49999999999999972e-36Initial program 53.8%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6439.5
Simplified39.5%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6453.6
Simplified53.6%
if -7.49999999999999972e-36 < F Initial program 80.9%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6440.2
Simplified40.2%
Taylor expanded in F around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f6425.2
Simplified25.2%
(FPCore (F B x) :precision binary64 (/ (- -1.0 x) B))
double code(double F, double B, double x) {
return (-1.0 - 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 = ((-1.0d0) - x) / b
end function
public static double code(double F, double B, double x) {
return (-1.0 - x) / B;
}
def code(F, B, x): return (-1.0 - x) / B
function code(F, B, x) return Float64(Float64(-1.0 - x) / B) end
function tmp = code(F, B, x) tmp = (-1.0 - x) / B; end
code[F_, B_, x_] := N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1 - x}{B}
\end{array}
Initial program 71.5%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6439.9
Simplified39.9%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6428.6
Simplified28.6%
(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 71.5%
Taylor expanded in B around 0
/-lowering-/.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6439.9
Simplified39.9%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6428.6
Simplified28.6%
Taylor expanded in x around 0
/-lowering-/.f6412.3
Simplified12.3%
herbie shell --seed 2024199
(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))))))