VandenBroeck and Keller, Equation (23)

Percentage Accurate: 64.9% → 99.0%
Time: 20.2s
Alternatives: 20
Speedup: 2.8×

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 20 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: 64.9% accurate, 1.0× speedup?

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

\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}

Alternative 1: 99.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.95 \cdot 10^{+102}:\\ \;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 100000000:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\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 -2.95e+102)
     (- (/ -1.0 (sin B)) (* x (/ (cos B) (sin B))))
     (if (<= F 100000000.0)
       (- (/ (/ F (sin B)) (sqrt (fma F F 2.0))) t_0)
       (- (* 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 <= -2.95e+102) {
		tmp = (-1.0 / sin(B)) - (x * (cos(B) / sin(B)));
	} else if (F <= 100000000.0) {
		tmp = ((F / sin(B)) / sqrt(fma(F, F, 2.0))) - t_0;
	} else {
		tmp = (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 <= -2.95e+102)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x * Float64(cos(B) / sin(B))));
	elseif (F <= 100000000.0)
		tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(fma(F, F, 2.0))) - t_0);
	else
		tmp = Float64(Float64(F * Float64(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, -2.95e+102], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

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

\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{F}}{\sin B} - t\_0\\


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

    1. Initial program 33.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 99.6%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x \cdot \cos B}{\sin B}\right)} + \left(-\frac{1}{\sin B}\right) \]
      3. distribute-neg-in99.7%

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

        \[\leadsto -\color{blue}{\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      5. distribute-neg-in99.7%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right) + \left(-\frac{x \cdot \cos B}{\sin B}\right)} \]
      6. distribute-neg-frac99.7%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} + \left(-\frac{x \cdot \cos B}{\sin B}\right) \]
      7. metadata-eval99.7%

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

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

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

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

    if -2.95000000000000003e102 < F < 1e8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e8 < F

    1. Initial program 44.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. Simplified66.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 x around 0 79.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/79.7%

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

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

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

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

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

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

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

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

Alternative 2: 99.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1 \cdot 10^{+148}:\\ \;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 100000000:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\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 -1e+148)
     (- (/ -1.0 (sin B)) (* x (/ (cos B) (sin B))))
     (if (<= F 100000000.0)
       (- (/ F (* (sin B) (sqrt (fma F F 2.0)))) t_0)
       (- (* 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 <= -1e+148) {
		tmp = (-1.0 / sin(B)) - (x * (cos(B) / sin(B)));
	} else if (F <= 100000000.0) {
		tmp = (F / (sin(B) * sqrt(fma(F, F, 2.0)))) - t_0;
	} else {
		tmp = (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 <= -1e+148)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x * Float64(cos(B) / sin(B))));
	elseif (F <= 100000000.0)
		tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, 2.0)))) - t_0);
	else
		tmp = Float64(Float64(F * Float64(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, -1e+148], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\

\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{F}}{\sin B} - t\_0\\


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

    1. Initial program 30.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 99.5%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x \cdot \cos B}{\sin B}\right)} + \left(-\frac{1}{\sin B}\right) \]
      3. distribute-neg-in99.6%

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

        \[\leadsto -\color{blue}{\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      5. distribute-neg-in99.6%

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

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

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

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

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

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

    if -1e148 < F < 1e8

    1. Initial program 75.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. Simplified76.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-undefine99.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. 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. clear-num99.6%

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

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

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

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

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

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

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

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

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

    if 1e8 < F

    1. Initial program 44.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. Simplified66.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 x around 0 79.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/79.7%

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

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

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

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

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

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

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

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

Alternative 3: 99.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -0.88:\\ \;\;\;\;\frac{\frac{F}{\left(-F\right) - \frac{F}{{F}^{2}}}}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2}} - t\_0\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\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.88)
     (- (/ (/ F (- (- F) (/ F (pow F 2.0)))) (sin B)) t_0)
     (if (<= F 7.2e-6)
       (- (/ (/ F (sin B)) (sqrt 2.0)) t_0)
       (- (* 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.88) {
		tmp = ((F / (-F - (F / pow(F, 2.0)))) / sin(B)) - t_0;
	} else if (F <= 7.2e-6) {
		tmp = ((F / sin(B)) / sqrt(2.0)) - t_0;
	} else {
		tmp = (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.88d0)) then
        tmp = ((f / (-f - (f / (f ** 2.0d0)))) / sin(b)) - t_0
    else if (f <= 7.2d-6) then
        tmp = ((f / sin(b)) / sqrt(2.0d0)) - t_0
    else
        tmp = (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.88) {
		tmp = ((F / (-F - (F / Math.pow(F, 2.0)))) / Math.sin(B)) - t_0;
	} else if (F <= 7.2e-6) {
		tmp = ((F / Math.sin(B)) / Math.sqrt(2.0)) - t_0;
	} else {
		tmp = (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.88:
		tmp = ((F / (-F - (F / math.pow(F, 2.0)))) / math.sin(B)) - t_0
	elif F <= 7.2e-6:
		tmp = ((F / math.sin(B)) / math.sqrt(2.0)) - t_0
	else:
		tmp = (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.88)
		tmp = Float64(Float64(Float64(F / Float64(Float64(-F) - Float64(F / (F ^ 2.0)))) / sin(B)) - t_0);
	elseif (F <= 7.2e-6)
		tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(2.0)) - t_0);
	else
		tmp = Float64(Float64(F * Float64(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.88)
		tmp = ((F / (-F - (F / (F ^ 2.0)))) / sin(B)) - t_0;
	elseif (F <= 7.2e-6)
		tmp = ((F / sin(B)) / sqrt(2.0)) - t_0;
	else
		tmp = (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.88], N[(N[(N[(F / N[((-F) - N[(F / N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7.2e-6], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.88:\\
\;\;\;\;\frac{\frac{F}{\left(-F\right) - \frac{F}{{F}^{2}}}}{\sin B} - t\_0\\

\mathbf{elif}\;F \leq 7.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2}} - t\_0\\

\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{F}}{\sin B} - t\_0\\


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

    1. Initial program 47.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. Simplified59.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 68.0%

      \[\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/67.9%

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

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

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

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

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

      \[\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/68.0%

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

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

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

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

      \[\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 98.7%

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

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

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

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

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

        \[\leadsto \frac{\frac{F}{-\left(F + \frac{\color{blue}{F}}{{F}^{2}}\right)}}{\sin B} - \frac{x}{\tan B} \]
    11. Simplified98.7%

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

    if -0.880000000000000004 < F < 7.19999999999999967e-6

    1. Initial program 76.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. Simplified76.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 99.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/99.7%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.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/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. Step-by-step derivation
      1. associate-/l/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.19999999999999967e-6 < F

    1. Initial program 45.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. Simplified66.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 x around 0 80.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/80.6%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified80.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 98.6%

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

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

Alternative 4: 99.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.55:\\ \;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t\_0\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\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.55)
     (- (/ -1.0 (sin B)) (* x (/ (cos B) (sin B))))
     (if (<= F 7.2e-6)
       (- (/ (* F (sqrt 0.5)) (sin B)) t_0)
       (- (* 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.55) {
		tmp = (-1.0 / sin(B)) - (x * (cos(B) / sin(B)));
	} else if (F <= 7.2e-6) {
		tmp = ((F * sqrt(0.5)) / sin(B)) - t_0;
	} else {
		tmp = (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.55d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x * (cos(b) / sin(b)))
    else if (f <= 7.2d-6) then
        tmp = ((f * sqrt(0.5d0)) / sin(b)) - t_0
    else
        tmp = (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.55) {
		tmp = (-1.0 / Math.sin(B)) - (x * (Math.cos(B) / Math.sin(B)));
	} else if (F <= 7.2e-6) {
		tmp = ((F * Math.sqrt(0.5)) / Math.sin(B)) - t_0;
	} else {
		tmp = (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.55:
		tmp = (-1.0 / math.sin(B)) - (x * (math.cos(B) / math.sin(B)))
	elif F <= 7.2e-6:
		tmp = ((F * math.sqrt(0.5)) / math.sin(B)) - t_0
	else:
		tmp = (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.55)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x * Float64(cos(B) / sin(B))));
	elseif (F <= 7.2e-6)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) / sin(B)) - t_0);
	else
		tmp = Float64(Float64(F * Float64(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.55)
		tmp = (-1.0 / sin(B)) - (x * (cos(B) / sin(B)));
	elseif (F <= 7.2e-6)
		tmp = ((F * sqrt(0.5)) / sin(B)) - t_0;
	else
		tmp = (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.55], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.2e-6], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 7.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t\_0\\

\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{F}}{\sin B} - t\_0\\


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

    1. Initial program 47.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 97.8%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x \cdot \cos B}{\sin B}\right)} + \left(-\frac{1}{\sin B}\right) \]
      3. distribute-neg-in97.9%

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

        \[\leadsto -\color{blue}{\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      5. distribute-neg-in97.9%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right) + \left(-\frac{x \cdot \cos B}{\sin B}\right)} \]
      6. distribute-neg-frac97.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} + \left(-\frac{x \cdot \cos B}{\sin B}\right) \]
      7. metadata-eval97.9%

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

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

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

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

    if -1.55000000000000004 < F < 7.19999999999999967e-6

    1. Initial program 76.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. Simplified76.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 99.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/99.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \frac{\color{blue}{\sqrt{0.5} \cdot F}}{\sin B} - \frac{x}{\tan B} \]
    9. Simplified99.7%

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

    if 7.19999999999999967e-6 < F

    1. Initial program 45.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. Simplified66.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 x around 0 80.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/80.6%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified80.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 98.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.55:\\ \;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{F}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 99.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2}} - t\_0\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\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.4)
     (- (/ -1.0 (sin B)) (* x (/ (cos B) (sin B))))
     (if (<= F 7.2e-6)
       (- (/ (/ F (sin B)) (sqrt 2.0)) t_0)
       (- (* 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.4) {
		tmp = (-1.0 / sin(B)) - (x * (cos(B) / sin(B)));
	} else if (F <= 7.2e-6) {
		tmp = ((F / sin(B)) / sqrt(2.0)) - t_0;
	} else {
		tmp = (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.4d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x * (cos(b) / sin(b)))
    else if (f <= 7.2d-6) then
        tmp = ((f / sin(b)) / sqrt(2.0d0)) - t_0
    else
        tmp = (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.4) {
		tmp = (-1.0 / Math.sin(B)) - (x * (Math.cos(B) / Math.sin(B)));
	} else if (F <= 7.2e-6) {
		tmp = ((F / Math.sin(B)) / Math.sqrt(2.0)) - t_0;
	} else {
		tmp = (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.4:
		tmp = (-1.0 / math.sin(B)) - (x * (math.cos(B) / math.sin(B)))
	elif F <= 7.2e-6:
		tmp = ((F / math.sin(B)) / math.sqrt(2.0)) - t_0
	else:
		tmp = (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.4)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x * Float64(cos(B) / sin(B))));
	elseif (F <= 7.2e-6)
		tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(2.0)) - t_0);
	else
		tmp = Float64(Float64(F * Float64(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.4)
		tmp = (-1.0 / sin(B)) - (x * (cos(B) / sin(B)));
	elseif (F <= 7.2e-6)
		tmp = ((F / sin(B)) / sqrt(2.0)) - t_0;
	else
		tmp = (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.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.2e-6], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 7.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2}} - t\_0\\

\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{F}}{\sin B} - t\_0\\


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

    1. Initial program 47.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 97.8%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x \cdot \cos B}{\sin B}\right)} + \left(-\frac{1}{\sin B}\right) \]
      3. distribute-neg-in97.9%

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

        \[\leadsto -\color{blue}{\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      5. distribute-neg-in97.9%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right) + \left(-\frac{x \cdot \cos B}{\sin B}\right)} \]
      6. distribute-neg-frac97.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} + \left(-\frac{x \cdot \cos B}{\sin B}\right) \]
      7. metadata-eval97.9%

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

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

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

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

    if -1.3999999999999999 < F < 7.19999999999999967e-6

    1. Initial program 76.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. Simplified76.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 99.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/99.7%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.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/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. Step-by-step derivation
      1. associate-/l/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.19999999999999967e-6 < F

    1. Initial program 45.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. Simplified66.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 x around 0 80.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/80.6%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified80.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 98.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{F}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 99.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.35:\\ \;\;\;\;\frac{-1 + \frac{1}{{F}^{2}}}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2}} - t\_0\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\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.35)
     (- (/ (+ -1.0 (/ 1.0 (pow F 2.0))) (sin B)) t_0)
     (if (<= F 7.2e-6)
       (- (/ (/ F (sin B)) (sqrt 2.0)) t_0)
       (- (* 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.35) {
		tmp = ((-1.0 + (1.0 / pow(F, 2.0))) / sin(B)) - t_0;
	} else if (F <= 7.2e-6) {
		tmp = ((F / sin(B)) / sqrt(2.0)) - t_0;
	} else {
		tmp = (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.35d0)) then
        tmp = (((-1.0d0) + (1.0d0 / (f ** 2.0d0))) / sin(b)) - t_0
    else if (f <= 7.2d-6) then
        tmp = ((f / sin(b)) / sqrt(2.0d0)) - t_0
    else
        tmp = (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.35) {
		tmp = ((-1.0 + (1.0 / Math.pow(F, 2.0))) / Math.sin(B)) - t_0;
	} else if (F <= 7.2e-6) {
		tmp = ((F / Math.sin(B)) / Math.sqrt(2.0)) - t_0;
	} else {
		tmp = (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.35:
		tmp = ((-1.0 + (1.0 / math.pow(F, 2.0))) / math.sin(B)) - t_0
	elif F <= 7.2e-6:
		tmp = ((F / math.sin(B)) / math.sqrt(2.0)) - t_0
	else:
		tmp = (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.35)
		tmp = Float64(Float64(Float64(-1.0 + Float64(1.0 / (F ^ 2.0))) / sin(B)) - t_0);
	elseif (F <= 7.2e-6)
		tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(2.0)) - t_0);
	else
		tmp = Float64(Float64(F * Float64(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.35)
		tmp = ((-1.0 + (1.0 / (F ^ 2.0))) / sin(B)) - t_0;
	elseif (F <= 7.2e-6)
		tmp = ((F / sin(B)) / sqrt(2.0)) - t_0;
	else
		tmp = (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.35], N[(N[(N[(-1.0 + N[(1.0 / N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7.2e-6], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.35:\\
\;\;\;\;\frac{-1 + \frac{1}{{F}^{2}}}{\sin B} - t\_0\\

\mathbf{elif}\;F \leq 7.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2}} - t\_0\\

\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{F}}{\sin B} - t\_0\\


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

    1. Initial program 47.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. Simplified59.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 68.0%

      \[\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/67.9%

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

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

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

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

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

      \[\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/68.0%

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

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

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

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

      \[\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 98.7%

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

    if -1.3500000000000001 < F < 7.19999999999999967e-6

    1. Initial program 76.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. Simplified76.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 99.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/99.7%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.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/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. Step-by-step derivation
      1. associate-/l/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.19999999999999967e-6 < F

    1. Initial program 45.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. Simplified66.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 x around 0 80.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/80.6%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified80.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 98.6%

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

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

Alternative 7: 87.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0009:\\
\;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\

\mathbf{elif}\;F \leq -4.2 \cdot 10^{-60}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\

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

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


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

    1. Initial program 47.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 97.8%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x \cdot \cos B}{\sin B}\right)} + \left(-\frac{1}{\sin B}\right) \]
      3. distribute-neg-in97.9%

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

        \[\leadsto -\color{blue}{\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      5. distribute-neg-in97.9%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right) + \left(-\frac{x \cdot \cos B}{\sin B}\right)} \]
      6. distribute-neg-frac97.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} + \left(-\frac{x \cdot \cos B}{\sin B}\right) \]
      7. metadata-eval97.9%

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

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

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

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

    if -8.9999999999999998e-4 < F < -4.19999999999999982e-60

    1. Initial program 66.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. Add Preprocessing
    3. Taylor expanded in F around 0 66.1%

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

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

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

    if -4.19999999999999982e-60 < F < 2.79999999999999993e-47

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. associate-/l*85.2%

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

        \[\leadsto -1 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right) \]
      3. tan-quot85.2%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\color{blue}{\tan B}}\right) \]
      4. add-sqr-sqrt35.9%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}\right)} \]
      5. sqrt-unprod23.4%

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      6. sqr-neg23.4%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqrt-unprod0.9%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}\right)} \]
      8. add-sqr-sqrt1.7%

        \[\leadsto -1 \cdot \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      9. neg-sub01.7%

        \[\leadsto -1 \cdot \color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      10. sub-neg1.7%

        \[\leadsto -1 \cdot \color{blue}{\left(0 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      11. add-sqr-sqrt0.9%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      12. sqrt-unprod23.4%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      13. sqr-neg23.4%

        \[\leadsto -1 \cdot \left(0 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      14. sqrt-unprod35.9%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      15. add-sqr-sqrt85.2%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      16. un-div-inv85.5%

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

      \[\leadsto -1 \cdot \color{blue}{\left(0 + \frac{x}{\tan B}\right)} \]
    7. Step-by-step derivation
      1. +-lft-identity85.5%

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

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

    if 2.79999999999999993e-47 < F

    1. Initial program 49.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. Simplified68.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 82.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/82.3%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified82.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 95.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0009:\\ \;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq -4.2 \cdot 10^{-60}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-47}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{F}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 87.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -0.0146:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq -2.25 \cdot 10^{-61}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-47}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\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.0146)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F -2.25e-61)
       (- (* (/ F (sin B)) (sqrt 0.5)) (/ x B))
       (if (<= F 1.8e-47)
         (/ (- x) (tan B))
         (- (* 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.0146) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= -2.25e-61) {
		tmp = ((F / sin(B)) * sqrt(0.5)) - (x / B);
	} else if (F <= 1.8e-47) {
		tmp = -x / tan(B);
	} else {
		tmp = (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.0146d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= (-2.25d-61)) then
        tmp = ((f / sin(b)) * sqrt(0.5d0)) - (x / b)
    else if (f <= 1.8d-47) then
        tmp = -x / tan(b)
    else
        tmp = (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.0146) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= -2.25e-61) {
		tmp = ((F / Math.sin(B)) * Math.sqrt(0.5)) - (x / B);
	} else if (F <= 1.8e-47) {
		tmp = -x / Math.tan(B);
	} else {
		tmp = (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.0146:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= -2.25e-61:
		tmp = ((F / math.sin(B)) * math.sqrt(0.5)) - (x / B)
	elif F <= 1.8e-47:
		tmp = -x / math.tan(B)
	else:
		tmp = (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.0146)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= -2.25e-61)
		tmp = Float64(Float64(Float64(F / sin(B)) * sqrt(0.5)) - Float64(x / B));
	elseif (F <= 1.8e-47)
		tmp = Float64(Float64(-x) / tan(B));
	else
		tmp = Float64(Float64(F * Float64(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.0146)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= -2.25e-61)
		tmp = ((F / sin(B)) * sqrt(0.5)) - (x / B);
	elseif (F <= 1.8e-47)
		tmp = -x / tan(B);
	else
		tmp = (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.0146], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.25e-61], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-47], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -2.25 \cdot 10^{-61}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\

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

\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{F}}{\sin B} - t\_0\\


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

    1. Initial program 47.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. Simplified59.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 68.0%

      \[\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/67.9%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified67.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 97.9%

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

    if -0.0146000000000000001 < F < -2.25e-61

    1. Initial program 66.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. Add Preprocessing
    3. Taylor expanded in F around 0 66.1%

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

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

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

    if -2.25e-61 < F < 1.79999999999999995e-47

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. associate-/l*85.2%

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

        \[\leadsto -1 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right) \]
      3. tan-quot85.2%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\color{blue}{\tan B}}\right) \]
      4. add-sqr-sqrt35.9%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}\right)} \]
      5. sqrt-unprod23.4%

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      6. sqr-neg23.4%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqrt-unprod0.9%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}\right)} \]
      8. add-sqr-sqrt1.7%

        \[\leadsto -1 \cdot \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      9. neg-sub01.7%

        \[\leadsto -1 \cdot \color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      10. sub-neg1.7%

        \[\leadsto -1 \cdot \color{blue}{\left(0 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      11. add-sqr-sqrt0.9%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      12. sqrt-unprod23.4%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      13. sqr-neg23.4%

        \[\leadsto -1 \cdot \left(0 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      14. sqrt-unprod35.9%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      15. add-sqr-sqrt85.2%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      16. un-div-inv85.5%

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

      \[\leadsto -1 \cdot \color{blue}{\left(0 + \frac{x}{\tan B}\right)} \]
    7. Step-by-step derivation
      1. +-lft-identity85.5%

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

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

    if 1.79999999999999995e-47 < F

    1. Initial program 49.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. Simplified68.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 82.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/82.3%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified82.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 95.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0146:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.25 \cdot 10^{-61}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-47}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{F}}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 87.7% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -8.4 \cdot 10^{-60}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\

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

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


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

    1. Initial program 47.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. Simplified59.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 68.0%

      \[\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/67.9%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified67.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 97.9%

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

    if -3.20000000000000026e-4 < F < -8.39999999999999964e-60

    1. Initial program 66.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. Add Preprocessing
    3. Taylor expanded in F around 0 66.1%

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

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

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

    if -8.39999999999999964e-60 < F < 2.79999999999999993e-47

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. associate-/l*85.2%

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

        \[\leadsto -1 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right) \]
      3. tan-quot85.2%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\color{blue}{\tan B}}\right) \]
      4. add-sqr-sqrt35.9%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}\right)} \]
      5. sqrt-unprod23.4%

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      6. sqr-neg23.4%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqrt-unprod0.9%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}\right)} \]
      8. add-sqr-sqrt1.7%

        \[\leadsto -1 \cdot \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      9. neg-sub01.7%

        \[\leadsto -1 \cdot \color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      10. sub-neg1.7%

        \[\leadsto -1 \cdot \color{blue}{\left(0 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      11. add-sqr-sqrt0.9%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      12. sqrt-unprod23.4%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      13. sqr-neg23.4%

        \[\leadsto -1 \cdot \left(0 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      14. sqrt-unprod35.9%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      15. add-sqr-sqrt85.2%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      16. un-div-inv85.5%

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

      \[\leadsto -1 \cdot \color{blue}{\left(0 + \frac{x}{\tan B}\right)} \]
    7. Step-by-step derivation
      1. +-lft-identity85.5%

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

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

    if 2.79999999999999993e-47 < F

    1. Initial program 49.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. Simplified68.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 82.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/82.3%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified82.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 95.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00032:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -8.4 \cdot 10^{-60}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-47}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 86.5% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.3 \cdot 10^{-81}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

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

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


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

    1. Initial program 52.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. Simplified61.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 76.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/76.5%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified76.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 89.1%

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

    if -1.2999999999999999e-81 < F < 2.25e-47

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

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

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

    if 2.25e-47 < F

    1. Initial program 49.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. Simplified68.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 82.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/82.3%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified82.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 95.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.3 \cdot 10^{-81}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.25 \cdot 10^{-47}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 80.1% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 52.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. Simplified61.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 76.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/76.5%

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified76.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 89.1%

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

    if -1.2999999999999999e-81 < F < 2.04999999999999982e44

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. associate-/l*82.7%

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{\cos B}{\sin B}\right)} \]
      2. clear-num82.7%

        \[\leadsto -1 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right) \]
      3. tan-quot82.7%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\color{blue}{\tan B}}\right) \]
      4. add-sqr-sqrt35.2%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}\right)} \]
      5. sqrt-unprod22.6%

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      6. sqr-neg22.6%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqrt-unprod0.9%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}\right)} \]
      8. add-sqr-sqrt1.6%

        \[\leadsto -1 \cdot \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      9. neg-sub01.6%

        \[\leadsto -1 \cdot \color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      10. sub-neg1.6%

        \[\leadsto -1 \cdot \color{blue}{\left(0 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      11. add-sqr-sqrt0.9%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      12. sqrt-unprod22.6%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      13. sqr-neg22.6%

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

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      15. add-sqr-sqrt82.7%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      16. un-div-inv82.9%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\frac{x}{\tan B}}\right) \]
    6. Applied egg-rr82.9%

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

        \[\leadsto -1 \cdot \color{blue}{\frac{x}{\tan B}} \]
    8. Simplified82.9%

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

    if 2.04999999999999982e44 < F

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. mul-1-neg87.2%

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

        \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(-\frac{x}{B}\right)} \]
      3. sub-neg87.2%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    7. Simplified87.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.3 \cdot 10^{-81}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.05 \cdot 10^{+44}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 68.2% accurate, 2.8× speedup?

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

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

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

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


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

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac261.0%

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

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

    if -1.18000000000000004e73 < F < 2.04999999999999982e44

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. associate-/l*77.9%

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{\cos B}{\sin B}\right)} \]
      2. clear-num77.9%

        \[\leadsto -1 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right) \]
      3. tan-quot77.9%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\color{blue}{\tan B}}\right) \]
      4. add-sqr-sqrt33.5%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}\right)} \]
      5. sqrt-unprod21.8%

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      6. sqr-neg21.8%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqrt-unprod0.9%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}\right)} \]
      8. add-sqr-sqrt1.7%

        \[\leadsto -1 \cdot \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      9. neg-sub01.7%

        \[\leadsto -1 \cdot \color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      10. sub-neg1.7%

        \[\leadsto -1 \cdot \color{blue}{\left(0 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      11. add-sqr-sqrt0.9%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      12. sqrt-unprod21.8%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      13. sqr-neg21.8%

        \[\leadsto -1 \cdot \left(0 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      14. sqrt-unprod33.5%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      15. add-sqr-sqrt77.9%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      16. un-div-inv78.1%

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

      \[\leadsto -1 \cdot \color{blue}{\left(0 + \frac{x}{\tan B}\right)} \]
    7. Step-by-step derivation
      1. +-lft-identity78.1%

        \[\leadsto -1 \cdot \color{blue}{\frac{x}{\tan B}} \]
    8. Simplified78.1%

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

    if 2.04999999999999982e44 < F

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. mul-1-neg87.2%

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

        \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(-\frac{x}{B}\right)} \]
      3. sub-neg87.2%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    7. Simplified87.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.18 \cdot 10^{+73}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.05 \cdot 10^{+44}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 73.9% accurate, 2.8× speedup?

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

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

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

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


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

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

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

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

    if -1.8000000000000001e-19 < F < 2.04999999999999982e44

    1. Initial program 74.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 60.9%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. associate-/l*81.7%

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{\cos B}{\sin B}\right)} \]
      2. clear-num81.7%

        \[\leadsto -1 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right) \]
      3. tan-quot81.8%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\color{blue}{\tan B}}\right) \]
      4. add-sqr-sqrt35.8%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}\right)} \]
      5. sqrt-unprod23.2%

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      6. sqr-neg23.2%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqrt-unprod0.9%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}\right)} \]
      8. add-sqr-sqrt1.6%

        \[\leadsto -1 \cdot \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      9. neg-sub01.6%

        \[\leadsto -1 \cdot \color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      10. sub-neg1.6%

        \[\leadsto -1 \cdot \color{blue}{\left(0 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      11. add-sqr-sqrt0.9%

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

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      13. sqr-neg23.2%

        \[\leadsto -1 \cdot \left(0 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      14. sqrt-unprod35.8%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      15. add-sqr-sqrt81.8%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      16. un-div-inv81.9%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\frac{x}{\tan B}}\right) \]
    6. Applied egg-rr81.9%

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

        \[\leadsto -1 \cdot \color{blue}{\frac{x}{\tan B}} \]
    8. Simplified81.9%

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

    if 2.04999999999999982e44 < F

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. mul-1-neg87.2%

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

        \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(-\frac{x}{B}\right)} \]
      3. sub-neg87.2%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    7. Simplified87.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-19}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.05 \cdot 10^{+44}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 46.4% accurate, 2.8× speedup?

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

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

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

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


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

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac255.8%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified55.8%

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

    if -1.75000000000000002e-20 < F < 5.5000000000000003e-8

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Taylor expanded in B around 0 50.8%

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

    if 5.5000000000000003e-8 < F

    1. Initial program 46.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 77.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.75 \cdot 10^{-20}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-8}:\\ \;\;\;\;\frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 62.8% accurate, 2.8× speedup?

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

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

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

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


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

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac261.0%

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

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

    if -3.6e75 < F < 7.5000000000000006e120

    1. Initial program 74.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 61.8%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. associate-/l*76.5%

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

        \[\leadsto -1 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right) \]
      3. tan-quot76.5%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\color{blue}{\tan B}}\right) \]
      4. add-sqr-sqrt34.8%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}\right)} \]
      5. sqrt-unprod23.0%

        \[\leadsto -1 \cdot \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      6. sqr-neg23.0%

        \[\leadsto -1 \cdot \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqrt-unprod0.8%

        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}\right)} \]
      8. add-sqr-sqrt1.6%

        \[\leadsto -1 \cdot \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      9. neg-sub01.6%

        \[\leadsto -1 \cdot \color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      10. sub-neg1.6%

        \[\leadsto -1 \cdot \color{blue}{\left(0 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      11. add-sqr-sqrt0.8%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      12. sqrt-unprod23.0%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      13. sqr-neg23.0%

        \[\leadsto -1 \cdot \left(0 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      14. sqrt-unprod34.8%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      15. add-sqr-sqrt76.5%

        \[\leadsto -1 \cdot \left(0 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      16. un-div-inv76.6%

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

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

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

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

    if 7.5000000000000006e120 < F

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.6 \cdot 10^{+75}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{+120}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 33.7% accurate, 21.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{-192} \lor \neg \left(x \leq 4.8 \cdot 10^{-177}\right):\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -7.2e-192) (not (<= x 4.8e-177))) (/ x (- B)) (/ (+ x 1.0) B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -7.2e-192) || !(x <= 4.8e-177)) {
		tmp = x / -B;
	} else {
		tmp = (x + 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 <= (-7.2d-192)) .or. (.not. (x <= 4.8d-177))) then
        tmp = x / -b
    else
        tmp = (x + 1.0d0) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -7.2e-192) || !(x <= 4.8e-177)) {
		tmp = x / -B;
	} else {
		tmp = (x + 1.0) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -7.2e-192) or not (x <= 4.8e-177):
		tmp = x / -B
	else:
		tmp = (x + 1.0) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -7.2e-192) || !(x <= 4.8e-177))
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(x + 1.0) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -7.2e-192) || ~((x <= 4.8e-177)))
		tmp = x / -B;
	else
		tmp = (x + 1.0) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -7.2e-192], N[Not[LessEqual[x, 4.8e-177]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{-192} \lor \neg \left(x \leq 4.8 \cdot 10^{-177}\right):\\
\;\;\;\;\frac{x}{-B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.1999999999999998e-192 or 4.7999999999999998e-177 < x

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac249.4%

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 50.4%

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

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

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

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

    if -7.1999999999999998e-192 < x < 4.7999999999999998e-177

    1. Initial program 67.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 20.9%

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac29.5%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified9.5%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt4.3%

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

        \[\leadsto \frac{1 + x}{\color{blue}{\sqrt{\left(-B\right) \cdot \left(-B\right)}}} \]
      3. sqr-neg8.2%

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

        \[\leadsto \frac{1 + x}{\color{blue}{\sqrt{B} \cdot \sqrt{B}}} \]
      5. add-sqr-sqrt21.4%

        \[\leadsto \frac{1 + x}{\color{blue}{B}} \]
      6. *-un-lft-identity21.4%

        \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{B}} \]
    8. Applied egg-rr21.4%

      \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{B}} \]
    9. Step-by-step derivation
      1. *-lft-identity21.4%

        \[\leadsto \color{blue}{\frac{1 + x}{B}} \]
    10. Simplified21.4%

      \[\leadsto \color{blue}{\frac{1 + x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{-192} \lor \neg \left(x \leq 4.8 \cdot 10^{-177}\right):\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 44.8% accurate, 21.6× speedup?

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

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

\mathbf{elif}\;F \leq 3.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 < -2.79999999999999982e-84

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac255.7%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified55.7%

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

    if -2.79999999999999982e-84 < F < 3.2000000000000001e-26

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac234.0%

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 47.3%

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

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

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    9. Simplified47.3%

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

    if 3.2000000000000001e-26 < F

    1. Initial program 48.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 77.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.8 \cdot 10^{-84}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-26}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 38.4% accurate, 32.3× speedup?

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

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

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


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

    1. Initial program 66.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 71.0%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg43.3%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac243.3%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified43.3%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 42.8%

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

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

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    9. Simplified42.8%

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

    if 1.94999999999999993e-26 < F

    1. Initial program 48.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 77.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 1.95 \cdot 10^{-26}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 32.5% accurate, 81.0× speedup?

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

\\
\frac{x}{-B}
\end{array}
Derivation
  1. Initial program 61.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. Add Preprocessing
  3. Taylor expanded in F around -inf 66.3%

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

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

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    2. distribute-neg-frac241.8%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
  6. Simplified41.8%

    \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
  7. Taylor expanded in x around inf 41.4%

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

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

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

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

    \[\leadsto \frac{x}{-B} \]
  11. Add Preprocessing

Alternative 20: 9.5% 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 61.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. Add Preprocessing
  3. Taylor expanded in F around -inf 66.3%

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

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

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    2. distribute-neg-frac241.8%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
  6. Simplified41.8%

    \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
  7. Taylor expanded in x around 0 8.1%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  8. Final simplification8.1%

    \[\leadsto \frac{-1}{B} \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2024059 
(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))))))