VandenBroeck and Keller, Equation (23)

Percentage Accurate: 75.8% → 99.7%
Time: 18.8s
Alternatives: 18
Speedup: 1.5×

Specification

?
\[\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
 (+
  (- (* 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:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 18 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 75.8% accurate, 1.0× speedup?

\[\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
 (+
  (- (* 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}

Alternative 1: 99.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -6.8 \cdot 10^{+31}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+111}:\\ \;\;\;\;\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -6.8e+31)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 2.35e+111)
       (- (/ F (/ (sin B) (pow (fma 2.0 x (fma F F 2.0)) -0.5))) t_0)
       (- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -6.8e+31) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 2.35e+111) {
		tmp = (F / (sin(B) / pow(fma(2.0, x, fma(F, F, 2.0)), -0.5))) - 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 <= -6.8e+31)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 2.35e+111)
		tmp = Float64(Float64(F / Float64(sin(B) / (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5))) - 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, -6.8e+31], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.35e+111], N[(N[(F / N[(N[Sin[B], $MachinePrecision] / N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $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 -6.8 \cdot 10^{+31}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 2.35 \cdot 10^{+111}:\\
\;\;\;\;\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}} - t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -6.7999999999999996e31

    1. Initial program 57.8%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv57.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u35.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef34.9%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr34.9%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def35.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p57.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified57.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 99.9%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg99.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    8. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]

    if -6.7999999999999996e31 < F < 2.35000000000000004e111

    1. Initial program 99.5%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv99.6%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u66.7%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef52.7%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr52.7%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def66.7%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p99.6%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified99.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Step-by-step derivation
      1. +-commutative99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\sin B} \cdot {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \]
      2. *-commutative99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)} \]
      3. fma-udef99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\sin B} \cdot {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \]
      4. fma-def99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)} \]
      5. metadata-eval99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)} \]
      6. metadata-eval99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}} \]
      7. associate-*l/99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}} \]
      8. associate-/l*99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} \]
      9. fma-def99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F + 2}\right)\right)}^{-0.5}}} \]
      10. fma-udef99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(x \cdot 2 + \left(F \cdot F + 2\right)\right)}}^{-0.5}}} \]
      11. *-commutative99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\color{blue}{2 \cdot x} + \left(F \cdot F + 2\right)\right)}^{-0.5}}} \]
      12. fma-def99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{-0.5}}} \]
      13. fma-def99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{-0.5}}} \]
    7. Applied egg-rr99.6%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} \]

    if 2.35000000000000004e111 < F

    1. Initial program 22.4%

      \[\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)} \]
    2. Taylor expanded in B around inf 22.4%

      \[\leadsto \left(-x \cdot \color{blue}{\frac{\cos B}{\sin B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in F around inf 99.8%

      \[\leadsto \left(-x \cdot \frac{\cos B}{\sin B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    4. Step-by-step derivation
      1. +-commutative99.8%

        \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(-x \cdot \frac{\cos B}{\sin B}\right)} \]
      2. unsub-neg99.8%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - x \cdot \frac{\cos B}{\sin B}} \]
      3. clear-num99.8%

        \[\leadsto \frac{1}{\sin B} - x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \]
      4. tan-quot99.8%

        \[\leadsto \frac{1}{\sin B} - x \cdot \frac{1}{\color{blue}{\tan B}} \]
      5. un-div-inv99.9%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{\tan B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{+31}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+111}:\\ \;\;\;\;\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 2: 99.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -6.8 \cdot 10^{+31}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1400000000000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{F \cdot \sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -6.8e+31)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 1400000000000.0)
       (- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) t_0)
       (+ (/ -1.0 (/ (tan B) x)) (/ F (* F (sin B))))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -6.8e+31) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 1400000000000.0) {
		tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - t_0;
	} else {
		tmp = (-1.0 / (tan(B) / x)) + (F / (F * sin(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-6.8d+31)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 1400000000000.0d0) then
        tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - t_0
    else
        tmp = ((-1.0d0) / (tan(b) / x)) + (f / (f * sin(b)))
    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 <= -6.8e+31) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 1400000000000.0) {
		tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - t_0;
	} else {
		tmp = (-1.0 / (Math.tan(B) / x)) + (F / (F * Math.sin(B)));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -6.8e+31:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 1400000000000.0:
		tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - t_0
	else:
		tmp = (-1.0 / (math.tan(B) / x)) + (F / (F * math.sin(B)))
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -6.8e+31)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 1400000000000.0)
		tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - t_0);
	else
		tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(F / Float64(F * sin(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -6.8e+31)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 1400000000000.0)
		tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - t_0;
	else
		tmp = (-1.0 / (tan(B) / x)) + (F / (F * sin(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6.8e+31], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1400000000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -6.8 \cdot 10^{+31}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 1400000000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{F \cdot \sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -6.7999999999999996e31

    1. Initial program 57.8%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv57.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u35.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef34.9%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr34.9%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def35.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p57.9%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified57.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 99.9%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg99.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    8. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]

    if -6.7999999999999996e31 < F < 1.4e12

    1. Initial program 99.5%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv99.6%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u67.8%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef51.6%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr51.6%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def67.8%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p99.6%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified99.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]

    if 1.4e12 < F

    1. Initial program 46.3%

      \[\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)} \]
    2. Taylor expanded in F around inf 76.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. un-div-inv76.3%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
      2. associate-/l/99.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    4. Applied egg-rr99.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    5. Step-by-step derivation
      1. div-inv99.8%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{F \cdot \sin B} \]
      2. clear-num99.8%

        \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x}}}\right) + \frac{F}{F \cdot \sin B} \]
    6. Applied egg-rr99.8%

      \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x}}}\right) + \frac{F}{F \cdot \sin B} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{+31}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1400000000000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{F \cdot \sin B}\\ \end{array} \]

Alternative 3: 99.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.55:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 10^{-6}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{F \cdot \sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -1.55)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 1e-6)
       (- (/ F (* (sin B) (sqrt (+ 2.0 (* x 2.0))))) t_0)
       (+ (/ -1.0 (/ (tan B) x)) (/ F (* F (sin B))))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -1.55) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 1e-6) {
		tmp = (F / (sin(B) * sqrt((2.0 + (x * 2.0))))) - t_0;
	} else {
		tmp = (-1.0 / (tan(B) / x)) + (F / (F * sin(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-1.55d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 1d-6) then
        tmp = (f / (sin(b) * sqrt((2.0d0 + (x * 2.0d0))))) - t_0
    else
        tmp = ((-1.0d0) / (tan(b) / x)) + (f / (f * sin(b)))
    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.55) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 1e-6) {
		tmp = (F / (Math.sin(B) * Math.sqrt((2.0 + (x * 2.0))))) - t_0;
	} else {
		tmp = (-1.0 / (Math.tan(B) / x)) + (F / (F * Math.sin(B)));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -1.55:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 1e-6:
		tmp = (F / (math.sin(B) * math.sqrt((2.0 + (x * 2.0))))) - t_0
	else:
		tmp = (-1.0 / (math.tan(B) / x)) + (F / (F * math.sin(B)))
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1.55)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 1e-6)
		tmp = Float64(Float64(F / Float64(sin(B) * sqrt(Float64(2.0 + Float64(x * 2.0))))) - t_0);
	else
		tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(F / Float64(F * sin(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -1.55)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 1e-6)
		tmp = (F / (sin(B) * sqrt((2.0 + (x * 2.0))))) - t_0;
	else
		tmp = (-1.0 / (tan(B) / x)) + (F / (F * sin(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.55], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1e-6], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.55:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 10^{-6}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}} - t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{F \cdot \sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.55000000000000004

    1. Initial program 61.1%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv61.2%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u37.8%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef37.6%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr37.6%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def37.8%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p61.2%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified61.2%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 99.2%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Step-by-step derivation
      1. +-commutative99.2%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg99.2%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    8. Applied egg-rr99.2%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]

    if -1.55000000000000004 < F < 9.99999999999999955e-7

    1. Initial program 99.5%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv99.5%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u67.3%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef48.7%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr48.7%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def67.3%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p99.5%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified99.5%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\sin B} \cdot {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \]
      2. *-commutative99.5%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)} \]
      3. fma-udef99.5%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\sin B} \cdot {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \]
      4. fma-def99.5%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)} \]
      5. metadata-eval99.5%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)} \]
      6. metadata-eval99.5%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}} \]
      7. associate-*l/99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}} \]
      8. associate-/l*99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} \]
      9. fma-def99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F + 2}\right)\right)}^{-0.5}}} \]
      10. fma-udef99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(x \cdot 2 + \left(F \cdot F + 2\right)\right)}}^{-0.5}}} \]
      11. *-commutative99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\color{blue}{2 \cdot x} + \left(F \cdot F + 2\right)\right)}^{-0.5}}} \]
      12. fma-def99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{-0.5}}} \]
      13. fma-def99.6%

        \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{-0.5}}} \]
    7. Applied egg-rr99.6%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} \]
    8. Taylor expanded in F around 0 99.6%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \frac{F}{\color{blue}{\sin B \cdot \sqrt{2 + 2 \cdot x}}} \]

    if 9.99999999999999955e-7 < F

    1. Initial program 52.7%

      \[\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)} \]
    2. Taylor expanded in F around inf 76.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. un-div-inv76.8%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
      2. associate-/l/97.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    4. Applied egg-rr97.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    5. Step-by-step derivation
      1. div-inv97.5%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{F \cdot \sin B} \]
      2. clear-num97.5%

        \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x}}}\right) + \frac{F}{F \cdot \sin B} \]
    6. Applied egg-rr97.5%

      \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x}}}\right) + \frac{F}{F \cdot \sin B} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.55:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 10^{-6}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{F \cdot \sin B}\\ \end{array} \]

Alternative 4: 86.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.5 \cdot 10^{-31}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 5.4 \cdot 10^{-224}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 10^{-6}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{F \cdot \sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.5e-31)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 5.4e-224)
     (/ (- x) (tan B))
     (if (<= F 1e-6)
       (- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
       (+ (/ -1.0 (/ (tan B) x)) (/ F (* F (sin B))))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.5e-31) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 5.4e-224) {
		tmp = -x / tan(B);
	} else if (F <= 1e-6) {
		tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
	} else {
		tmp = (-1.0 / (tan(B) / x)) + (F / (F * sin(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-2.5d-31)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 5.4d-224) then
        tmp = -x / tan(b)
    else if (f <= 1d-6) then
        tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
    else
        tmp = ((-1.0d0) / (tan(b) / x)) + (f / (f * sin(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.5e-31) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 5.4e-224) {
		tmp = -x / Math.tan(B);
	} else if (F <= 1e-6) {
		tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
	} else {
		tmp = (-1.0 / (Math.tan(B) / x)) + (F / (F * Math.sin(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.5e-31:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 5.4e-224:
		tmp = -x / math.tan(B)
	elif F <= 1e-6:
		tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B)
	else:
		tmp = (-1.0 / (math.tan(B) / x)) + (F / (F * math.sin(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.5e-31)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 5.4e-224)
		tmp = Float64(Float64(-x) / tan(B));
	elseif (F <= 1e-6)
		tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B));
	else
		tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(F / Float64(F * sin(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -2.5e-31)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 5.4e-224)
		tmp = -x / tan(B);
	elseif (F <= 1e-6)
		tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B);
	else
		tmp = (-1.0 / (tan(B) / x)) + (F / (F * sin(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.5e-31], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.4e-224], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e-6], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{-31}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 5.4 \cdot 10^{-224}:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq 10^{-6}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{F \cdot \sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -2.5e-31

    1. Initial program 62.7%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv62.8%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u40.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef40.1%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr40.1%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def40.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p62.8%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified62.8%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 96.4%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Step-by-step derivation
      1. +-commutative96.4%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg96.4%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    8. Applied egg-rr96.4%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]

    if -2.5e-31 < F < 5.39999999999999996e-224

    1. Initial program 99.5%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 85.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg85.7%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/85.7%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in85.7%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified85.7%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out85.7%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      2. neg-sub085.7%

        \[\leadsto \color{blue}{0 - \frac{x}{\sin B} \cdot \cos B} \]
      3. associate-*l/85.7%

        \[\leadsto 0 - \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
      4. associate-/l*85.7%

        \[\leadsto 0 - \color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      5. quot-tan85.8%

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    8. Applied egg-rr85.8%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    9. Step-by-step derivation
      1. neg-sub085.8%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac85.8%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    10. Simplified85.8%

      \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

    if 5.39999999999999996e-224 < F < 9.99999999999999955e-7

    1. Initial program 99.5%

      \[\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)} \]
    2. Taylor expanded in B around 0 78.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]

    if 9.99999999999999955e-7 < F

    1. Initial program 52.7%

      \[\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)} \]
    2. Taylor expanded in F around inf 76.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. un-div-inv76.8%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
      2. associate-/l/97.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    4. Applied egg-rr97.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    5. Step-by-step derivation
      1. div-inv97.5%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{F \cdot \sin B} \]
      2. clear-num97.5%

        \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x}}}\right) + \frac{F}{F \cdot \sin B} \]
    6. Applied egg-rr97.5%

      \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x}}}\right) + \frac{F}{F \cdot \sin B} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification91.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.5 \cdot 10^{-31}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 5.4 \cdot 10^{-224}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 10^{-6}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{F \cdot \sin B}\\ \end{array} \]

Alternative 5: 92.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -305000:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 6800:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -305000.0)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 6800.0)
       (+
        (* x (/ -1.0 (tan B)))
        (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F 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 <= -305000.0) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 6800.0) {
		tmp = (x * (-1.0 / tan(B))) + (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / 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 <= (-305000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 6800.0d0) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / 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 <= -305000.0) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 6800.0) {
		tmp = (x * (-1.0 / Math.tan(B))) + (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / 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 <= -305000.0:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 6800.0:
		tmp = (x * (-1.0 / math.tan(B))) + (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / 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 <= -305000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 6800.0)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / 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 <= -305000.0)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 6800.0)
		tmp = (x * (-1.0 / tan(B))) + ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / 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, -305000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6800.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $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 -305000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 6800:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -305000

    1. Initial program 60.2%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv60.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u37.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef37.4%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr37.4%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def37.5%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p60.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified60.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 99.9%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg99.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    8. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]

    if -305000 < F < 6800

    1. Initial program 99.5%

      \[\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)} \]
    2. Taylor expanded in B around 0 87.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]

    if 6800 < F

    1. Initial program 49.7%

      \[\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)} \]
    2. Taylor expanded in B around inf 49.8%

      \[\leadsto \left(-x \cdot \color{blue}{\frac{\cos B}{\sin B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in F around inf 99.0%

      \[\leadsto \left(-x \cdot \frac{\cos B}{\sin B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    4. Step-by-step derivation
      1. +-commutative99.0%

        \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(-x \cdot \frac{\cos B}{\sin B}\right)} \]
      2. unsub-neg99.0%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - x \cdot \frac{\cos B}{\sin B}} \]
      3. clear-num99.0%

        \[\leadsto \frac{1}{\sin B} - x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \]
      4. tan-quot99.0%

        \[\leadsto \frac{1}{\sin B} - x \cdot \frac{1}{\color{blue}{\tan B}} \]
      5. un-div-inv99.1%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.1%

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{\tan B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification94.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -305000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6800:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 6: 84.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.7 \cdot 10^{-134}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 4.7 \cdot 10^{-7}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{F \cdot \sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.5e-26)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 3.7e-134)
     (/ (- x) (tan B))
     (if (<= F 4.7e-7)
       (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
       (+ (/ -1.0 (/ (tan B) x)) (/ F (* F (sin B))))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.5e-26) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 3.7e-134) {
		tmp = -x / tan(B);
	} else if (F <= 4.7e-7) {
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	} else {
		tmp = (-1.0 / (tan(B) / x)) + (F / (F * sin(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.5d-26)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 3.7d-134) then
        tmp = -x / tan(b)
    else if (f <= 4.7d-7) then
        tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    else
        tmp = ((-1.0d0) / (tan(b) / x)) + (f / (f * sin(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.5e-26) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 3.7e-134) {
		tmp = -x / Math.tan(B);
	} else if (F <= 4.7e-7) {
		tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	} else {
		tmp = (-1.0 / (Math.tan(B) / x)) + (F / (F * Math.sin(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.5e-26:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 3.7e-134:
		tmp = -x / math.tan(B)
	elif F <= 4.7e-7:
		tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B
	else:
		tmp = (-1.0 / (math.tan(B) / x)) + (F / (F * math.sin(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.5e-26)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 3.7e-134)
		tmp = Float64(Float64(-x) / tan(B));
	elseif (F <= 4.7e-7)
		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B);
	else
		tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(F / Float64(F * sin(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.5e-26)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 3.7e-134)
		tmp = -x / tan(B);
	elseif (F <= 4.7e-7)
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	else
		tmp = (-1.0 / (tan(B) / x)) + (F / (F * sin(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.5e-26], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.7e-134], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.7e-7], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-26}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 3.7 \cdot 10^{-134}:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq 4.7 \cdot 10^{-7}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{F \cdot \sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.50000000000000006e-26

    1. Initial program 62.7%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv62.8%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u40.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef40.1%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr40.1%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def40.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p62.8%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified62.8%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 96.4%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Step-by-step derivation
      1. +-commutative96.4%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg96.4%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    8. Applied egg-rr96.4%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]

    if -1.50000000000000006e-26 < F < 3.7e-134

    1. Initial program 99.5%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 82.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg82.0%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/82.0%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in82.0%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified82.0%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out82.0%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      2. neg-sub082.0%

        \[\leadsto \color{blue}{0 - \frac{x}{\sin B} \cdot \cos B} \]
      3. associate-*l/82.0%

        \[\leadsto 0 - \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
      4. associate-/l*82.0%

        \[\leadsto 0 - \color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      5. quot-tan82.0%

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    8. Applied egg-rr82.0%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    9. Step-by-step derivation
      1. neg-sub082.0%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac82.0%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    10. Simplified82.0%

      \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

    if 3.7e-134 < F < 4.7e-7

    1. Initial program 99.4%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in B around 0 69.3%

      \[\leadsto \color{blue}{\frac{-1 \cdot x + F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}{B}} \]
    5. Taylor expanded in F around 0 69.3%

      \[\leadsto \frac{-1 \cdot x + F \cdot \color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{B} \]
    6. Step-by-step derivation
      1. *-commutative69.3%

        \[\leadsto \frac{-1 \cdot x + F \cdot \sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{B} \]
    7. Simplified69.3%

      \[\leadsto \frac{-1 \cdot x + F \cdot \color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{B} \]

    if 4.7e-7 < F

    1. Initial program 52.7%

      \[\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)} \]
    2. Taylor expanded in F around inf 76.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. un-div-inv76.8%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
      2. associate-/l/97.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    4. Applied egg-rr97.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    5. Step-by-step derivation
      1. div-inv97.5%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{F \cdot \sin B} \]
      2. clear-num97.5%

        \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x}}}\right) + \frac{F}{F \cdot \sin B} \]
    6. Applied egg-rr97.5%

      \[\leadsto \left(-\color{blue}{\frac{1}{\frac{\tan B}{x}}}\right) + \frac{F}{F \cdot \sin B} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification90.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.7 \cdot 10^{-134}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 4.7 \cdot 10^{-7}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{F \cdot \sin B}\\ \end{array} \]

Alternative 7: 84.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.3 \cdot 10^{-24}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-134}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-9}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -1.3e-24)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 1.6e-134)
       (/ (- x) (tan B))
       (if (<= F 1.7e-9)
         (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) 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 <= -1.3e-24) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 1.6e-134) {
		tmp = -x / tan(B);
	} else if (F <= 1.7e-9) {
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - 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 <= (-1.3d-24)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 1.6d-134) then
        tmp = -x / tan(b)
    else if (f <= 1.7d-9) then
        tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - 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 <= -1.3e-24) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 1.6e-134) {
		tmp = -x / Math.tan(B);
	} else if (F <= 1.7e-9) {
		tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - 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 <= -1.3e-24:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 1.6e-134:
		tmp = -x / math.tan(B)
	elif F <= 1.7e-9:
		tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - 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 <= -1.3e-24)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 1.6e-134)
		tmp = Float64(Float64(-x) / tan(B));
	elseif (F <= 1.7e-9)
		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - 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 <= -1.3e-24)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 1.6e-134)
		tmp = -x / tan(B);
	elseif (F <= 1.7e-9)
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - 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, -1.3e-24], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.6e-134], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-9], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $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.3 \cdot 10^{-24}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 1.6 \cdot 10^{-134}:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq 1.7 \cdot 10^{-9}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.3e-24

    1. Initial program 62.7%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv62.8%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u40.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef40.1%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr40.1%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def40.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p62.8%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified62.8%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 96.4%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Step-by-step derivation
      1. +-commutative96.4%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg96.4%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    8. Applied egg-rr96.4%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]

    if -1.3e-24 < F < 1.6000000000000001e-134

    1. Initial program 99.5%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 82.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg82.0%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/82.0%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in82.0%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified82.0%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out82.0%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      2. neg-sub082.0%

        \[\leadsto \color{blue}{0 - \frac{x}{\sin B} \cdot \cos B} \]
      3. associate-*l/82.0%

        \[\leadsto 0 - \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
      4. associate-/l*82.0%

        \[\leadsto 0 - \color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      5. quot-tan82.0%

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    8. Applied egg-rr82.0%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    9. Step-by-step derivation
      1. neg-sub082.0%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac82.0%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    10. Simplified82.0%

      \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

    if 1.6000000000000001e-134 < F < 1.6999999999999999e-9

    1. Initial program 99.4%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in B around 0 69.3%

      \[\leadsto \color{blue}{\frac{-1 \cdot x + F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}{B}} \]
    5. Taylor expanded in F around 0 69.3%

      \[\leadsto \frac{-1 \cdot x + F \cdot \color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{B} \]
    6. Step-by-step derivation
      1. *-commutative69.3%

        \[\leadsto \frac{-1 \cdot x + F \cdot \sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{B} \]
    7. Simplified69.3%

      \[\leadsto \frac{-1 \cdot x + F \cdot \color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{B} \]

    if 1.6999999999999999e-9 < F

    1. Initial program 52.7%

      \[\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)} \]
    2. Taylor expanded in B around inf 52.8%

      \[\leadsto \left(-x \cdot \color{blue}{\frac{\cos B}{\sin B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in F around inf 97.4%

      \[\leadsto \left(-x \cdot \frac{\cos B}{\sin B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    4. Step-by-step derivation
      1. +-commutative97.4%

        \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(-x \cdot \frac{\cos B}{\sin B}\right)} \]
      2. unsub-neg97.4%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - x \cdot \frac{\cos B}{\sin B}} \]
      3. clear-num97.3%

        \[\leadsto \frac{1}{\sin B} - x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \]
      4. tan-quot97.4%

        \[\leadsto \frac{1}{\sin B} - x \cdot \frac{1}{\color{blue}{\tan B}} \]
      5. un-div-inv97.5%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr97.5%

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{\tan B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification90.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.3 \cdot 10^{-24}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-134}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-9}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 8: 77.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.1 \cdot 10^{-23}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.15 \cdot 10^{-134}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-7}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 2.45 \cdot 10^{+76}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4.1e-23)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 2.15e-134)
     (/ (- x) (tan B))
     (if (<= F 7.5e-7)
       (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
       (if (<= F 2.45e+76)
         (- (/ 1.0 B) (* x (/ 1.0 (tan B))))
         (- (/ F (* F (sin B))) (/ x B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.1e-23) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 2.15e-134) {
		tmp = -x / tan(B);
	} else if (F <= 7.5e-7) {
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	} else if (F <= 2.45e+76) {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	} else {
		tmp = (F / (F * 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.1d-23)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 2.15d-134) then
        tmp = -x / tan(b)
    else if (f <= 7.5d-7) then
        tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    else if (f <= 2.45d+76) then
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    else
        tmp = (f / (f * 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.1e-23) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 2.15e-134) {
		tmp = -x / Math.tan(B);
	} else if (F <= 7.5e-7) {
		tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	} else if (F <= 2.45e+76) {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	} else {
		tmp = (F / (F * Math.sin(B))) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -4.1e-23:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 2.15e-134:
		tmp = -x / math.tan(B)
	elif F <= 7.5e-7:
		tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B
	elif F <= 2.45e+76:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	else:
		tmp = (F / (F * math.sin(B))) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -4.1e-23)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 2.15e-134)
		tmp = Float64(Float64(-x) / tan(B));
	elseif (F <= 7.5e-7)
		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B);
	elseif (F <= 2.45e+76)
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	else
		tmp = Float64(Float64(F / Float64(F * sin(B))) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -4.1e-23)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 2.15e-134)
		tmp = -x / tan(B);
	elseif (F <= 7.5e-7)
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	elseif (F <= 2.45e+76)
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	else
		tmp = (F / (F * sin(B))) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -4.1e-23], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.15e-134], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-7], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.45e+76], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.1 \cdot 10^{-23}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 2.15 \cdot 10^{-134}:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq 7.5 \cdot 10^{-7}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\

\mathbf{elif}\;F \leq 2.45 \cdot 10^{+76}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -4.10000000000000029e-23

    1. Initial program 62.7%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv62.8%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u40.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef40.1%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr40.1%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def40.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p62.8%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified62.8%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 96.4%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Step-by-step derivation
      1. +-commutative96.4%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      2. unsub-neg96.4%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    8. Applied egg-rr96.4%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]

    if -4.10000000000000029e-23 < F < 2.14999999999999993e-134

    1. Initial program 99.5%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 82.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg82.0%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/82.0%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in82.0%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified82.0%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out82.0%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      2. neg-sub082.0%

        \[\leadsto \color{blue}{0 - \frac{x}{\sin B} \cdot \cos B} \]
      3. associate-*l/82.0%

        \[\leadsto 0 - \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
      4. associate-/l*82.0%

        \[\leadsto 0 - \color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      5. quot-tan82.0%

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    8. Applied egg-rr82.0%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    9. Step-by-step derivation
      1. neg-sub082.0%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac82.0%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    10. Simplified82.0%

      \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

    if 2.14999999999999993e-134 < F < 7.5000000000000002e-7

    1. Initial program 99.4%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in B around 0 69.3%

      \[\leadsto \color{blue}{\frac{-1 \cdot x + F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}{B}} \]
    5. Taylor expanded in F around 0 69.3%

      \[\leadsto \frac{-1 \cdot x + F \cdot \color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{B} \]
    6. Step-by-step derivation
      1. *-commutative69.3%

        \[\leadsto \frac{-1 \cdot x + F \cdot \sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{B} \]
    7. Simplified69.3%

      \[\leadsto \frac{-1 \cdot x + F \cdot \color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{B} \]

    if 7.5000000000000002e-7 < F < 2.45000000000000013e76

    1. Initial program 99.4%

      \[\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)} \]
    2. Taylor expanded in F around inf 92.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 76.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]

    if 2.45000000000000013e76 < F

    1. Initial program 29.4%

      \[\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)} \]
    2. Taylor expanded in F around inf 69.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. un-div-inv69.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
      2. associate-/l/99.8%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    4. Applied egg-rr99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    5. Taylor expanded in B around 0 84.4%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{F \cdot \sin B} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification86.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.1 \cdot 10^{-23}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.15 \cdot 10^{-134}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-7}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 2.45 \cdot 10^{+76}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 9: 69.7% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{-144}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{-7}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+76}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5e-80)
   (- (/ -1.0 B) (/ x (tan B)))
   (if (<= F 9.2e-144)
     (/ (- x) (tan B))
     (if (<= F 9.2e-7)
       (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
       (if (<= F 2.35e+76)
         (- (/ 1.0 B) (* x (/ 1.0 (tan B))))
         (- (/ F (* F (sin B))) (/ x B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5e-80) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else if (F <= 9.2e-144) {
		tmp = -x / tan(B);
	} else if (F <= 9.2e-7) {
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	} else if (F <= 2.35e+76) {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	} else {
		tmp = (F / (F * 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 <= (-5d-80)) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else if (f <= 9.2d-144) then
        tmp = -x / tan(b)
    else if (f <= 9.2d-7) then
        tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    else if (f <= 2.35d+76) then
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    else
        tmp = (f / (f * sin(b))) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -5e-80) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else if (F <= 9.2e-144) {
		tmp = -x / Math.tan(B);
	} else if (F <= 9.2e-7) {
		tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	} else if (F <= 2.35e+76) {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	} else {
		tmp = (F / (F * Math.sin(B))) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5e-80:
		tmp = (-1.0 / B) - (x / math.tan(B))
	elif F <= 9.2e-144:
		tmp = -x / math.tan(B)
	elif F <= 9.2e-7:
		tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B
	elif F <= 2.35e+76:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	else:
		tmp = (F / (F * math.sin(B))) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5e-80)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	elseif (F <= 9.2e-144)
		tmp = Float64(Float64(-x) / tan(B));
	elseif (F <= 9.2e-7)
		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B);
	elseif (F <= 2.35e+76)
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	else
		tmp = Float64(Float64(F / Float64(F * sin(B))) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -5e-80)
		tmp = (-1.0 / B) - (x / tan(B));
	elseif (F <= 9.2e-144)
		tmp = -x / tan(B);
	elseif (F <= 9.2e-7)
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	elseif (F <= 2.35e+76)
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	else
		tmp = (F / (F * sin(B))) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5e-80], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.2e-144], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.2e-7], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.35e+76], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-80}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 9.2 \cdot 10^{-144}:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq 9.2 \cdot 10^{-7}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\

\mathbf{elif}\;F \leq 2.35 \cdot 10^{+76}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -5e-80

    1. Initial program 65.1%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv65.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u42.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef41.1%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr41.1%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def42.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p65.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified65.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 93.0%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Taylor expanded in B around 0 72.3%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]

    if -5e-80 < F < 9.2e-144

    1. Initial program 99.6%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.6%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 84.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg84.8%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/84.7%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in84.7%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified84.7%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out84.7%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      2. neg-sub084.7%

        \[\leadsto \color{blue}{0 - \frac{x}{\sin B} \cdot \cos B} \]
      3. associate-*l/84.8%

        \[\leadsto 0 - \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
      4. associate-/l*84.8%

        \[\leadsto 0 - \color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      5. quot-tan84.8%

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    8. Applied egg-rr84.8%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    9. Step-by-step derivation
      1. neg-sub084.8%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac84.8%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    10. Simplified84.8%

      \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

    if 9.2e-144 < F < 9.1999999999999998e-7

    1. Initial program 99.4%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.4%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.4%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in B around 0 69.3%

      \[\leadsto \color{blue}{\frac{-1 \cdot x + F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}{B}} \]
    5. Taylor expanded in F around 0 69.3%

      \[\leadsto \frac{-1 \cdot x + F \cdot \color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{B} \]
    6. Step-by-step derivation
      1. *-commutative69.3%

        \[\leadsto \frac{-1 \cdot x + F \cdot \sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{B} \]
    7. Simplified69.3%

      \[\leadsto \frac{-1 \cdot x + F \cdot \color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{B} \]

    if 9.1999999999999998e-7 < F < 2.3500000000000002e76

    1. Initial program 99.4%

      \[\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)} \]
    2. Taylor expanded in F around inf 92.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 76.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]

    if 2.3500000000000002e76 < F

    1. Initial program 29.4%

      \[\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)} \]
    2. Taylor expanded in F around inf 69.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. un-div-inv69.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
      2. associate-/l/99.8%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    4. Applied egg-rr99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    5. Taylor expanded in B around 0 84.4%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{F \cdot \sin B} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification77.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{-144}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{-7}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+76}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 10: 69.5% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-61}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5.8e-80)
   (- (/ -1.0 B) (/ x (tan B)))
   (if (<= F 2.5e-61) (/ (- x) (tan B)) (- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.8e-80) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else if (F <= 2.5e-61) {
		tmp = -x / tan(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 <= (-5.8d-80)) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else if (f <= 2.5d-61) then
        tmp = -x / tan(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 <= -5.8e-80) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else if (F <= 2.5e-61) {
		tmp = -x / Math.tan(B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5.8e-80:
		tmp = (-1.0 / B) - (x / math.tan(B))
	elif F <= 2.5e-61:
		tmp = -x / math.tan(B)
	else:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5.8e-80)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	elseif (F <= 2.5e-61)
		tmp = Float64(Float64(-x) / tan(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 <= -5.8e-80)
		tmp = (-1.0 / B) - (x / tan(B));
	elseif (F <= 2.5e-61)
		tmp = -x / tan(B);
	else
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5.8e-80], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.5e-61], N[((-x) / N[Tan[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 -5.8 \cdot 10^{-80}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 2.5 \cdot 10^{-61}:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -5.79999999999999996e-80

    1. Initial program 65.1%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv65.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u42.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef41.1%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr41.1%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def42.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p65.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified65.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 93.0%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Taylor expanded in B around 0 72.3%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]

    if -5.79999999999999996e-80 < F < 2.4999999999999999e-61

    1. Initial program 99.5%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 78.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg78.4%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/78.4%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in78.4%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified78.4%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out78.4%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      2. neg-sub078.4%

        \[\leadsto \color{blue}{0 - \frac{x}{\sin B} \cdot \cos B} \]
      3. associate-*l/78.4%

        \[\leadsto 0 - \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
      4. associate-/l*78.4%

        \[\leadsto 0 - \color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      5. quot-tan78.4%

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    8. Applied egg-rr78.4%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    9. Step-by-step derivation
      1. neg-sub078.4%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac78.4%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    10. Simplified78.4%

      \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

    if 2.4999999999999999e-61 < F

    1. Initial program 59.4%

      \[\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)} \]
    2. Taylor expanded in F around inf 71.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 72.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-61}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 11: 70.7% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 7:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5.8e-80)
   (- (/ -1.0 B) (/ x (tan B)))
   (if (<= F 7.0) (/ (- x) (tan B)) (- (/ F (* F (sin B))) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.8e-80) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else if (F <= 7.0) {
		tmp = -x / tan(B);
	} else {
		tmp = (F / (F * 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 <= (-5.8d-80)) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else if (f <= 7.0d0) then
        tmp = -x / tan(b)
    else
        tmp = (f / (f * sin(b))) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.8e-80) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else if (F <= 7.0) {
		tmp = -x / Math.tan(B);
	} else {
		tmp = (F / (F * Math.sin(B))) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5.8e-80:
		tmp = (-1.0 / B) - (x / math.tan(B))
	elif F <= 7.0:
		tmp = -x / math.tan(B)
	else:
		tmp = (F / (F * math.sin(B))) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5.8e-80)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	elseif (F <= 7.0)
		tmp = Float64(Float64(-x) / tan(B));
	else
		tmp = Float64(Float64(F / Float64(F * sin(B))) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -5.8e-80)
		tmp = (-1.0 / B) - (x / tan(B));
	elseif (F <= 7.0)
		tmp = -x / tan(B);
	else
		tmp = (F / (F * sin(B))) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5.8e-80], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.0], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.8 \cdot 10^{-80}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 7:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -5.79999999999999996e-80

    1. Initial program 65.1%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv65.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u42.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef41.1%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr41.1%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def42.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p65.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified65.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 93.0%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Taylor expanded in B around 0 72.3%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]

    if -5.79999999999999996e-80 < F < 7

    1. Initial program 99.5%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 74.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg74.9%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/74.8%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in74.8%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified74.8%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out74.8%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      2. neg-sub074.8%

        \[\leadsto \color{blue}{0 - \frac{x}{\sin B} \cdot \cos B} \]
      3. associate-*l/74.9%

        \[\leadsto 0 - \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
      4. associate-/l*74.8%

        \[\leadsto 0 - \color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      5. quot-tan74.9%

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    8. Applied egg-rr74.9%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    9. Step-by-step derivation
      1. neg-sub074.9%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac74.9%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    10. Simplified74.9%

      \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

    if 7 < F

    1. Initial program 51.3%

      \[\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)} \]
    2. Taylor expanded in F around inf 76.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. un-div-inv76.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
      2. associate-/l/97.3%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    4. Applied egg-rr97.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{F \cdot \sin B}} \]
    5. Taylor expanded in B around 0 77.4%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{F \cdot \sin B} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 7:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 12: 62.8% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.2 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{+126}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4.2e-80)
   (- (/ -1.0 B) (/ x (tan B)))
   (if (<= F 4.8e+126)
     (/ (- x) (tan B))
     (+
      (* B (+ 0.16666666666666666 (* x 0.3333333333333333)))
      (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.2e-80) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else if (F <= 4.8e+126) {
		tmp = -x / tan(B);
	} else {
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-4.2d-80)) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else if (f <= 4.8d+126) then
        tmp = -x / tan(b)
    else
        tmp = (b * (0.16666666666666666d0 + (x * 0.3333333333333333d0))) + ((1.0d0 - x) / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.2e-80) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else if (F <= 4.8e+126) {
		tmp = -x / Math.tan(B);
	} else {
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -4.2e-80:
		tmp = (-1.0 / B) - (x / math.tan(B))
	elif F <= 4.8e+126:
		tmp = -x / math.tan(B)
	else:
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -4.2e-80)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	elseif (F <= 4.8e+126)
		tmp = Float64(Float64(-x) / tan(B));
	else
		tmp = Float64(Float64(B * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333))) + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -4.2e-80)
		tmp = (-1.0 / B) - (x / tan(B));
	elseif (F <= 4.8e+126)
		tmp = -x / tan(B);
	else
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -4.2e-80], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.8e+126], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(B * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.2 \cdot 10^{-80}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 4.8 \cdot 10^{+126}:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.20000000000000003e-80

    1. Initial program 65.1%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv65.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u42.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef41.1%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr41.1%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def42.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p65.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified65.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 93.0%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Taylor expanded in B around 0 72.3%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]

    if -4.20000000000000003e-80 < F < 4.80000000000000024e126

    1. Initial program 99.5%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 68.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg68.2%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/68.1%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in68.1%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified68.1%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out68.1%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      2. neg-sub068.1%

        \[\leadsto \color{blue}{0 - \frac{x}{\sin B} \cdot \cos B} \]
      3. associate-*l/68.2%

        \[\leadsto 0 - \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
      4. associate-/l*68.1%

        \[\leadsto 0 - \color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      5. quot-tan68.2%

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    8. Applied egg-rr68.2%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    9. Step-by-step derivation
      1. neg-sub068.2%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac68.2%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    10. Simplified68.2%

      \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

    if 4.80000000000000024e126 < F

    1. Initial program 16.2%

      \[\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)} \]
    2. Taylor expanded in F around inf 63.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 78.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(0.16666666666666666 \cdot B + \frac{1}{B}\right)} \]
    4. Taylor expanded in B around 0 71.1%

      \[\leadsto \color{blue}{\left(B \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) + \frac{1}{B}\right) - \frac{x}{B}} \]
    5. Step-by-step derivation
      1. associate--l+71.1%

        \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. div-sub71.2%

        \[\leadsto B \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) + \color{blue}{\frac{1 - x}{B}} \]
      3. distribute-lft-in71.2%

        \[\leadsto \color{blue}{\left(B \cdot 0.16666666666666666 + B \cdot \left(0.3333333333333333 \cdot x\right)\right)} + \frac{1 - x}{B} \]
      4. *-commutative71.2%

        \[\leadsto \left(B \cdot 0.16666666666666666 + B \cdot \color{blue}{\left(x \cdot 0.3333333333333333\right)}\right) + \frac{1 - x}{B} \]
      5. metadata-eval71.2%

        \[\leadsto \left(B \cdot 0.16666666666666666 + B \cdot \left(x \cdot \color{blue}{\left(-0.16666666666666666 - -0.5\right)}\right)\right) + \frac{1 - x}{B} \]
      6. distribute-rgt-out--71.2%

        \[\leadsto \left(B \cdot 0.16666666666666666 + B \cdot \color{blue}{\left(-0.16666666666666666 \cdot x - -0.5 \cdot x\right)}\right) + \frac{1 - x}{B} \]
      7. distribute-lft-in71.2%

        \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 + \left(-0.16666666666666666 \cdot x - -0.5 \cdot x\right)\right)} + \frac{1 - x}{B} \]
      8. distribute-rgt-out--71.2%

        \[\leadsto B \cdot \left(0.16666666666666666 + \color{blue}{x \cdot \left(-0.16666666666666666 - -0.5\right)}\right) + \frac{1 - x}{B} \]
      9. metadata-eval71.2%

        \[\leadsto B \cdot \left(0.16666666666666666 + x \cdot \color{blue}{0.3333333333333333}\right) + \frac{1 - x}{B} \]
    6. Simplified71.2%

      \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification70.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.2 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{+126}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 13: 56.8% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.05 \cdot 10^{-22}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{+128}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.05e-22)
   (/ (- -1.0 x) B)
   (if (<= F 9e+128)
     (/ (- x) (tan B))
     (+
      (* B (+ 0.16666666666666666 (* x 0.3333333333333333)))
      (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.05e-22) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 9e+128) {
		tmp = -x / tan(B);
	} else {
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((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.05d-22)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 9d+128) then
        tmp = -x / tan(b)
    else
        tmp = (b * (0.16666666666666666d0 + (x * 0.3333333333333333d0))) + ((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.05e-22) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 9e+128) {
		tmp = -x / Math.tan(B);
	} else {
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.05e-22:
		tmp = (-1.0 - x) / B
	elif F <= 9e+128:
		tmp = -x / math.tan(B)
	else:
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.05e-22)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 9e+128)
		tmp = Float64(Float64(-x) / tan(B));
	else
		tmp = Float64(Float64(B * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333))) + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.05e-22)
		tmp = (-1.0 - x) / B;
	elseif (F <= 9e+128)
		tmp = -x / tan(B);
	else
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.05e-22], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9e+128], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(B * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.05 \cdot 10^{-22}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 9 \cdot 10^{+128}:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.05000000000000004e-22

    1. Initial program 62.7%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv62.8%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u40.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef40.1%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr40.1%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def40.2%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p62.8%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified62.8%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 96.4%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Taylor expanded in B around 0 56.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    8. Step-by-step derivation
      1. mul-1-neg56.0%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    9. Simplified56.0%

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]

    if -1.05000000000000004e-22 < F < 9.0000000000000003e128

    1. Initial program 99.5%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 67.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg67.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/67.5%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in67.5%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified67.5%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out67.5%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      2. neg-sub067.5%

        \[\leadsto \color{blue}{0 - \frac{x}{\sin B} \cdot \cos B} \]
      3. associate-*l/67.5%

        \[\leadsto 0 - \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
      4. associate-/l*67.5%

        \[\leadsto 0 - \color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      5. quot-tan67.6%

        \[\leadsto 0 - \frac{x}{\color{blue}{\tan B}} \]
    8. Applied egg-rr67.6%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    9. Step-by-step derivation
      1. neg-sub067.6%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-neg-frac67.6%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    10. Simplified67.6%

      \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

    if 9.0000000000000003e128 < F

    1. Initial program 16.2%

      \[\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)} \]
    2. Taylor expanded in F around inf 63.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 78.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(0.16666666666666666 \cdot B + \frac{1}{B}\right)} \]
    4. Taylor expanded in B around 0 71.1%

      \[\leadsto \color{blue}{\left(B \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) + \frac{1}{B}\right) - \frac{x}{B}} \]
    5. Step-by-step derivation
      1. associate--l+71.1%

        \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. div-sub71.2%

        \[\leadsto B \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) + \color{blue}{\frac{1 - x}{B}} \]
      3. distribute-lft-in71.2%

        \[\leadsto \color{blue}{\left(B \cdot 0.16666666666666666 + B \cdot \left(0.3333333333333333 \cdot x\right)\right)} + \frac{1 - x}{B} \]
      4. *-commutative71.2%

        \[\leadsto \left(B \cdot 0.16666666666666666 + B \cdot \color{blue}{\left(x \cdot 0.3333333333333333\right)}\right) + \frac{1 - x}{B} \]
      5. metadata-eval71.2%

        \[\leadsto \left(B \cdot 0.16666666666666666 + B \cdot \left(x \cdot \color{blue}{\left(-0.16666666666666666 - -0.5\right)}\right)\right) + \frac{1 - x}{B} \]
      6. distribute-rgt-out--71.2%

        \[\leadsto \left(B \cdot 0.16666666666666666 + B \cdot \color{blue}{\left(-0.16666666666666666 \cdot x - -0.5 \cdot x\right)}\right) + \frac{1 - x}{B} \]
      7. distribute-lft-in71.2%

        \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 + \left(-0.16666666666666666 \cdot x - -0.5 \cdot x\right)\right)} + \frac{1 - x}{B} \]
      8. distribute-rgt-out--71.2%

        \[\leadsto B \cdot \left(0.16666666666666666 + \color{blue}{x \cdot \left(-0.16666666666666666 - -0.5\right)}\right) + \frac{1 - x}{B} \]
      9. metadata-eval71.2%

        \[\leadsto B \cdot \left(0.16666666666666666 + x \cdot \color{blue}{0.3333333333333333}\right) + \frac{1 - x}{B} \]
    6. Simplified71.2%

      \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.05 \cdot 10^{-22}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{+128}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 14: 44.0% accurate, 18.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.1 \cdot 10^{-81}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-56}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4.1e-81)
   (/ (- -1.0 x) B)
   (if (<= F 1.8e-56)
     (/ (- x) B)
     (+
      (* B (+ 0.16666666666666666 (* x 0.3333333333333333)))
      (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.1e-81) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.8e-56) {
		tmp = -x / B;
	} else {
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-4.1d-81)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 1.8d-56) then
        tmp = -x / b
    else
        tmp = (b * (0.16666666666666666d0 + (x * 0.3333333333333333d0))) + ((1.0d0 - x) / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.1e-81) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.8e-56) {
		tmp = -x / B;
	} else {
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -4.1e-81:
		tmp = (-1.0 - x) / B
	elif F <= 1.8e-56:
		tmp = -x / B
	else:
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -4.1e-81)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 1.8e-56)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(B * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333))) + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -4.1e-81)
		tmp = (-1.0 - x) / B;
	elseif (F <= 1.8e-56)
		tmp = -x / B;
	else
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -4.1e-81], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.8e-56], N[((-x) / B), $MachinePrecision], N[(N[(B * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.1 \cdot 10^{-81}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 1.8 \cdot 10^{-56}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.09999999999999984e-81

    1. Initial program 65.1%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv65.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u42.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef41.1%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr41.1%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def42.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p65.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified65.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 93.0%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Taylor expanded in B around 0 53.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    8. Step-by-step derivation
      1. mul-1-neg53.4%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    9. Simplified53.4%

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]

    if -4.09999999999999984e-81 < F < 1.79999999999999989e-56

    1. Initial program 99.5%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 78.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg78.8%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/78.7%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in78.7%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified78.7%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 39.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/39.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-139.2%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified39.2%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.79999999999999989e-56 < F

    1. Initial program 58.3%

      \[\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)} \]
    2. Taylor expanded in F around inf 72.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 62.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(0.16666666666666666 \cdot B + \frac{1}{B}\right)} \]
    4. Taylor expanded in B around 0 52.5%

      \[\leadsto \color{blue}{\left(B \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) + \frac{1}{B}\right) - \frac{x}{B}} \]
    5. Step-by-step derivation
      1. associate--l+52.5%

        \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. div-sub52.5%

        \[\leadsto B \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) + \color{blue}{\frac{1 - x}{B}} \]
      3. distribute-lft-in52.5%

        \[\leadsto \color{blue}{\left(B \cdot 0.16666666666666666 + B \cdot \left(0.3333333333333333 \cdot x\right)\right)} + \frac{1 - x}{B} \]
      4. *-commutative52.5%

        \[\leadsto \left(B \cdot 0.16666666666666666 + B \cdot \color{blue}{\left(x \cdot 0.3333333333333333\right)}\right) + \frac{1 - x}{B} \]
      5. metadata-eval52.5%

        \[\leadsto \left(B \cdot 0.16666666666666666 + B \cdot \left(x \cdot \color{blue}{\left(-0.16666666666666666 - -0.5\right)}\right)\right) + \frac{1 - x}{B} \]
      6. distribute-rgt-out--52.5%

        \[\leadsto \left(B \cdot 0.16666666666666666 + B \cdot \color{blue}{\left(-0.16666666666666666 \cdot x - -0.5 \cdot x\right)}\right) + \frac{1 - x}{B} \]
      7. distribute-lft-in52.5%

        \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 + \left(-0.16666666666666666 \cdot x - -0.5 \cdot x\right)\right)} + \frac{1 - x}{B} \]
      8. distribute-rgt-out--52.5%

        \[\leadsto B \cdot \left(0.16666666666666666 + \color{blue}{x \cdot \left(-0.16666666666666666 - -0.5\right)}\right) + \frac{1 - x}{B} \]
      9. metadata-eval52.5%

        \[\leadsto B \cdot \left(0.16666666666666666 + x \cdot \color{blue}{0.3333333333333333}\right) + \frac{1 - x}{B} \]
    6. Simplified52.5%

      \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.1 \cdot 10^{-81}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-56}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 15: 44.0% accurate, 35.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.2 \cdot 10^{-81}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-61}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4.2e-81)
   (/ (- -1.0 x) B)
   (if (<= F 2.4e-61) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.2e-81) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2.4e-61) {
		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 <= (-4.2d-81)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 2.4d-61) 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 <= -4.2e-81) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2.4e-61) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -4.2e-81:
		tmp = (-1.0 - x) / B
	elif F <= 2.4e-61:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -4.2e-81)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 2.4e-61)
		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 <= -4.2e-81)
		tmp = (-1.0 - x) / B;
	elseif (F <= 2.4e-61)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -4.2e-81], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.4e-61], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.2 \cdot 10^{-81}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 2.4 \cdot 10^{-61}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.1999999999999998e-81

    1. Initial program 65.1%

      \[\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)} \]
    2. Step-by-step derivation
      1. div-inv65.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p-u42.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. expm1-udef41.1%

        \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied egg-rr41.1%

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def42.1%

        \[\leadsto \left(-\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\tan B}\right)\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. expm1-log1p65.3%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Simplified65.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    6. Taylor expanded in F around -inf 93.0%

      \[\leadsto \left(-\frac{x}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    7. Taylor expanded in B around 0 53.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    8. Step-by-step derivation
      1. mul-1-neg53.4%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    9. Simplified53.4%

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]

    if -4.1999999999999998e-81 < F < 2.4000000000000001e-61

    1. Initial program 99.5%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 78.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg78.4%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/78.4%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in78.4%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified78.4%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 40.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/40.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-140.0%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified40.0%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 2.4000000000000001e-61 < F

    1. Initial program 59.4%

      \[\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)} \]
    2. Taylor expanded in F around inf 71.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 62.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(0.16666666666666666 \cdot B + \frac{1}{B}\right)} \]
    4. Taylor expanded in B around 0 50.6%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.2 \cdot 10^{-81}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-61}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 16: 36.8% accurate, 45.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 1.35 \cdot 10^{-61}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F 1.35e-61) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 1.35e-61) {
		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.35d-61) 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.35e-61) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 1.35e-61:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 1.35e-61)
		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.35e-61)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 1.35e-61], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.35 \cdot 10^{-61}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 1.34999999999999997e-61

    1. Initial program 79.9%

      \[\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)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in79.9%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative79.9%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def79.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative79.9%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative79.9%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def79.9%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def79.9%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval79.9%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval79.9%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/80.0%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity80.0%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified80.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 61.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg61.1%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/61.0%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in61.0%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified61.0%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 33.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/33.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-133.7%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified33.7%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.34999999999999997e-61 < F

    1. Initial program 59.4%

      \[\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)} \]
    2. Taylor expanded in F around inf 71.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Taylor expanded in B around 0 62.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(0.16666666666666666 \cdot B + \frac{1}{B}\right)} \]
    4. Taylor expanded in B around 0 50.6%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification38.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 1.35 \cdot 10^{-61}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 17: 29.6% accurate, 81.0× speedup?

\[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
(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}
Derivation
  1. Initial program 73.8%

    \[\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)} \]
  2. Step-by-step derivation
    1. distribute-lft-neg-in73.8%

      \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. +-commutative73.8%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
    3. fma-def73.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    4. +-commutative73.8%

      \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
    5. *-commutative73.8%

      \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
    6. fma-def73.8%

      \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
    7. fma-def73.8%

      \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
    8. metadata-eval73.8%

      \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
    9. metadata-eval73.8%

      \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
    10. associate-*r/73.8%

      \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
    11. *-rgt-identity73.8%

      \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
  3. Simplified73.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
  4. Taylor expanded in F around 0 55.4%

    \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
  5. Step-by-step derivation
    1. mul-1-neg55.4%

      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    2. associate-*l/55.3%

      \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
    3. distribute-rgt-neg-in55.3%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
  6. Simplified55.3%

    \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
  7. Taylor expanded in B around 0 29.8%

    \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
  8. Step-by-step derivation
    1. associate-*r/29.8%

      \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
    2. neg-mul-129.8%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]
  9. Simplified29.8%

    \[\leadsto \color{blue}{\frac{-x}{B}} \]
  10. Final simplification29.8%

    \[\leadsto \frac{-x}{B} \]

Alternative 18: 2.8% accurate, 108.0× speedup?

\[\begin{array}{l} \\ B \cdot 0.16666666666666666 \end{array} \]
(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}
Derivation
  1. Initial program 73.8%

    \[\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)} \]
  2. Taylor expanded in F around inf 48.5%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
  3. Taylor expanded in B around 0 41.2%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(0.16666666666666666 \cdot B + \frac{1}{B}\right)} \]
  4. Taylor expanded in B around inf 3.0%

    \[\leadsto \color{blue}{0.16666666666666666 \cdot B} \]
  5. Step-by-step derivation
    1. *-commutative3.0%

      \[\leadsto \color{blue}{B \cdot 0.16666666666666666} \]
  6. Simplified3.0%

    \[\leadsto \color{blue}{B \cdot 0.16666666666666666} \]
  7. Final simplification3.0%

    \[\leadsto B \cdot 0.16666666666666666 \]

Reproduce

?
herbie shell --seed 2023313 
(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))))))