VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.2% → 98.8%
Time: 23.3s
Alternatives: 26
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 26 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: 77.2% 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: 98.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{\sin B}{-1}\\ \mathbf{if}\;F \leq -6.5 \cdot 10^{+166}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(-1, \tan B, x \cdot t_1\right)}{t_1}}{-\tan B}\\ \mathbf{elif}\;F \leq 0.0013:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))) (t_1 (/ (sin B) -1.0)))
   (if (<= F -6.5e+166)
     (/ (/ (fma -1.0 (tan B) (* x t_1)) t_1) (- (tan B)))
     (if (<= F 0.0013)
       (- (/ (/ F (sqrt (fma F F 2.0))) (sin B)) t_0)
       (- (/ (/ F (+ F (/ 1.0 F))) (sin B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double t_1 = sin(B) / -1.0;
	double tmp;
	if (F <= -6.5e+166) {
		tmp = (fma(-1.0, tan(B), (x * t_1)) / t_1) / -tan(B);
	} else if (F <= 0.0013) {
		tmp = ((F / sqrt(fma(F, F, 2.0))) / sin(B)) - t_0;
	} else {
		tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	t_1 = Float64(sin(B) / -1.0)
	tmp = 0.0
	if (F <= -6.5e+166)
		tmp = Float64(Float64(fma(-1.0, tan(B), Float64(x * t_1)) / t_1) / Float64(-tan(B)));
	elseif (F <= 0.0013)
		tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) / sin(B)) - t_0);
	else
		tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / sin(B)) - t_0);
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[B], $MachinePrecision] / -1.0), $MachinePrecision]}, If[LessEqual[F, -6.5e+166], N[(N[(N[(-1.0 * N[Tan[B], $MachinePrecision] + N[(x * t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.0013], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{\sin B}{-1}\\
\mathbf{if}\;F \leq -6.5 \cdot 10^{+166}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(-1, \tan B, x \cdot t_1\right)}{t_1}}{-\tan B}\\

\mathbf{elif}\;F \leq 0.0013:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t_0\\

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


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

    1. Initial program 24.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. Simplified42.9%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/42.9%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity42.9%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative42.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow242.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef42.9%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. clear-num99.8%

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

        \[\leadsto \frac{1}{\frac{\sin B}{-1}} - \color{blue}{\frac{-x}{-\tan B}} \]
      3. frac-sub74.4%

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

      \[\leadsto \color{blue}{\frac{1 \cdot \left(-\tan B\right) - \frac{\sin B}{-1} \cdot \left(-x\right)}{\frac{\sin B}{-1} \cdot \left(-\tan B\right)}} \]
    10. Step-by-step derivation
      1. associate-/r*99.8%

        \[\leadsto \color{blue}{\frac{\frac{1 \cdot \left(-\tan B\right) - \frac{\sin B}{-1} \cdot \left(-x\right)}{\frac{\sin B}{-1}}}{-\tan B}} \]
      2. *-lft-identity99.8%

        \[\leadsto \frac{\frac{\color{blue}{\left(-\tan B\right)} - \frac{\sin B}{-1} \cdot \left(-x\right)}{\frac{\sin B}{-1}}}{-\tan B} \]
      3. neg-mul-199.8%

        \[\leadsto \frac{\frac{\color{blue}{-1 \cdot \tan B} - \frac{\sin B}{-1} \cdot \left(-x\right)}{\frac{\sin B}{-1}}}{-\tan B} \]
      4. fma-neg99.8%

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(-1, \tan B, -\frac{\sin B}{-1} \cdot \left(-x\right)\right)}}{\frac{\sin B}{-1}}}{-\tan B} \]
      5. distribute-rgt-neg-out99.8%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(-1, \tan B, -\color{blue}{\left(-\frac{\sin B}{-1} \cdot x\right)}\right)}{\frac{\sin B}{-1}}}{-\tan B} \]
      6. remove-double-neg99.8%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(-1, \tan B, \color{blue}{\frac{\sin B}{-1} \cdot x}\right)}{\frac{\sin B}{-1}}}{-\tan B} \]
      7. *-commutative99.8%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(-1, \tan B, \color{blue}{x \cdot \frac{\sin B}{-1}}\right)}{\frac{\sin B}{-1}}}{-\tan B} \]
    11. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(-1, \tan B, x \cdot \frac{\sin B}{-1}\right)}{\frac{\sin B}{-1}}}{-\tan B}} \]

    if -6.5000000000000005e166 < F < 0.0012999999999999999

    1. Initial program 94.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. Simplified99.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow299.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef99.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/99.6%

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

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

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

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

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

    if 0.0012999999999999999 < F

    1. Initial program 59.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. Simplified78.7%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/78.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity78.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow278.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef78.7%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/78.8%

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

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

        \[\leadsto \frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B} \]
      4. un-div-inv78.9%

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr78.9%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{+166}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(-1, \tan B, x \cdot \frac{\sin B}{-1}\right)}{\frac{\sin B}{-1}}}{-\tan B}\\ \mathbf{elif}\;F \leq 0.0013:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 98.8% accurate, 0.8× speedup?

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

\mathbf{elif}\;F \leq 0.0013:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t_0\\

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


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

    1. Initial program 24.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. Simplified42.9%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/42.9%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity42.9%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative42.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow242.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef42.9%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 99.8%

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

    if -6.5000000000000005e166 < F < 0.0012999999999999999

    1. Initial program 94.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. Simplified99.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow299.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef99.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/99.6%

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

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

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

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

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

    if 0.0012999999999999999 < F

    1. Initial program 59.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. Simplified78.7%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/78.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity78.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow278.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef78.7%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/78.8%

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

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

        \[\leadsto \frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B} \]
      4. un-div-inv78.9%

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr78.9%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{+166}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.0013:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 99.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -0.9:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 0.0013:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -0.9)
     (- (/ (/ F (- (/ -1.0 F) F)) (sin B)) t_0)
     (if (<= F 0.0013)
       (- (* F (/ (sqrt 0.5) (sin B))) t_0)
       (- (/ (/ F (+ F (/ 1.0 F))) (sin B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -0.9) {
		tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - t_0;
	} else if (F <= 0.0013) {
		tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
	} else {
		tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-0.9d0)) then
        tmp = ((f / (((-1.0d0) / f) - f)) / sin(b)) - t_0
    else if (f <= 0.0013d0) then
        tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
    else
        tmp = ((f / (f + (1.0d0 / f))) / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -0.9) {
		tmp = ((F / ((-1.0 / F) - F)) / Math.sin(B)) - t_0;
	} else if (F <= 0.0013) {
		tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
	} else {
		tmp = ((F / (F + (1.0 / F))) / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -0.9:
		tmp = ((F / ((-1.0 / F) - F)) / math.sin(B)) - t_0
	elif F <= 0.0013:
		tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0
	else:
		tmp = ((F / (F + (1.0 / F))) / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -0.9)
		tmp = Float64(Float64(Float64(F / Float64(Float64(-1.0 / F) - F)) / sin(B)) - t_0);
	elseif (F <= 0.0013)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0);
	else
		tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -0.9)
		tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - t_0;
	elseif (F <= 0.0013)
		tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
	else
		tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.9], N[(N[(N[(F / N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0013], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 0.0013:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t_0\\

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


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

    1. Initial program 54.0%

      \[\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. Simplified71.3%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/71.3%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity71.3%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative71.3%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow271.3%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef71.3%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/71.4%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr71.4%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around -inf 99.7%

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. mul-1-neg99.7%

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    11. Simplified99.7%

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

    if -0.900000000000000022 < F < 0.0012999999999999999

    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. Simplified99.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow299.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef99.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around 0 99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]

    if 0.0012999999999999999 < F

    1. Initial program 59.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. Simplified78.7%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/78.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity78.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow278.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef78.7%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/78.8%

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

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

        \[\leadsto \frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B} \]
      4. un-div-inv78.9%

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr78.9%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.9:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.0013:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 99.2% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 0.0013:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2}}}{\sin B} - t_0\\

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


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

    1. Initial program 54.0%

      \[\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. Simplified71.3%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/71.3%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity71.3%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative71.3%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow271.3%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef71.3%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/71.4%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr71.4%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around -inf 99.7%

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. mul-1-neg99.7%

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    11. Simplified99.7%

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

    if -0.92000000000000004 < F < 0.0012999999999999999

    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. Simplified99.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow299.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef99.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/99.5%

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\color{blue}{\sqrt{2}}}}{\sin B} - \frac{x}{\tan B} \]

    if 0.0012999999999999999 < F

    1. Initial program 59.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. Simplified78.7%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/78.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity78.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow278.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef78.7%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/78.8%

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

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

        \[\leadsto \frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B} \]
      4. un-div-inv78.9%

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr78.9%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.92:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.0013:\\ \;\;\;\;\frac{\frac{F}{\sqrt{2}}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 70.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\ t_1 := \frac{-x}{\frac{\sin B}{\cos B}}\\ t_2 := \frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{if}\;F \leq -215000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.3 \cdot 10^{-204}:\\ \;\;\;\;t_0 \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.95 \cdot 10^{-55}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 0.0013:\\ \;\;\;\;t_0 \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{+44}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 1.22 \cdot 10^{+200}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
        (t_1 (/ (- x) (/ (sin B) (cos B))))
        (t_2 (- (/ 1.0 (sin B)) (/ x B))))
   (if (<= F -215000000.0)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -2.3e-204)
       (- (* t_0 (/ F B)) (/ x B))
       (if (<= F 2.95e-55)
         t_1
         (if (<= F 0.0013)
           (- (* t_0 (+ (/ F B) (* 0.16666666666666666 (* F B)))) (/ x B))
           (if (<= F 2.4e+44)
             t_2
             (if (<= F 1.22e+200)
               (- (/ 1.0 B) (/ x (tan B)))
               (if (<= F 8.5e+290) t_2 t_1)))))))))
double code(double F, double B, double x) {
	double t_0 = pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
	double t_1 = -x / (sin(B) / cos(B));
	double t_2 = (1.0 / sin(B)) - (x / B);
	double tmp;
	if (F <= -215000000.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -2.3e-204) {
		tmp = (t_0 * (F / B)) - (x / B);
	} else if (F <= 2.95e-55) {
		tmp = t_1;
	} else if (F <= 0.0013) {
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	} else if (F <= 2.4e+44) {
		tmp = t_2;
	} else if (F <= 1.22e+200) {
		tmp = (1.0 / B) - (x / tan(B));
	} else if (F <= 8.5e+290) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
    t_1 = -x / (sin(b) / cos(b))
    t_2 = (1.0d0 / sin(b)) - (x / b)
    if (f <= (-215000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-2.3d-204)) then
        tmp = (t_0 * (f / b)) - (x / b)
    else if (f <= 2.95d-55) then
        tmp = t_1
    else if (f <= 0.0013d0) then
        tmp = (t_0 * ((f / b) + (0.16666666666666666d0 * (f * b)))) - (x / b)
    else if (f <= 2.4d+44) then
        tmp = t_2
    else if (f <= 1.22d+200) then
        tmp = (1.0d0 / b) - (x / tan(b))
    else if (f <= 8.5d+290) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
	double t_1 = -x / (Math.sin(B) / Math.cos(B));
	double t_2 = (1.0 / Math.sin(B)) - (x / B);
	double tmp;
	if (F <= -215000000.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -2.3e-204) {
		tmp = (t_0 * (F / B)) - (x / B);
	} else if (F <= 2.95e-55) {
		tmp = t_1;
	} else if (F <= 0.0013) {
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	} else if (F <= 2.4e+44) {
		tmp = t_2;
	} else if (F <= 1.22e+200) {
		tmp = (1.0 / B) - (x / Math.tan(B));
	} else if (F <= 8.5e+290) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)
	t_1 = -x / (math.sin(B) / math.cos(B))
	t_2 = (1.0 / math.sin(B)) - (x / B)
	tmp = 0
	if F <= -215000000.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -2.3e-204:
		tmp = (t_0 * (F / B)) - (x / B)
	elif F <= 2.95e-55:
		tmp = t_1
	elif F <= 0.0013:
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B)
	elif F <= 2.4e+44:
		tmp = t_2
	elif F <= 1.22e+200:
		tmp = (1.0 / B) - (x / math.tan(B))
	elif F <= 8.5e+290:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5
	t_1 = Float64(Float64(-x) / Float64(sin(B) / cos(B)))
	t_2 = Float64(Float64(1.0 / sin(B)) - Float64(x / B))
	tmp = 0.0
	if (F <= -215000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -2.3e-204)
		tmp = Float64(Float64(t_0 * Float64(F / B)) - Float64(x / B));
	elseif (F <= 2.95e-55)
		tmp = t_1;
	elseif (F <= 0.0013)
		tmp = Float64(Float64(t_0 * Float64(Float64(F / B) + Float64(0.16666666666666666 * Float64(F * B)))) - Float64(x / B));
	elseif (F <= 2.4e+44)
		tmp = t_2;
	elseif (F <= 1.22e+200)
		tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B)));
	elseif (F <= 8.5e+290)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = ((2.0 + (F * F)) + (x * 2.0)) ^ -0.5;
	t_1 = -x / (sin(B) / cos(B));
	t_2 = (1.0 / sin(B)) - (x / B);
	tmp = 0.0;
	if (F <= -215000000.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -2.3e-204)
		tmp = (t_0 * (F / B)) - (x / B);
	elseif (F <= 2.95e-55)
		tmp = t_1;
	elseif (F <= 0.0013)
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	elseif (F <= 2.4e+44)
		tmp = t_2;
	elseif (F <= 1.22e+200)
		tmp = (1.0 / B) - (x / tan(B));
	elseif (F <= 8.5e+290)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -215000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.3e-204], N[(N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.95e-55], t$95$1, If[LessEqual[F, 0.0013], N[(N[(t$95$0 * N[(N[(F / B), $MachinePrecision] + N[(0.16666666666666666 * N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.4e+44], t$95$2, If[LessEqual[F, 1.22e+200], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.5e+290], t$95$2, t$95$1]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
t_1 := \frac{-x}{\frac{\sin B}{\cos B}}\\
t_2 := \frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{if}\;F \leq -215000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -2.3 \cdot 10^{-204}:\\
\;\;\;\;t_0 \cdot \frac{F}{B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.95 \cdot 10^{-55}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq 0.0013:\\
\;\;\;\;t_0 \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.4 \cdot 10^{+44}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -2.15e8

    1. Initial program 52.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. Simplified70.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/70.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity70.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative70.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow270.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef70.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 80.5%

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

    if -2.15e8 < F < -2.2999999999999999e-204

    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. Add Preprocessing
    3. Taylor expanded in B around 0 86.4%

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

      \[\leadsto \left(-\frac{x}{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 -2.2999999999999999e-204 < F < 2.9499999999999999e-55 or 8.50000000000000061e290 < F

    1. Initial program 97.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. Add Preprocessing
    3. Taylor expanded in F around -inf 33.1%

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      3. distribute-neg-frac77.6%

        \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    6. Simplified77.6%

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

    if 2.9499999999999999e-55 < F < 0.0012999999999999999

    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. Add Preprocessing
    3. Taylor expanded in B around 0 89.5%

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

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

    if 0.0012999999999999999 < F < 2.40000000000000013e44 or 1.22000000000000007e200 < F < 8.50000000000000061e290

    1. Initial program 40.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. Add Preprocessing
    3. Taylor expanded in B around 0 25.0%

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

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

    if 2.40000000000000013e44 < F < 1.22000000000000007e200

    1. Initial program 75.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. Simplified91.7%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*99.6%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified99.6%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 86.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -215000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.3 \cdot 10^{-204}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.95 \cdot 10^{-55}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 0.0013:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{+44}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.22 \cdot 10^{+200}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 77.3% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\ t_1 := \frac{x}{\tan B}\\ t_2 := \frac{-x}{\frac{\sin B}{\cos B}}\\ t_3 := \frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{if}\;F \leq -215000000:\\ \;\;\;\;\frac{-1}{\sin B} - t_1\\ \mathbf{elif}\;F \leq -2.3 \cdot 10^{-204}:\\ \;\;\;\;t_0 \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-55}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 0.0013:\\ \;\;\;\;t_0 \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{+44}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{+200}:\\ \;\;\;\;\frac{1}{B} - t_1\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
        (t_1 (/ x (tan B)))
        (t_2 (/ (- x) (/ (sin B) (cos B))))
        (t_3 (- (/ 1.0 (sin B)) (/ x B))))
   (if (<= F -215000000.0)
     (- (/ -1.0 (sin B)) t_1)
     (if (<= F -2.3e-204)
       (- (* t_0 (/ F B)) (/ x B))
       (if (<= F 1.05e-55)
         t_2
         (if (<= F 0.0013)
           (- (* t_0 (+ (/ F B) (* 0.16666666666666666 (* F B)))) (/ x B))
           (if (<= F 1.6e+44)
             t_3
             (if (<= F 6.8e+200)
               (- (/ 1.0 B) t_1)
               (if (<= F 8.5e+290) t_3 t_2)))))))))
double code(double F, double B, double x) {
	double t_0 = pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
	double t_1 = x / tan(B);
	double t_2 = -x / (sin(B) / cos(B));
	double t_3 = (1.0 / sin(B)) - (x / B);
	double tmp;
	if (F <= -215000000.0) {
		tmp = (-1.0 / sin(B)) - t_1;
	} else if (F <= -2.3e-204) {
		tmp = (t_0 * (F / B)) - (x / B);
	} else if (F <= 1.05e-55) {
		tmp = t_2;
	} else if (F <= 0.0013) {
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	} else if (F <= 1.6e+44) {
		tmp = t_3;
	} else if (F <= 6.8e+200) {
		tmp = (1.0 / B) - t_1;
	} else if (F <= 8.5e+290) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
    t_1 = x / tan(b)
    t_2 = -x / (sin(b) / cos(b))
    t_3 = (1.0d0 / sin(b)) - (x / b)
    if (f <= (-215000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_1
    else if (f <= (-2.3d-204)) then
        tmp = (t_0 * (f / b)) - (x / b)
    else if (f <= 1.05d-55) then
        tmp = t_2
    else if (f <= 0.0013d0) then
        tmp = (t_0 * ((f / b) + (0.16666666666666666d0 * (f * b)))) - (x / b)
    else if (f <= 1.6d+44) then
        tmp = t_3
    else if (f <= 6.8d+200) then
        tmp = (1.0d0 / b) - t_1
    else if (f <= 8.5d+290) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
	double t_1 = x / Math.tan(B);
	double t_2 = -x / (Math.sin(B) / Math.cos(B));
	double t_3 = (1.0 / Math.sin(B)) - (x / B);
	double tmp;
	if (F <= -215000000.0) {
		tmp = (-1.0 / Math.sin(B)) - t_1;
	} else if (F <= -2.3e-204) {
		tmp = (t_0 * (F / B)) - (x / B);
	} else if (F <= 1.05e-55) {
		tmp = t_2;
	} else if (F <= 0.0013) {
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	} else if (F <= 1.6e+44) {
		tmp = t_3;
	} else if (F <= 6.8e+200) {
		tmp = (1.0 / B) - t_1;
	} else if (F <= 8.5e+290) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)
	t_1 = x / math.tan(B)
	t_2 = -x / (math.sin(B) / math.cos(B))
	t_3 = (1.0 / math.sin(B)) - (x / B)
	tmp = 0
	if F <= -215000000.0:
		tmp = (-1.0 / math.sin(B)) - t_1
	elif F <= -2.3e-204:
		tmp = (t_0 * (F / B)) - (x / B)
	elif F <= 1.05e-55:
		tmp = t_2
	elif F <= 0.0013:
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B)
	elif F <= 1.6e+44:
		tmp = t_3
	elif F <= 6.8e+200:
		tmp = (1.0 / B) - t_1
	elif F <= 8.5e+290:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5
	t_1 = Float64(x / tan(B))
	t_2 = Float64(Float64(-x) / Float64(sin(B) / cos(B)))
	t_3 = Float64(Float64(1.0 / sin(B)) - Float64(x / B))
	tmp = 0.0
	if (F <= -215000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_1);
	elseif (F <= -2.3e-204)
		tmp = Float64(Float64(t_0 * Float64(F / B)) - Float64(x / B));
	elseif (F <= 1.05e-55)
		tmp = t_2;
	elseif (F <= 0.0013)
		tmp = Float64(Float64(t_0 * Float64(Float64(F / B) + Float64(0.16666666666666666 * Float64(F * B)))) - Float64(x / B));
	elseif (F <= 1.6e+44)
		tmp = t_3;
	elseif (F <= 6.8e+200)
		tmp = Float64(Float64(1.0 / B) - t_1);
	elseif (F <= 8.5e+290)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = ((2.0 + (F * F)) + (x * 2.0)) ^ -0.5;
	t_1 = x / tan(B);
	t_2 = -x / (sin(B) / cos(B));
	t_3 = (1.0 / sin(B)) - (x / B);
	tmp = 0.0;
	if (F <= -215000000.0)
		tmp = (-1.0 / sin(B)) - t_1;
	elseif (F <= -2.3e-204)
		tmp = (t_0 * (F / B)) - (x / B);
	elseif (F <= 1.05e-55)
		tmp = t_2;
	elseif (F <= 0.0013)
		tmp = (t_0 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	elseif (F <= 1.6e+44)
		tmp = t_3;
	elseif (F <= 6.8e+200)
		tmp = (1.0 / B) - t_1;
	elseif (F <= 8.5e+290)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -215000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -2.3e-204], N[(N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.05e-55], t$95$2, If[LessEqual[F, 0.0013], N[(N[(t$95$0 * N[(N[(F / B), $MachinePrecision] + N[(0.16666666666666666 * N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.6e+44], t$95$3, If[LessEqual[F, 6.8e+200], N[(N[(1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 8.5e+290], t$95$3, t$95$2]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
t_1 := \frac{x}{\tan B}\\
t_2 := \frac{-x}{\frac{\sin B}{\cos B}}\\
t_3 := \frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{if}\;F \leq -215000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_1\\

\mathbf{elif}\;F \leq -2.3 \cdot 10^{-204}:\\
\;\;\;\;t_0 \cdot \frac{F}{B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.05 \cdot 10^{-55}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 0.0013:\\
\;\;\;\;t_0 \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.6 \cdot 10^{+44}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;F \leq 6.8 \cdot 10^{+200}:\\
\;\;\;\;\frac{1}{B} - t_1\\

\mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -2.15e8

    1. Initial program 52.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. Simplified70.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/70.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity70.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative70.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow270.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef70.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 99.8%

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

    if -2.15e8 < F < -2.2999999999999999e-204

    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. Add Preprocessing
    3. Taylor expanded in B around 0 86.4%

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

      \[\leadsto \left(-\frac{x}{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 -2.2999999999999999e-204 < F < 1.0500000000000001e-55 or 8.50000000000000061e290 < F

    1. Initial program 97.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. Add Preprocessing
    3. Taylor expanded in F around -inf 33.1%

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      3. distribute-neg-frac77.6%

        \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    6. Simplified77.6%

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

    if 1.0500000000000001e-55 < F < 0.0012999999999999999

    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. Add Preprocessing
    3. Taylor expanded in B around 0 89.5%

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

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

    if 0.0012999999999999999 < F < 1.60000000000000002e44 or 6.79999999999999939e200 < F < 8.50000000000000061e290

    1. Initial program 40.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. Add Preprocessing
    3. Taylor expanded in B around 0 25.0%

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

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

    if 1.60000000000000002e44 < F < 6.79999999999999939e200

    1. Initial program 75.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. Simplified91.7%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*99.6%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified99.6%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 86.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -215000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.3 \cdot 10^{-204}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-55}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 0.0013:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{+44}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{+200}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 89.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.5 \cdot 10^{+26}:\\
\;\;\;\;\frac{-1}{\sin B} - t_1\\

\mathbf{elif}\;F \leq -5.8 \cdot 10^{-217}:\\
\;\;\;\;t_0 - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.2 \cdot 10^{-136}:\\
\;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - t_1\\

\mathbf{elif}\;F \leq 0.0013:\\
\;\;\;\;t_0 + x \cdot \frac{-1}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t_1\\


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

    1. Initial program 51.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. Simplified69.8%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/69.8%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity69.8%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative69.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow269.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef69.8%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 99.8%

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

    if -3.4999999999999999e26 < F < -5.79999999999999963e-217

    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. Add Preprocessing
    3. Taylor expanded in B around 0 86.2%

      \[\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 -5.79999999999999963e-217 < F < 1.1999999999999999e-136

    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. Simplified99.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow299.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef99.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/99.7%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around -inf 85.4%

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. mul-1-neg85.4%

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    11. Simplified85.4%

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

    if 1.1999999999999999e-136 < F < 0.0012999999999999999

    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. Add Preprocessing
    3. Taylor expanded in B around 0 90.3%

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

    if 0.0012999999999999999 < F

    1. Initial program 59.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. Simplified78.7%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/78.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity78.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow278.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef78.7%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/78.8%

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

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

        \[\leadsto \frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B} \]
      4. un-div-inv78.9%

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr78.9%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.5 \cdot 10^{+26}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -5.8 \cdot 10^{-217}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-136}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.0013:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 89.2% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
t_2 := \frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - t_1\\
\mathbf{if}\;F \leq -3.2 \cdot 10^{-12}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq -1.7 \cdot 10^{-217}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 2.3 \cdot 10^{-137}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 0.0013:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -3.2000000000000001e-12 or -1.70000000000000008e-217 < F < 2.30000000000000008e-137

    1. Initial program 68.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. Simplified80.1%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/80.1%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity80.1%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative80.1%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow280.1%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef80.1%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/80.2%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr80.2%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around -inf 94.7%

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. mul-1-neg94.7%

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    11. Simplified94.7%

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

    if -3.2000000000000001e-12 < F < -1.70000000000000008e-217 or 2.30000000000000008e-137 < F < 0.0012999999999999999

    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. Add Preprocessing
    3. Taylor expanded in B around 0 87.7%

      \[\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)} \]
    4. Taylor expanded in F around 0 87.7%

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

    if 0.0012999999999999999 < F

    1. Initial program 59.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. Simplified78.7%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/78.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity78.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow278.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef78.7%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/78.8%

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

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

        \[\leadsto \frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B} \]
      4. un-div-inv78.9%

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr78.9%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{-12}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.7 \cdot 10^{-217}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-137}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.0013:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 89.2% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;F \leq 1.7 \cdot 10^{-137}:\\
\;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - t_1\\

\mathbf{elif}\;F \leq 0.0013:\\
\;\;\;\;t_0 \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t_1\\


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

    1. Initial program 51.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. Simplified69.8%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/69.8%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity69.8%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative69.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow269.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef69.8%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 99.8%

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

    if -3.4999999999999999e26 < F < -4.59999999999999989e-218

    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. Add Preprocessing
    3. Taylor expanded in B around 0 86.2%

      \[\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 -4.59999999999999989e-218 < F < 1.70000000000000007e-137

    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. Simplified99.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow299.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef99.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/99.7%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around -inf 85.4%

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. mul-1-neg85.4%

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    11. Simplified85.4%

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

    if 1.70000000000000007e-137 < F < 0.0012999999999999999

    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. Add Preprocessing
    3. Taylor expanded in B around 0 90.2%

      \[\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)} \]
    4. Taylor expanded in F around 0 90.2%

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

    if 0.0012999999999999999 < F

    1. Initial program 59.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. Simplified78.7%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/78.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity78.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow278.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef78.7%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/78.8%

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

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

        \[\leadsto \frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B} \]
      4. un-div-inv78.9%

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr78.9%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.5 \cdot 10^{+26}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.6 \cdot 10^{-218}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-137}:\\ \;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.0013:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 84.4% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 52.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. Simplified70.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/70.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity70.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative70.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow270.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef70.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 99.8%

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

    if -2.15e8 < F < -2.2999999999999999e-204

    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. Add Preprocessing
    3. Taylor expanded in B around 0 86.4%

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

      \[\leadsto \left(-\frac{x}{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 -2.2999999999999999e-204 < F

    1. Initial program 77.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. Simplified88.1%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/88.1%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity88.1%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative88.1%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow288.1%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef88.1%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/88.2%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr88.2%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around inf 86.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -215000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.3 \cdot 10^{-204}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 84.6% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 55.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. Simplified72.3%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/72.3%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity72.3%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative72.3%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow272.3%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef72.3%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/72.3%

        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
      2. sqrt-div72.3%

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

        \[\leadsto \frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B} \]
      4. un-div-inv72.3%

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr72.3%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around -inf 97.6%

      \[\leadsto \frac{\frac{F}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. mul-1-neg97.6%

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    11. Simplified97.6%

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

    if -1.5500000000000001e-12 < F < -2.2999999999999999e-204

    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. Add Preprocessing
    3. Taylor expanded in B around 0 87.2%

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

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

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    6. Step-by-step derivation
      1. *-commutative66.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}} \]
    7. Simplified66.9%

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

    if -2.2999999999999999e-204 < F

    1. Initial program 77.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. Simplified88.1%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/88.1%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity88.1%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative88.1%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow288.1%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef88.1%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r/88.2%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    8. Applied egg-rr88.2%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in F around inf 86.6%

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

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

Alternative 12: 84.1% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;F \leq 1.1 \cdot 10^{-27}:\\
\;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -2.15e8

    1. Initial program 52.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. Simplified70.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/70.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity70.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative70.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow270.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef70.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 99.8%

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

    if -2.15e8 < F < -4.49999999999999956e-205

    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. Add Preprocessing
    3. Taylor expanded in B around 0 86.4%

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

      \[\leadsto \left(-\frac{x}{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 -4.49999999999999956e-205 < F < 1.09999999999999993e-27

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 29.1%

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      3. distribute-neg-frac75.9%

        \[\leadsto \color{blue}{\frac{-x}{\frac{\sin B}{\cos B}}} \]
    6. Simplified75.9%

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

    if 1.09999999999999993e-27 < F

    1. Initial program 62.0%

      \[\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. Simplified80.0%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*93.8%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified93.8%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around 0 93.9%

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. div-sub93.9%

        \[\leadsto \color{blue}{\frac{1 - x \cdot \cos B}{\sin B}} \]
    9. Simplified93.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -215000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.5 \cdot 10^{-205}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-27}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 63.1% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\ t_2 := \frac{-1}{B} - t_0\\ \mathbf{if}\;F \leq -215000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.5 \cdot 10^{-225}:\\ \;\;\;\;t_1 \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-93}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 0.00125:\\ \;\;\;\;t_1 \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{+200}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B)))
        (t_1 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
        (t_2 (- (/ -1.0 B) t_0)))
   (if (<= F -215000000.0)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -5.5e-225)
       (- (* t_1 (/ F B)) (/ x B))
       (if (<= F 1.6e-93)
         t_2
         (if (<= F 0.00125)
           (- (* t_1 (+ (/ F B) (* 0.16666666666666666 (* F B)))) (/ x B))
           (if (<= F 2.1e+200)
             (- (/ 1.0 B) t_0)
             (if (<= F 8.5e+290) (- (/ 1.0 (sin B)) (/ x B)) t_2))))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double t_1 = pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
	double t_2 = (-1.0 / B) - t_0;
	double tmp;
	if (F <= -215000000.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -5.5e-225) {
		tmp = (t_1 * (F / B)) - (x / B);
	} else if (F <= 1.6e-93) {
		tmp = t_2;
	} else if (F <= 0.00125) {
		tmp = (t_1 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	} else if (F <= 2.1e+200) {
		tmp = (1.0 / B) - t_0;
	} else if (F <= 8.5e+290) {
		tmp = (1.0 / sin(B)) - (x / B);
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = x / tan(b)
    t_1 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
    t_2 = ((-1.0d0) / b) - t_0
    if (f <= (-215000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-5.5d-225)) then
        tmp = (t_1 * (f / b)) - (x / b)
    else if (f <= 1.6d-93) then
        tmp = t_2
    else if (f <= 0.00125d0) then
        tmp = (t_1 * ((f / b) + (0.16666666666666666d0 * (f * b)))) - (x / b)
    else if (f <= 2.1d+200) then
        tmp = (1.0d0 / b) - t_0
    else if (f <= 8.5d+290) then
        tmp = (1.0d0 / sin(b)) - (x / b)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double t_1 = Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
	double t_2 = (-1.0 / B) - t_0;
	double tmp;
	if (F <= -215000000.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -5.5e-225) {
		tmp = (t_1 * (F / B)) - (x / B);
	} else if (F <= 1.6e-93) {
		tmp = t_2;
	} else if (F <= 0.00125) {
		tmp = (t_1 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	} else if (F <= 2.1e+200) {
		tmp = (1.0 / B) - t_0;
	} else if (F <= 8.5e+290) {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	t_1 = math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)
	t_2 = (-1.0 / B) - t_0
	tmp = 0
	if F <= -215000000.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -5.5e-225:
		tmp = (t_1 * (F / B)) - (x / B)
	elif F <= 1.6e-93:
		tmp = t_2
	elif F <= 0.00125:
		tmp = (t_1 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B)
	elif F <= 2.1e+200:
		tmp = (1.0 / B) - t_0
	elif F <= 8.5e+290:
		tmp = (1.0 / math.sin(B)) - (x / B)
	else:
		tmp = t_2
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	t_1 = Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5
	t_2 = Float64(Float64(-1.0 / B) - t_0)
	tmp = 0.0
	if (F <= -215000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -5.5e-225)
		tmp = Float64(Float64(t_1 * Float64(F / B)) - Float64(x / B));
	elseif (F <= 1.6e-93)
		tmp = t_2;
	elseif (F <= 0.00125)
		tmp = Float64(Float64(t_1 * Float64(Float64(F / B) + Float64(0.16666666666666666 * Float64(F * B)))) - Float64(x / B));
	elseif (F <= 2.1e+200)
		tmp = Float64(Float64(1.0 / B) - t_0);
	elseif (F <= 8.5e+290)
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	t_1 = ((2.0 + (F * F)) + (x * 2.0)) ^ -0.5;
	t_2 = (-1.0 / B) - t_0;
	tmp = 0.0;
	if (F <= -215000000.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -5.5e-225)
		tmp = (t_1 * (F / B)) - (x / B);
	elseif (F <= 1.6e-93)
		tmp = t_2;
	elseif (F <= 0.00125)
		tmp = (t_1 * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
	elseif (F <= 2.1e+200)
		tmp = (1.0 / B) - t_0;
	elseif (F <= 8.5e+290)
		tmp = (1.0 / sin(B)) - (x / B);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$2 = N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[F, -215000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.5e-225], N[(N[(t$95$1 * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.6e-93], t$95$2, If[LessEqual[F, 0.00125], N[(N[(t$95$1 * N[(N[(F / B), $MachinePrecision] + N[(0.16666666666666666 * N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.1e+200], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 8.5e+290], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
t_2 := \frac{-1}{B} - t_0\\
\mathbf{if}\;F \leq -215000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -5.5 \cdot 10^{-225}:\\
\;\;\;\;t_1 \cdot \frac{F}{B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.6 \cdot 10^{-93}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 0.00125:\\
\;\;\;\;t_1 \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.1 \cdot 10^{+200}:\\
\;\;\;\;\frac{1}{B} - t_0\\

\mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -2.15e8

    1. Initial program 52.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. Simplified70.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/70.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity70.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative70.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow270.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef70.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 80.5%

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

    if -2.15e8 < F < -5.5000000000000002e-225

    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. Add Preprocessing
    3. Taylor expanded in B around 0 86.0%

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

      \[\leadsto \left(-\frac{x}{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 -5.5000000000000002e-225 < F < 1.5999999999999999e-93 or 8.50000000000000061e290 < F

    1. Initial program 97.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. Simplified99.5%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.5%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.5%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow299.5%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef99.5%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 36.0%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 55.7%

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

    if 1.5999999999999999e-93 < F < 0.00125000000000000003

    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. Add Preprocessing
    3. Taylor expanded in B around 0 92.4%

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

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

    if 0.00125000000000000003 < F < 2.09999999999999997e200

    1. Initial program 79.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. Simplified93.1%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*99.6%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified99.6%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 82.4%

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

    if 2.09999999999999997e200 < F < 8.50000000000000061e290

    1. Initial program 21.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. Add Preprocessing
    3. Taylor expanded in B around 0 8.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -215000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.5 \cdot 10^{-225}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-93}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.00125:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{+200}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 63.3% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ t_1 := \frac{x}{\tan B}\\ t_2 := \frac{-1}{B} - t_1\\ \mathbf{if}\;F \leq -0.22:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.15 \cdot 10^{-227}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-137}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{-6}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{+201}:\\ \;\;\;\;\frac{1}{B} - t_1\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F B)) (/ x B)))
        (t_1 (/ x (tan B)))
        (t_2 (- (/ -1.0 B) t_1)))
   (if (<= F -0.22)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -1.15e-227)
       t_0
       (if (<= F 1.3e-137)
         t_2
         (if (<= F 6.8e-6)
           t_0
           (if (<= F 4.5e+201)
             (- (/ 1.0 B) t_1)
             (if (<= F 8.5e+290) (- (/ 1.0 (sin B)) (/ x B)) t_2))))))))
double code(double F, double B, double x) {
	double t_0 = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B);
	double t_1 = x / tan(B);
	double t_2 = (-1.0 / B) - t_1;
	double tmp;
	if (F <= -0.22) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -1.15e-227) {
		tmp = t_0;
	} else if (F <= 1.3e-137) {
		tmp = t_2;
	} else if (F <= 6.8e-6) {
		tmp = t_0;
	} else if (F <= 4.5e+201) {
		tmp = (1.0 / B) - t_1;
	} else if (F <= 8.5e+290) {
		tmp = (1.0 / sin(B)) - (x / B);
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / b)) - (x / b)
    t_1 = x / tan(b)
    t_2 = ((-1.0d0) / b) - t_1
    if (f <= (-0.22d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-1.15d-227)) then
        tmp = t_0
    else if (f <= 1.3d-137) then
        tmp = t_2
    else if (f <= 6.8d-6) then
        tmp = t_0
    else if (f <= 4.5d+201) then
        tmp = (1.0d0 / b) - t_1
    else if (f <= 8.5d+290) then
        tmp = (1.0d0 / sin(b)) - (x / b)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B);
	double t_1 = x / Math.tan(B);
	double t_2 = (-1.0 / B) - t_1;
	double tmp;
	if (F <= -0.22) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -1.15e-227) {
		tmp = t_0;
	} else if (F <= 1.3e-137) {
		tmp = t_2;
	} else if (F <= 6.8e-6) {
		tmp = t_0;
	} else if (F <= 4.5e+201) {
		tmp = (1.0 / B) - t_1;
	} else if (F <= 8.5e+290) {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B)
	t_1 = x / math.tan(B)
	t_2 = (-1.0 / B) - t_1
	tmp = 0
	if F <= -0.22:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -1.15e-227:
		tmp = t_0
	elif F <= 1.3e-137:
		tmp = t_2
	elif F <= 6.8e-6:
		tmp = t_0
	elif F <= 4.5e+201:
		tmp = (1.0 / B) - t_1
	elif F <= 8.5e+290:
		tmp = (1.0 / math.sin(B)) - (x / B)
	else:
		tmp = t_2
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / B)) - Float64(x / B))
	t_1 = Float64(x / tan(B))
	t_2 = Float64(Float64(-1.0 / B) - t_1)
	tmp = 0.0
	if (F <= -0.22)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -1.15e-227)
		tmp = t_0;
	elseif (F <= 1.3e-137)
		tmp = t_2;
	elseif (F <= 6.8e-6)
		tmp = t_0;
	elseif (F <= 4.5e+201)
		tmp = Float64(Float64(1.0 / B) - t_1);
	elseif (F <= 8.5e+290)
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B);
	t_1 = x / tan(B);
	t_2 = (-1.0 / B) - t_1;
	tmp = 0.0;
	if (F <= -0.22)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -1.15e-227)
		tmp = t_0;
	elseif (F <= 1.3e-137)
		tmp = t_2;
	elseif (F <= 6.8e-6)
		tmp = t_0;
	elseif (F <= 4.5e+201)
		tmp = (1.0 / B) - t_1;
	elseif (F <= 8.5e+290)
		tmp = (1.0 / sin(B)) - (x / B);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[F, -0.22], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.15e-227], t$95$0, If[LessEqual[F, 1.3e-137], t$95$2, If[LessEqual[F, 6.8e-6], t$95$0, If[LessEqual[F, 4.5e+201], N[(N[(1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 8.5e+290], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
t_2 := \frac{-1}{B} - t_1\\
\mathbf{if}\;F \leq -0.22:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -1.15 \cdot 10^{-227}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 1.3 \cdot 10^{-137}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 6.8 \cdot 10^{-6}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 4.5 \cdot 10^{+201}:\\
\;\;\;\;\frac{1}{B} - t_1\\

\mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


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

    1. Initial program 54.0%

      \[\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. Simplified71.3%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/71.3%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity71.3%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative71.3%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow271.3%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef71.3%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 99.3%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 80.4%

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

    if -0.220000000000000001 < F < -1.15000000000000006e-227 or 1.3e-137 < F < 6.80000000000000012e-6

    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. Add Preprocessing
    3. Taylor expanded in B around 0 86.9%

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

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

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    6. Step-by-step derivation
      1. *-commutative64.0%

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}} \]
    7. Simplified64.0%

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

    if -1.15000000000000006e-227 < F < 1.3e-137 or 8.50000000000000061e290 < F

    1. Initial program 96.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. Simplified99.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow299.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef99.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 34.6%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 57.7%

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

    if 6.80000000000000012e-6 < F < 4.5000000000000001e201

    1. Initial program 79.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. Simplified93.1%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*99.6%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified99.6%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 82.4%

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

    if 4.5000000000000001e201 < F < 8.50000000000000061e290

    1. Initial program 21.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. Add Preprocessing
    3. Taylor expanded in B around 0 8.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.22:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.15 \cdot 10^{-227}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-137}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{-6}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{+201}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 63.4% accurate, 2.4× speedup?

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

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

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

\mathbf{elif}\;F \leq 4.2 \cdot 10^{-137}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;F \leq 1.15 \cdot 10^{+204}:\\
\;\;\;\;\frac{1}{B} - t_0\\

\mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -2.15e8

    1. Initial program 52.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. Simplified70.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/70.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity70.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative70.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow270.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef70.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 80.5%

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

    if -2.15e8 < F < -8.19999999999999995e-228

    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. Add Preprocessing
    3. Taylor expanded in B around 0 86.0%

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

      \[\leadsto \left(-\frac{x}{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 -8.19999999999999995e-228 < F < 4.19999999999999983e-137 or 8.50000000000000061e290 < F

    1. Initial program 96.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. Simplified99.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow299.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef99.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 34.6%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 57.7%

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

    if 4.19999999999999983e-137 < F < 6.20000000000000027e-5

    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. Add Preprocessing
    3. Taylor expanded in B around 0 90.2%

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}} \]
    7. Simplified67.6%

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

    if 6.20000000000000027e-5 < F < 1.14999999999999995e204

    1. Initial program 79.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. Simplified93.1%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*99.6%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified99.6%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 82.4%

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

    if 1.14999999999999995e204 < F < 8.50000000000000061e290

    1. Initial program 21.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. Add Preprocessing
    3. Taylor expanded in B around 0 8.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -215000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -8.2 \cdot 10^{-228}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-137}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-5}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{+204}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+290}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 57.0% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{-113} \lor \neg \left(x \leq 1.08 \cdot 10^{-99}\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -4.6e-113) (not (<= x 1.08e-99)))
   (- (/ -1.0 B) (/ x (tan B)))
   (- (/ -1.0 (sin B)) (/ x B))))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -4.6e-113) || !(x <= 1.08e-99)) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else {
		tmp = (-1.0 / sin(B)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-4.6d-113)) .or. (.not. (x <= 1.08d-99))) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -4.6e-113) || !(x <= 1.08e-99)) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -4.6e-113) or not (x <= 1.08e-99):
		tmp = (-1.0 / B) - (x / math.tan(B))
	else:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -4.6e-113) || !(x <= 1.08e-99))
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	else
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -4.6e-113) || ~((x <= 1.08e-99)))
		tmp = (-1.0 / B) - (x / tan(B));
	else
		tmp = (-1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -4.6e-113], N[Not[LessEqual[x, 1.08e-99]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{-113} \lor \neg \left(x \leq 1.08 \cdot 10^{-99}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.60000000000000016e-113 or 1.08000000000000006e-99 < x

    1. Initial program 76.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. Simplified92.5%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/92.5%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity92.5%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative92.5%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow292.5%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef92.5%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 74.2%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 78.2%

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

    if -4.60000000000000016e-113 < x < 1.08000000000000006e-99

    1. Initial program 68.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. Simplified71.0%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/71.0%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity71.0%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative71.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow271.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef71.0%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 34.3%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 34.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{-113} \lor \neg \left(x \leq 1.08 \cdot 10^{-99}\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 56.8% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{-135}:\\
\;\;\;\;\frac{1}{B} - t_0\\

\mathbf{elif}\;x \leq 1.35 \cdot 10^{-100}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.1999999999999999e-135

    1. Initial program 64.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. Simplified90.0%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*76.1%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified76.1%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 75.5%

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

    if -1.1999999999999999e-135 < x < 1.35000000000000008e-100

    1. Initial program 70.0%

      \[\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. Simplified72.2%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/72.2%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity72.2%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative72.2%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow272.2%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef72.2%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 34.3%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 34.3%

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

    if 1.35000000000000008e-100 < x

    1. Initial program 83.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. Simplified92.6%

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/92.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity92.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative92.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow292.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-udef92.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in F around -inf 76.9%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 82.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{-135}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-100}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 53.8% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} - \frac{x}{\tan B} \end{array} \]
(FPCore (F B x) :precision binary64 (- (/ -1.0 B) (/ x (tan B))))
double code(double F, double B, double x) {
	return (-1.0 / B) - (x / tan(B));
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = ((-1.0d0) / b) - (x / tan(b))
end function
public static double code(double F, double B, double x) {
	return (-1.0 / B) - (x / Math.tan(B));
}
def code(F, B, x):
	return (-1.0 / B) - (x / math.tan(B))
function code(F, B, x)
	return Float64(Float64(-1.0 / B) - Float64(x / tan(B)))
end
function tmp = code(F, B, x)
	tmp = (-1.0 / B) - (x / tan(B));
end
code[F_, B_, x_] := N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B} - \frac{x}{\tan B}
\end{array}
Derivation
  1. Initial program 73.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. Simplified84.6%

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

    \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
  5. Step-by-step derivation
    1. associate-*l/84.6%

      \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
    2. *-lft-identity84.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
    3. +-commutative84.6%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
    4. unpow284.6%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
    5. fma-udef84.6%

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

    \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
  7. Taylor expanded in F around -inf 59.4%

    \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
  8. Taylor expanded in B around 0 56.6%

    \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]
  9. Final simplification56.6%

    \[\leadsto \frac{-1}{B} - \frac{x}{\tan B} \]
  10. Add Preprocessing

Alternative 19: 43.9% accurate, 12.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.8 \cdot 10^{-124}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{-1 - x}{B}\\

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

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


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

    1. Initial program 64.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. Add Preprocessing
    3. Taylor expanded in F around -inf 86.2%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)} \]
    6. Step-by-step derivation
      1. +-commutative53.0%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) + -1 \cdot \frac{1 + x}{B}} \]
      2. mul-1-neg53.0%

        \[\leadsto 0.3333333333333333 \cdot \left(B \cdot x\right) + \color{blue}{\left(-\frac{1 + x}{B}\right)} \]
      3. unsub-neg53.0%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{1 + x}{B}} \]
    7. Simplified53.0%

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

    if -7.79999999999999986e-124 < F < 2.1999999999999999e-23

    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. Simplified99.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*16.4%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified16.4%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 19.9%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Taylor expanded in x around inf 45.8%

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

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

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

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

    if 2.1999999999999999e-23 < F

    1. Initial program 61.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. Simplified79.8%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*94.9%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified94.9%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 50.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.8 \cdot 10^{-124}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{-23}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right)\right) - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 31.6% accurate, 13.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{-81} \lor \neg \left(x \leq 5.8 \cdot 10^{-169} \lor \neg \left(x \leq 6.6 \cdot 10^{-64}\right) \land x \leq 7.6 \cdot 10^{-22}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -3e-81)
         (not (or (<= x 5.8e-169) (and (not (<= x 6.6e-64)) (<= x 7.6e-22)))))
   (/ (- x) B)
   (/ -1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -3e-81) || !((x <= 5.8e-169) || (!(x <= 6.6e-64) && (x <= 7.6e-22)))) {
		tmp = -x / B;
	} else {
		tmp = -1.0 / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-3d-81)) .or. (.not. (x <= 5.8d-169) .or. (.not. (x <= 6.6d-64)) .and. (x <= 7.6d-22))) then
        tmp = -x / b
    else
        tmp = (-1.0d0) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -3e-81) || !((x <= 5.8e-169) || (!(x <= 6.6e-64) && (x <= 7.6e-22)))) {
		tmp = -x / B;
	} else {
		tmp = -1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -3e-81) or not ((x <= 5.8e-169) or (not (x <= 6.6e-64) and (x <= 7.6e-22))):
		tmp = -x / B
	else:
		tmp = -1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -3e-81) || !((x <= 5.8e-169) || (!(x <= 6.6e-64) && (x <= 7.6e-22))))
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(-1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -3e-81) || ~(((x <= 5.8e-169) || (~((x <= 6.6e-64)) && (x <= 7.6e-22)))))
		tmp = -x / B;
	else
		tmp = -1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -3e-81], N[Not[Or[LessEqual[x, 5.8e-169], And[N[Not[LessEqual[x, 6.6e-64]], $MachinePrecision], LessEqual[x, 7.6e-22]]]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{-81} \lor \neg \left(x \leq 5.8 \cdot 10^{-169} \lor \neg \left(x \leq 6.6 \cdot 10^{-64}\right) \land x \leq 7.6 \cdot 10^{-22}\right):\\
\;\;\;\;\frac{-x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.9999999999999999e-81 or 5.80000000000000038e-169 < x < 6.5999999999999999e-64 or 7.60000000000000046e-22 < x

    1. Initial program 77.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. Simplified92.7%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*65.7%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified65.7%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 41.7%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Taylor expanded in x around inf 50.2%

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

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

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

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

    if -2.9999999999999999e-81 < x < 5.80000000000000038e-169 or 6.5999999999999999e-64 < x < 7.60000000000000046e-22

    1. Initial program 66.0%

      \[\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. Add Preprocessing
    3. Taylor expanded in F around -inf 34.3%

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

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

      \[\leadsto \color{blue}{\frac{-1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{-81} \lor \neg \left(x \leq 5.8 \cdot 10^{-169} \lor \neg \left(x \leq 6.6 \cdot 10^{-64}\right) \land x \leq 7.6 \cdot 10^{-22}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 43.9% accurate, 14.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7.8 \cdot 10^{-124}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 8.3 \cdot 10^{-23}:\\ \;\;\;\;\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 -7.8e-124)
   (+ (* 0.3333333333333333 (* B x)) (/ (- -1.0 x) B))
   (if (<= F 8.3e-23)
     (/ (- x) B)
     (+
      (* B (+ 0.16666666666666666 (* x 0.3333333333333333)))
      (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -7.8e-124) {
		tmp = (0.3333333333333333 * (B * x)) + ((-1.0 - x) / B);
	} else if (F <= 8.3e-23) {
		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 <= (-7.8d-124)) then
        tmp = (0.3333333333333333d0 * (b * x)) + (((-1.0d0) - x) / b)
    else if (f <= 8.3d-23) 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 <= -7.8e-124) {
		tmp = (0.3333333333333333 * (B * x)) + ((-1.0 - x) / B);
	} else if (F <= 8.3e-23) {
		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 <= -7.8e-124:
		tmp = (0.3333333333333333 * (B * x)) + ((-1.0 - x) / B)
	elif F <= 8.3e-23:
		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 <= -7.8e-124)
		tmp = Float64(Float64(0.3333333333333333 * Float64(B * x)) + Float64(Float64(-1.0 - x) / B));
	elseif (F <= 8.3e-23)
		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 <= -7.8e-124)
		tmp = (0.3333333333333333 * (B * x)) + ((-1.0 - x) / B);
	elseif (F <= 8.3e-23)
		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, -7.8e-124], N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.3e-23], 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 -7.8 \cdot 10^{-124}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 8.3 \cdot 10^{-23}:\\
\;\;\;\;\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 < -7.79999999999999986e-124

    1. Initial program 64.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. Add Preprocessing
    3. Taylor expanded in F around -inf 86.2%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)} \]
    6. Step-by-step derivation
      1. +-commutative53.0%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) + -1 \cdot \frac{1 + x}{B}} \]
      2. mul-1-neg53.0%

        \[\leadsto 0.3333333333333333 \cdot \left(B \cdot x\right) + \color{blue}{\left(-\frac{1 + x}{B}\right)} \]
      3. unsub-neg53.0%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{1 + x}{B}} \]
    7. Simplified53.0%

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

    if -7.79999999999999986e-124 < F < 8.29999999999999986e-23

    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. Simplified99.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*16.4%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified16.4%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 19.9%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Taylor expanded in x around inf 45.8%

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

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

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

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

    if 8.29999999999999986e-23 < F

    1. Initial program 61.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. Simplified79.8%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*94.9%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified94.9%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 50.0%

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

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

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

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

      \[\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 simplification50.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.8 \cdot 10^{-124}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 8.3 \cdot 10^{-23}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 43.8% accurate, 20.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.8 \cdot 10^{-124}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{-1 - x}{B}\\

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

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


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

    1. Initial program 64.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. Add Preprocessing
    3. Taylor expanded in F around -inf 86.2%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)} \]
    6. Step-by-step derivation
      1. +-commutative53.0%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) + -1 \cdot \frac{1 + x}{B}} \]
      2. mul-1-neg53.0%

        \[\leadsto 0.3333333333333333 \cdot \left(B \cdot x\right) + \color{blue}{\left(-\frac{1 + x}{B}\right)} \]
      3. unsub-neg53.0%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{1 + x}{B}} \]
    7. Simplified53.0%

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

    if -7.79999999999999986e-124 < F < 4.0000000000000002e-26

    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. Simplified99.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*16.4%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified16.4%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 19.9%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Taylor expanded in x around inf 45.8%

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

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

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

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

    if 4.0000000000000002e-26 < F

    1. Initial program 61.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. Simplified79.8%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*94.9%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified94.9%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 49.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.8 \cdot 10^{-124}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 4 \cdot 10^{-26}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 36.8% accurate, 21.6× speedup?

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

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

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

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


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

    1. Initial program 24.0%

      \[\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. Add Preprocessing
    3. Taylor expanded in F around -inf 99.7%

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

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

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

    if -4.9999999999999997e174 < F < 9.20000000000000035e-26

    1. Initial program 93.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. Simplified98.7%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*29.4%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified29.4%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 26.4%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Taylor expanded in x around inf 40.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    9. 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} \]
    10. Simplified40.0%

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

    if 9.20000000000000035e-26 < F

    1. Initial program 61.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. Simplified79.8%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*94.9%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified94.9%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 49.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{+174}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{-26}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 43.7% accurate, 21.6× speedup?

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

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

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

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


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

    1. Initial program 64.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. Add Preprocessing
    3. Taylor expanded in F around -inf 86.2%

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

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

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

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval52.4%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-152.4%

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

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

    if -7.79999999999999986e-124 < F < 1.15000000000000004e-26

    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. Simplified99.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*16.4%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified16.4%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 19.9%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Taylor expanded in x around inf 45.8%

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

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

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

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

    if 1.15000000000000004e-26 < F

    1. Initial program 61.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. Simplified79.8%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*94.9%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified94.9%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 49.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.8 \cdot 10^{-124}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-26}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 16.7% accurate, 40.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.15 \cdot 10^{-57}:\\
\;\;\;\;\frac{-1}{B}\\

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


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

    1. Initial program 77.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. Add Preprocessing
    3. Taylor expanded in F around -inf 63.3%

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

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

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

    if 2.15000000000000011e-57 < F

    1. Initial program 64.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. Simplified81.4%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*89.8%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified89.8%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 46.8%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Taylor expanded in x around 0 20.8%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification19.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 2.15 \cdot 10^{-57}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 10.3% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 73.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. Add Preprocessing
  3. Taylor expanded in F around -inf 59.4%

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

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

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  6. Final simplification13.0%

    \[\leadsto \frac{-1}{B} \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2024018 
(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))))))