VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.7% → 99.5%
Time: 19.6s
Alternatives: 35
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 35 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: 76.7% 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.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 0.14:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - t\_0\\

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


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

    1. Initial program 60.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr74.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    6. Applied egg-rr74.9%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified99.7%

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

    if -2.9999999999999998e60 < F < 0.14000000000000001

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

    if 0.14000000000000001 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\color{blue}{x} \cdot \frac{1}{\tan B}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(x \cdot \frac{1}{\tan B}\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{\color{blue}{\tan B}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      8. tan-lowering-tan.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Applied egg-rr99.8%

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

Alternative 2: 99.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 63.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr76.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6499.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified99.7%

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

    if -9.9999999999999996e30 < F < 0.20000000000000001

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. +-lowering-+.f64N/A

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\left(2 + {F}^{2}\right)}, \frac{-1}{2}\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), F\right)\right), \mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(B\right), x\right)\right)\right) \]
    6. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(2, \left({F}^{2}\right)\right), \frac{-1}{2}\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), F\right)\right), \mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(B\right), x\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(2, \left(F \cdot F\right)\right), \frac{-1}{2}\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), F\right)\right), \mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(B\right), x\right)\right)\right) \]
      3. *-lowering-*.f6499.3%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right), \frac{-1}{2}\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(B\right), F\right)\right), \mathsf{/.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(B\right), x\right)\right)\right) \]
    7. Simplified99.3%

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

    if 0.20000000000000001 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\color{blue}{x} \cdot \frac{1}{\tan B}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(x \cdot \frac{1}{\tan B}\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{\color{blue}{\tan B}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      8. tan-lowering-tan.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Applied egg-rr99.8%

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

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

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

\mathbf{elif}\;F \leq 0.14:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}} - t\_0\\

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


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

    1. Initial program 66.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr78.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \color{blue}{\left(-1 \cdot \left(F \cdot \left(1 + \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right)\right)}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \left(\mathsf{neg}\left(F \cdot \left(1 + \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \left(0 - F \cdot \left(1 + \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \left(F \cdot \left(1 + \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \left(1 + \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot 2 + \frac{1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(1 + \frac{1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot 2\right)\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left(F \cdot F\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      15. *-lowering-*.f6499.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified99.2%

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

    if -0.92000000000000004 < F < 0.14000000000000001

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(\sin B \cdot \sqrt{2 + 2 \cdot x}\right)}\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\sin B, \left(\sqrt{2 + 2 \cdot x}\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \left(\sqrt{2 + 2 \cdot x}\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{sqrt.f64}\left(\left(2 + 2 \cdot x\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(2 \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(x \cdot 2\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. *-lowering-*.f6499.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, 2\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified99.4%

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

    if 0.14000000000000001 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\color{blue}{x} \cdot \frac{1}{\tan B}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(x \cdot \frac{1}{\tan B}\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{\color{blue}{\tan B}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      8. tan-lowering-tan.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Applied egg-rr99.8%

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

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

Alternative 4: 89.5% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -4 \cdot 10^{-151}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{t\_0}} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 3.5 \cdot 10^{-146}:\\
\;\;\;\;\frac{x \cdot \cos B}{0 - \sin B}\\

\mathbf{elif}\;F \leq 0.00027:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{t\_0}} - \frac{x}{B}\\

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


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

    1. Initial program 67.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr79.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    6. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6498.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified98.7%

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

    if -4.8999999999999998e-4 < F < -3.9999999999999998e-151

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6479.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified79.9%

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - \frac{x}{B}} \]
    7. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\frac{F}{\sin B}\right), \left(\sqrt{\frac{1}{2 + 2 \cdot x}}\right)\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \sin B\right), \left(\sqrt{\frac{1}{2 + 2 \cdot x}}\right)\right), \left(\frac{x}{B}\right)\right) \]
      4. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \left(\sqrt{\frac{1}{2 + 2 \cdot x}}\right)\right), \left(\frac{x}{B}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + 2 \cdot x}\right)\right)\right), \left(\frac{x}{B}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + 2 \cdot x\right)\right)\right)\right), \left(\frac{x}{B}\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{x}{B}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \left(\frac{x}{B}\right)\right) \]
      9. /-lowering-/.f6479.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified79.4%

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

    if -3.9999999999999998e-151 < F < 3.5000000000000001e-146

    1. Initial program 99.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 x around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{x \cdot \cos B}{\color{blue}{\mathsf{neg}\left(\sin B\right)}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x \cdot \cos B\right), \color{blue}{\left(\mathsf{neg}\left(\sin B\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(0 - \color{blue}{\sin B}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\sin B}\right)\right) \]
      8. sin-lowering-sin.f6488.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified88.3%

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

    if 3.5000000000000001e-146 < F < 2.70000000000000003e-4

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6476.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified76.4%

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

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{B}\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      7. clear-numN/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{1}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\frac{x}{\color{blue}{B}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \color{blue}{\frac{x}{B}} \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    7. Applied egg-rr76.7%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(\sin B \cdot \sqrt{2 + 2 \cdot x}\right)}\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\sin B, \left(\sqrt{2 + 2 \cdot x}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      2. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \left(\sqrt{2 + 2 \cdot x}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{sqrt.f64}\left(\left(2 + 2 \cdot x\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(2 \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(x \cdot 2\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      6. *-lowering-*.f6476.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, 2\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    10. Simplified76.2%

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

    if 2.70000000000000003e-4 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\color{blue}{x} \cdot \frac{1}{\tan B}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(x \cdot \frac{1}{\tan B}\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{\color{blue}{\tan B}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      8. tan-lowering-tan.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Applied egg-rr99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00049:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4 \cdot 10^{-151}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-146}:\\ \;\;\;\;\frac{x \cdot \cos B}{0 - \sin B}\\ \mathbf{elif}\;F \leq 0.00027:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 89.4% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -4.5 \cdot 10^{-151}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.02 \cdot 10^{-143}:\\
\;\;\;\;\frac{x \cdot \cos B}{0 - \sin B}\\

\mathbf{elif}\;F \leq 0.000195:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 67.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr79.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    6. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6498.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified98.7%

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

    if -2.20000000000000008e-4 < F < -4.5000000000000002e-151 or 1.02e-143 < F < 1.94999999999999996e-4

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6478.3%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified78.3%

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

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{B}\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      7. clear-numN/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{1}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\frac{x}{\color{blue}{B}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \color{blue}{\frac{x}{B}} \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    7. Applied egg-rr78.3%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(\sin B \cdot \sqrt{2 + 2 \cdot x}\right)}\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\sin B, \left(\sqrt{2 + 2 \cdot x}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      2. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \left(\sqrt{2 + 2 \cdot x}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{sqrt.f64}\left(\left(2 + 2 \cdot x\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(2 \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(x \cdot 2\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      6. *-lowering-*.f6477.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, 2\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    10. Simplified77.9%

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

    if -4.5000000000000002e-151 < F < 1.02e-143

    1. Initial program 99.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 x around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{x \cdot \cos B}{\color{blue}{\mathsf{neg}\left(\sin B\right)}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x \cdot \cos B\right), \color{blue}{\left(\mathsf{neg}\left(\sin B\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(0 - \color{blue}{\sin B}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\sin B}\right)\right) \]
      8. sin-lowering-sin.f6488.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified88.3%

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

    if 1.94999999999999996e-4 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\color{blue}{x} \cdot \frac{1}{\tan B}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(x \cdot \frac{1}{\tan B}\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{\color{blue}{\tan B}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      8. tan-lowering-tan.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Applied egg-rr99.8%

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

Alternative 6: 91.7% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;F \leq 0.14:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{x \cdot 2 + \left(F \cdot F + 2\right)}} - t\_0\\

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


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

    1. Initial program 67.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr79.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    6. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \color{blue}{\left(-1 \cdot \left(F \cdot \left(1 + \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right)\right)}\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \left(\mathsf{neg}\left(F \cdot \left(1 + \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \left(0 - F \cdot \left(1 + \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \left(F \cdot \left(1 + \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \left(1 + \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot 2 + \frac{1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(1 + \frac{1}{2} \cdot \left(2 \cdot x\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(2 \cdot x\right)\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot 2\right)\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \left(F \cdot F\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      15. *-lowering-*.f6499.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(F, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, 2\right)\right)\right), \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified99.2%

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

    if -4.2000000000000002e-4 < F < -4.8e-151

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6479.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified79.9%

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

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{B}\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      7. clear-numN/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{1}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\frac{x}{\color{blue}{B}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \color{blue}{\frac{x}{B}} \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    7. Applied egg-rr79.7%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - \frac{x}{B}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\frac{\sin B \cdot \sqrt{F \cdot F + \left(2 + x \cdot 2\right)}}{F}}\right), \mathsf{/.f64}\left(\color{blue}{x}, B\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B \cdot \sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} \cdot F\right), \mathsf{/.f64}\left(\color{blue}{x}, B\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{\sin B \cdot \sqrt{F \cdot F + \left(2 + x \cdot 2\right)}}\right), F\right), \mathsf{/.f64}\left(\color{blue}{x}, B\right)\right) \]
    9. Applied egg-rr79.9%

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

    if -4.8e-151 < F < 0.14000000000000001

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(B \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)}\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(\left(2 + 2 \cdot x\right) + {F}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(\left(2 \cdot x + 2\right) + {F}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. associate-+l+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(2 \cdot x + \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(2 \cdot x\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. *-lowering-*.f6485.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified85.4%

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

    if 0.14000000000000001 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\color{blue}{x} \cdot \frac{1}{\tan B}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(x \cdot \frac{1}{\tan B}\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{\color{blue}{\tan B}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      8. tan-lowering-tan.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Applied egg-rr99.8%

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

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

Alternative 7: 91.7% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;F \leq 0.124:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{x \cdot 2 + \left(F \cdot F + 2\right)}} - t\_0\\

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


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

    1. Initial program 67.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr79.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    6. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6498.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified98.7%

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

    if -4.8999999999999998e-4 < F < -4.8e-151

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6479.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified79.9%

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

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{B}\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      7. clear-numN/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{1}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\frac{x}{\color{blue}{B}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \color{blue}{\frac{x}{B}} \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    7. Applied egg-rr79.7%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - \frac{x}{B}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\frac{\sin B \cdot \sqrt{F \cdot F + \left(2 + x \cdot 2\right)}}{F}}\right), \mathsf{/.f64}\left(\color{blue}{x}, B\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B \cdot \sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} \cdot F\right), \mathsf{/.f64}\left(\color{blue}{x}, B\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{\sin B \cdot \sqrt{F \cdot F + \left(2 + x \cdot 2\right)}}\right), F\right), \mathsf{/.f64}\left(\color{blue}{x}, B\right)\right) \]
    9. Applied egg-rr79.9%

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

    if -4.8e-151 < F < 0.124

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(B \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)}\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(\left(2 + 2 \cdot x\right) + {F}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(\left(2 \cdot x + 2\right) + {F}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. associate-+l+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(2 \cdot x + \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(2 \cdot x\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. *-lowering-*.f6485.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified85.4%

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

    if 0.124 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\color{blue}{x} \cdot \frac{1}{\tan B}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(x \cdot \frac{1}{\tan B}\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{\color{blue}{\tan B}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      8. tan-lowering-tan.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Applied egg-rr99.8%

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

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

Alternative 8: 91.7% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;F \leq 0.14:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{x \cdot 2 + \left(F \cdot F + 2\right)}} - t\_0\\

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


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

    1. Initial program 67.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr79.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    6. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6498.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified98.7%

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

    if -4.8999999999999998e-4 < F < -3.9999999999999999e-147

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6479.3%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified79.3%

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

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{B}\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      7. clear-numN/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{1}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\frac{x}{\color{blue}{B}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \color{blue}{\frac{x}{B}} \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    7. Applied egg-rr79.2%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\frac{F}{\sin B}}{\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}}\right), \mathsf{/.f64}\left(\color{blue}{x}, B\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\frac{F}{\sin B}\right), \left(\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}\right)\right), \mathsf{/.f64}\left(\color{blue}{x}, B\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \sin B\right), \left(\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      4. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \left(\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      5. associate-+r+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \left(\sqrt{\left(F \cdot F + 2\right) + x \cdot 2}\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\left(\left(F \cdot F + 2\right) + x \cdot 2\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      9. associate-+r+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot F + \left(2 + x \cdot 2\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 + x \cdot 2\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + x \cdot 2\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 + 2 \cdot x\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{+.f64}\left(2, \left(2 \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      14. *-lowering-*.f6479.3%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    9. Applied egg-rr79.3%

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

    if -3.9999999999999999e-147 < F < 0.14000000000000001

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(B \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)}\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(\left(2 + 2 \cdot x\right) + {F}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(\left(2 \cdot x + 2\right) + {F}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. associate-+l+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(2 \cdot x + \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(2 \cdot x\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. *-lowering-*.f6485.5%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified85.5%

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

    if 0.14000000000000001 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\color{blue}{x} \cdot \frac{1}{\tan B}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(x \cdot \frac{1}{\tan B}\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{\color{blue}{\tan B}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      8. tan-lowering-tan.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Applied egg-rr99.8%

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

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

Alternative 9: 91.6% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;F \leq 0.14:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{x \cdot 2 + \left(F \cdot F + 2\right)}} - t\_0\\

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


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

    1. Initial program 67.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr79.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    6. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6498.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified98.7%

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

    if -9.5000000000000005e-6 < F < -3.9999999999999999e-147

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6479.3%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified79.3%

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

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{B}\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      7. clear-numN/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{1}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\frac{x}{\color{blue}{B}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \color{blue}{\frac{x}{B}} \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    7. Applied egg-rr79.2%

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

    if -3.9999999999999999e-147 < F < 0.14000000000000001

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(B \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)}\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(\left(2 + 2 \cdot x\right) + {F}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(\left(2 \cdot x + 2\right) + {F}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. associate-+l+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(2 \cdot x + \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(2 \cdot x\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. *-lowering-*.f6485.5%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified85.5%

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

    if 0.14000000000000001 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\color{blue}{x} \cdot \frac{1}{\tan B}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(x \cdot \frac{1}{\tan B}\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{\color{blue}{\tan B}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      8. tan-lowering-tan.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Applied egg-rr99.8%

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

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

Alternative 10: 91.6% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;F \leq 0.14:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{x \cdot 2 + \left(F \cdot F + 2\right)}} - t\_0\\

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


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

    1. Initial program 67.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr79.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    6. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6498.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified98.7%

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

    if -4.40000000000000016e-4 < F < -4.8e-151

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6479.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified79.9%

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - \frac{x}{B}} \]
    7. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\frac{F}{\sin B}\right), \left(\sqrt{\frac{1}{2 + 2 \cdot x}}\right)\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \sin B\right), \left(\sqrt{\frac{1}{2 + 2 \cdot x}}\right)\right), \left(\frac{x}{B}\right)\right) \]
      4. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \left(\sqrt{\frac{1}{2 + 2 \cdot x}}\right)\right), \left(\frac{x}{B}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + 2 \cdot x}\right)\right)\right), \left(\frac{x}{B}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + 2 \cdot x\right)\right)\right)\right), \left(\frac{x}{B}\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x\right)\right)\right)\right)\right), \left(\frac{x}{B}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \left(\frac{x}{B}\right)\right) \]
      9. /-lowering-/.f6479.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified79.4%

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

    if -4.8e-151 < F < 0.14000000000000001

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(B \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)}\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(\left(2 + 2 \cdot x\right) + {F}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(\left(2 \cdot x + 2\right) + {F}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      5. associate-+l+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\left(2 \cdot x + \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(2 \cdot x\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      11. *-lowering-*.f6485.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified85.4%

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

    if 0.14000000000000001 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\color{blue}{x} \cdot \frac{1}{\tan B}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(x \cdot \frac{1}{\tan B}\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{\color{blue}{\tan B}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      8. tan-lowering-tan.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Applied egg-rr99.8%

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

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

Alternative 11: 85.5% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -4 \cdot 10^{-114}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 2.6 \cdot 10^{-135}:\\
\;\;\;\;\frac{x \cdot \cos B}{0 - \sin B}\\

\mathbf{elif}\;F \leq 5.8 \cdot 10^{-5}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 67.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr79.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
    6. Applied egg-rr79.0%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6498.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified98.7%

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

    if -2.7999999999999998e-4 < F < -4.0000000000000002e-114 or 2.60000000000000004e-135 < F < 5.8e-5

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{F}{\sin B}\right), \color{blue}{\left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \sin B\right), \left(\sqrt{\color{blue}{\frac{1}{2 + {F}^{2}}}}\right)\right) \]
      3. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \left(\sqrt{\frac{1}{\color{blue}{2 + {F}^{2}}}}\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f6466.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right) \]
    5. Simplified66.0%

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

    if -4.0000000000000002e-114 < F < 2.60000000000000004e-135

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{x \cdot \cos B}{\color{blue}{\mathsf{neg}\left(\sin B\right)}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x \cdot \cos B\right), \color{blue}{\left(\mathsf{neg}\left(\sin B\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(0 - \color{blue}{\sin B}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\sin B}\right)\right) \]
      8. sin-lowering-sin.f6483.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified83.6%

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

    if 5.8e-5 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\color{blue}{x} \cdot \frac{1}{\tan B}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(x \cdot \frac{1}{\tan B}\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{\color{blue}{\tan B}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      8. tan-lowering-tan.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Applied egg-rr99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00028:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4 \cdot 10^{-114}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{F \cdot F + 2}}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-135}:\\ \;\;\;\;\frac{x \cdot \cos B}{0 - \sin B}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{-5}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{F \cdot F + 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 85.3% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 5.8 \cdot 10^{-93}:\\
\;\;\;\;\frac{x \cdot \cos B}{0 - \sin B}\\

\mathbf{elif}\;F \leq 0.00066:\\
\;\;\;\;\frac{F}{B \cdot \left(\sqrt{x \cdot 2 + \left(F \cdot F + 2\right)} \cdot \left(1 + \left(B \cdot B\right) \cdot -0.16666666666666666\right)\right)} - \frac{x}{B}\\

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


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

    1. Initial program 70.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr80.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6492.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified92.4%

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

    if -3.30000000000000028e-29 < F < 5.7999999999999997e-93

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{x \cdot \cos B}{\color{blue}{\mathsf{neg}\left(\sin B\right)}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x \cdot \cos B\right), \color{blue}{\left(\mathsf{neg}\left(\sin B\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \cos B\right), \left(\mathsf{neg}\left(\color{blue}{\sin B}\right)\right)\right) \]
      5. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(\mathsf{neg}\left(\sin B\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \left(0 - \color{blue}{\sin B}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\sin B}\right)\right) \]
      8. sin-lowering-sin.f6472.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{cos.f64}\left(B\right)\right), \mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified72.4%

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

    if 5.7999999999999997e-93 < F < 6.6e-4

    1. Initial program 99.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6483.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified83.4%

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

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{B}\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      7. clear-numN/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{1}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\frac{x}{\color{blue}{B}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \color{blue}{\frac{x}{B}} \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    7. Applied egg-rr83.7%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(B \cdot \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)} + \frac{-1}{6} \cdot \left({B}^{2} \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)}\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)} + \frac{-1}{6} \cdot \left({B}^{2} \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)} + \left(\frac{-1}{6} \cdot {B}^{2}\right) \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      3. distribute-rgt1-inN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\left(\frac{-1}{6} \cdot {B}^{2} + 1\right) \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\left(1 + \frac{-1}{6} \cdot {B}^{2}\right) \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\left(1 + \frac{-1}{6} \cdot {B}^{2}\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{6} \cdot {B}^{2}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({B}^{2} \cdot \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({B}^{2}\right), \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(B \cdot B\right), \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      12. associate-+r+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(\left(2 + 2 \cdot x\right) + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(\left(2 \cdot x + 2\right) + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      14. associate-+l+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(2 \cdot x + \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      15. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(2 \cdot x\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      18. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      19. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    10. Simplified57.1%

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

    if 6.6e-4 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\color{blue}{x} \cdot \frac{1}{\tan B}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(x \cdot \frac{1}{\tan B}\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{\color{blue}{\tan B}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      8. tan-lowering-tan.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Applied egg-rr99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.3 \cdot 10^{-29}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{-93}:\\ \;\;\;\;\frac{x \cdot \cos B}{0 - \sin B}\\ \mathbf{elif}\;F \leq 0.00066:\\ \;\;\;\;\frac{F}{B \cdot \left(\sqrt{x \cdot 2 + \left(F \cdot F + 2\right)} \cdot \left(1 + \left(B \cdot B\right) \cdot -0.16666666666666666\right)\right)} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 85.2% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 7 \cdot 10^{-93}:\\
\;\;\;\;\frac{\cos B}{\sin B} \cdot \left(0 - x\right)\\

\mathbf{elif}\;F \leq 0.011:\\
\;\;\;\;\frac{F}{B \cdot \left(\sqrt{x \cdot 2 + \left(F \cdot F + 2\right)} \cdot \left(1 + \left(B \cdot B\right) \cdot -0.16666666666666666\right)\right)} - \frac{x}{B}\\

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


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

    1. Initial program 70.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr80.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6492.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified92.4%

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

    if -5.29999999999999974e-30 < F < 7e-93

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{\cos B}{\sin B}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(x\right)\right), \color{blue}{\left(\frac{\cos B}{\sin B}\right)}\right) \]
      5. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\left(0 - x\right), \left(\frac{\color{blue}{\cos B}}{\sin B}\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, x\right), \left(\frac{\color{blue}{\cos B}}{\sin B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, x\right), \mathsf{/.f64}\left(\cos B, \color{blue}{\sin B}\right)\right) \]
      8. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, x\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(B\right), \sin \color{blue}{B}\right)\right) \]
      9. sin-lowering-sin.f6472.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, x\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(B\right), \mathsf{sin.f64}\left(B\right)\right)\right) \]
    9. Simplified72.2%

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

    if 7e-93 < F < 0.010999999999999999

    1. Initial program 99.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6483.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified83.4%

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

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{B}\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      7. clear-numN/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{1}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\frac{x}{\color{blue}{B}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \color{blue}{\frac{x}{B}} \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    7. Applied egg-rr83.7%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(B \cdot \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)} + \frac{-1}{6} \cdot \left({B}^{2} \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)}\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)} + \frac{-1}{6} \cdot \left({B}^{2} \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)} + \left(\frac{-1}{6} \cdot {B}^{2}\right) \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      3. distribute-rgt1-inN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\left(\frac{-1}{6} \cdot {B}^{2} + 1\right) \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\left(1 + \frac{-1}{6} \cdot {B}^{2}\right) \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\left(1 + \frac{-1}{6} \cdot {B}^{2}\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{6} \cdot {B}^{2}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({B}^{2} \cdot \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({B}^{2}\right), \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(B \cdot B\right), \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      12. associate-+r+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(\left(2 + 2 \cdot x\right) + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(\left(2 \cdot x + 2\right) + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      14. associate-+l+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(2 \cdot x + \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      15. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(2 \cdot x\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      18. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      19. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    10. Simplified57.1%

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

    if 0.010999999999999999 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{1}{\tan B}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\sin B}\right), \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \sin B\right), \left(\color{blue}{x} \cdot \frac{1}{\tan B}\right)\right) \]
      5. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(x \cdot \frac{1}{\tan B}\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{\color{blue}{\tan B}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{\tan B}\right)\right) \]
      8. tan-lowering-tan.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    7. Applied egg-rr99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.3 \cdot 10^{-30}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-93}:\\ \;\;\;\;\frac{\cos B}{\sin B} \cdot \left(0 - x\right)\\ \mathbf{elif}\;F \leq 0.011:\\ \;\;\;\;\frac{F}{B \cdot \left(\sqrt{x \cdot 2 + \left(F \cdot F + 2\right)} \cdot \left(1 + \left(B \cdot B\right) \cdot -0.16666666666666666\right)\right)} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 78.2% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 2.7 \cdot 10^{-93}:\\
\;\;\;\;\frac{\cos B}{\sin B} \cdot \left(0 - x\right)\\

\mathbf{elif}\;F \leq 0.066:\\
\;\;\;\;\frac{F}{B \cdot \left(\sqrt{x \cdot 2 + \left(F \cdot F + 2\right)} \cdot \left(1 + \left(B \cdot B\right) \cdot -0.16666666666666666\right)\right)} - \frac{x}{B}\\

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


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

    1. Initial program 70.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr80.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-1}{\sin B}\right)}, \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \mathsf{/.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(B\right)\right)\right) \]
      2. sin-lowering-sin.f6492.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \mathsf{tan.f64}\left(B\right)\right)\right) \]
    9. Simplified92.4%

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

    if -1.3e-28 < F < 2.7000000000000001e-93

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{\cos B}{\sin B}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(x\right)\right), \color{blue}{\left(\frac{\cos B}{\sin B}\right)}\right) \]
      5. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\left(0 - x\right), \left(\frac{\color{blue}{\cos B}}{\sin B}\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, x\right), \left(\frac{\color{blue}{\cos B}}{\sin B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, x\right), \mathsf{/.f64}\left(\cos B, \color{blue}{\sin B}\right)\right) \]
      8. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, x\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(B\right), \sin \color{blue}{B}\right)\right) \]
      9. sin-lowering-sin.f6472.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, x\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(B\right), \mathsf{sin.f64}\left(B\right)\right)\right) \]
    9. Simplified72.2%

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

    if 2.7000000000000001e-93 < F < 0.066000000000000003

    1. Initial program 99.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6483.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified83.4%

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

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{B}\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      7. clear-numN/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{1}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\frac{x}{\color{blue}{B}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \color{blue}{\frac{x}{B}} \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    7. Applied egg-rr83.7%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(B \cdot \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)} + \frac{-1}{6} \cdot \left({B}^{2} \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)}\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)} + \frac{-1}{6} \cdot \left({B}^{2} \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)} + \left(\frac{-1}{6} \cdot {B}^{2}\right) \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      3. distribute-rgt1-inN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\left(\frac{-1}{6} \cdot {B}^{2} + 1\right) \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\left(1 + \frac{-1}{6} \cdot {B}^{2}\right) \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\left(1 + \frac{-1}{6} \cdot {B}^{2}\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{6} \cdot {B}^{2}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({B}^{2} \cdot \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({B}^{2}\right), \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(B \cdot B\right), \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      12. associate-+r+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(\left(2 + 2 \cdot x\right) + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(\left(2 \cdot x + 2\right) + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      14. associate-+l+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(2 \cdot x + \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      15. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(2 \cdot x\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      18. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      19. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    10. Simplified57.1%

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

    if 0.066000000000000003 < F

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified99.6%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{B}\right)}\right) \]
    7. Step-by-step derivation
      1. /-lowering-/.f6478.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{B}\right)\right) \]
    8. Simplified78.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.3 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-93}:\\ \;\;\;\;\frac{\cos B}{\sin B} \cdot \left(0 - x\right)\\ \mathbf{elif}\;F \leq 0.066:\\ \;\;\;\;\frac{F}{B \cdot \left(\sqrt{x \cdot 2 + \left(F \cdot F + 2\right)} \cdot \left(1 + \left(B \cdot B\right) \cdot -0.16666666666666666\right)\right)} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 56.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 0.0095:\\ \;\;\;\;\frac{\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \left(F \cdot \left(1 + \left(B \cdot B\right) \cdot 0.16666666666666666\right)\right) + \left(B \cdot \left(B \cdot \left(x \cdot 0.3333333333333333\right)\right) - x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos B}{\sin B} \cdot \left(0 - x\right)\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= B 0.0095)
   (/
    (+
     (*
      (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))
      (* F (+ 1.0 (* (* B B) 0.16666666666666666))))
     (- (* B (* B (* x 0.3333333333333333))) x))
    B)
   (* (/ (cos B) (sin B)) (- 0.0 x))))
double code(double F, double B, double x) {
	double tmp;
	if (B <= 0.0095) {
		tmp = ((sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F * (1.0 + ((B * B) * 0.16666666666666666)))) + ((B * (B * (x * 0.3333333333333333))) - x)) / B;
	} else {
		tmp = (cos(B) / sin(B)) * (0.0 - x);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (b <= 0.0095d0) then
        tmp = ((sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0))))) * (f * (1.0d0 + ((b * b) * 0.16666666666666666d0)))) + ((b * (b * (x * 0.3333333333333333d0))) - x)) / b
    else
        tmp = (cos(b) / sin(b)) * (0.0d0 - x)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (B <= 0.0095) {
		tmp = ((Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F * (1.0 + ((B * B) * 0.16666666666666666)))) + ((B * (B * (x * 0.3333333333333333))) - x)) / B;
	} else {
		tmp = (Math.cos(B) / Math.sin(B)) * (0.0 - x);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if B <= 0.0095:
		tmp = ((math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F * (1.0 + ((B * B) * 0.16666666666666666)))) + ((B * (B * (x * 0.3333333333333333))) - x)) / B
	else:
		tmp = (math.cos(B) / math.sin(B)) * (0.0 - x)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (B <= 0.0095)
		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0))))) * Float64(F * Float64(1.0 + Float64(Float64(B * B) * 0.16666666666666666)))) + Float64(Float64(B * Float64(B * Float64(x * 0.3333333333333333))) - x)) / B);
	else
		tmp = Float64(Float64(cos(B) / sin(B)) * Float64(0.0 - x));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (B <= 0.0095)
		tmp = ((sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F * (1.0 + ((B * B) * 0.16666666666666666)))) + ((B * (B * (x * 0.3333333333333333))) - x)) / B;
	else
		tmp = (cos(B) / sin(B)) * (0.0 - x);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[B, 0.0095], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F * N[(1.0 + N[(N[(B * B), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(B * N[(B * N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(0.0 - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.0095:\\
\;\;\;\;\frac{\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \left(F \cdot \left(1 + \left(B \cdot B\right) \cdot 0.16666666666666666\right)\right) + \left(B \cdot \left(B \cdot \left(x \cdot 0.3333333333333333\right)\right) - x\right)}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\cos B}{\sin B} \cdot \left(0 - x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 0.00949999999999999976

    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 B around 0

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

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

    if 0.00949999999999999976 < B

    1. Initial program 87.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\color{blue}{\frac{\sin B}{F}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \left(\frac{1}{\sin B} \cdot \color{blue}{F}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot \color{blue}{F}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \cdot F\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}\right), \color{blue}{F}\right)\right) \]
    4. Applied egg-rr87.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{-0.5}}{\sin B} \cdot F} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

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

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. unsub-negN/A

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    8. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{\cos B}{\sin B}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(x\right)\right), \color{blue}{\left(\frac{\cos B}{\sin B}\right)}\right) \]
      5. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\left(0 - x\right), \left(\frac{\color{blue}{\cos B}}{\sin B}\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, x\right), \left(\frac{\color{blue}{\cos B}}{\sin B}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, x\right), \mathsf{/.f64}\left(\cos B, \color{blue}{\sin B}\right)\right) \]
      8. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, x\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(B\right), \sin \color{blue}{B}\right)\right) \]
      9. sin-lowering-sin.f6464.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, x\right), \mathsf{/.f64}\left(\mathsf{cos.f64}\left(B\right), \mathsf{sin.f64}\left(B\right)\right)\right) \]
    9. Simplified64.0%

      \[\leadsto \color{blue}{\left(0 - x\right) \cdot \frac{\cos B}{\sin B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 0.0095:\\ \;\;\;\;\frac{\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \left(F \cdot \left(1 + \left(B \cdot B\right) \cdot 0.16666666666666666\right)\right) + \left(B \cdot \left(B \cdot \left(x \cdot 0.3333333333333333\right)\right) - x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos B}{\sin B} \cdot \left(0 - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 55.7% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 1050000:\\ \;\;\;\;\frac{\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \left(F \cdot \left(1 + \left(B \cdot B\right) \cdot 0.16666666666666666\right)\right) + \left(B \cdot \left(B \cdot \left(x \cdot 0.3333333333333333\right)\right) - x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= B 1050000.0)
   (/
    (+
     (*
      (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))
      (* F (+ 1.0 (* (* B B) 0.16666666666666666))))
     (- (* B (* B (* x 0.3333333333333333))) x))
    B)
   (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))
double code(double F, double B, double x) {
	double tmp;
	if (B <= 1050000.0) {
		tmp = ((sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F * (1.0 + ((B * B) * 0.16666666666666666)))) + ((B * (B * (x * 0.3333333333333333))) - x)) / B;
	} else {
		tmp = (x * (-1.0 / tan(B))) + (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 (b <= 1050000.0d0) then
        tmp = ((sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0))))) * (f * (1.0d0 + ((b * b) * 0.16666666666666666d0)))) + ((b * (b * (x * 0.3333333333333333d0))) - x)) / b
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (B <= 1050000.0) {
		tmp = ((Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F * (1.0 + ((B * B) * 0.16666666666666666)))) + ((B * (B * (x * 0.3333333333333333))) - x)) / B;
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if B <= 1050000.0:
		tmp = ((math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F * (1.0 + ((B * B) * 0.16666666666666666)))) + ((B * (B * (x * 0.3333333333333333))) - x)) / B
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (B <= 1050000.0)
		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0))))) * Float64(F * Float64(1.0 + Float64(Float64(B * B) * 0.16666666666666666)))) + Float64(Float64(B * Float64(B * Float64(x * 0.3333333333333333))) - x)) / B);
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (B <= 1050000.0)
		tmp = ((sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0))))) * (F * (1.0 + ((B * B) * 0.16666666666666666)))) + ((B * (B * (x * 0.3333333333333333))) - x)) / B;
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[B, 1050000.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F * N[(1.0 + N[(N[(B * B), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(B * N[(B * N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;B \leq 1050000:\\
\;\;\;\;\frac{\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \left(F \cdot \left(1 + \left(B \cdot B\right) \cdot 0.16666666666666666\right)\right) + \left(B \cdot \left(B \cdot \left(x \cdot 0.3333333333333333\right)\right) - x\right)}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.05e6

    1. Initial program 75.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 B around 0

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

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

    if 1.05e6 < B

    1. Initial program 87.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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6456.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified56.2%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{B}\right)}\right) \]
    7. Step-by-step derivation
      1. /-lowering-/.f6462.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{B}\right)\right) \]
    8. Simplified62.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1050000:\\ \;\;\;\;\frac{\sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} \cdot \left(F \cdot \left(1 + \left(B \cdot B\right) \cdot 0.16666666666666666\right)\right) + \left(B \cdot \left(B \cdot \left(x \cdot 0.3333333333333333\right)\right) - x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 58.4% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F}{F \cdot \left(0 - \sin B\right)} - \frac{x}{B}\\
t_1 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{if}\;x \leq -8.8 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -3.3 \cdot 10^{-165}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;x \leq 5.8 \cdot 10^{-59}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -8.7999999999999996e-10 or 5.80000000000000033e-59 < x

    1. Initial program 81.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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6487.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified87.9%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{B}\right)}\right) \]
    7. Step-by-step derivation
      1. /-lowering-/.f6492.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{B}\right)\right) \]
    8. Simplified92.0%

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

    if -8.7999999999999996e-10 < x < -3.2999999999999998e-165 or 3.3000000000000001e-245 < x < 5.80000000000000033e-59

    1. Initial program 71.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6452.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified52.9%

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

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{B}\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      7. clear-numN/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{1}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\frac{x}{\color{blue}{B}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \color{blue}{\frac{x}{B}} \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    7. Applied egg-rr54.4%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - \frac{x}{B}} \]
    8. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(-1 \cdot \left(F \cdot \sin B\right)\right)}\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \left(\mathsf{neg}\left(F \cdot \sin B\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \left(0 - F \cdot \sin B\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{\_.f64}\left(0, \left(F \cdot \sin B\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{\_.f64}\left(0, \left(\sin B \cdot F\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\sin B, F\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      6. sin-lowering-sin.f6435.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), F\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    10. Simplified35.2%

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

    if -3.2999999999999998e-165 < x < 3.3000000000000001e-245

    1. Initial program 86.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 B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6447.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified47.6%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)}, B\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), B\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), B\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), B\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), B\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), B\right) \]
      6. *-lowering-*.f6441.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), B\right) \]
    8. Simplified41.8%

      \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + F \cdot F}}}}{B} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.8 \cdot 10^{-10}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-165}:\\ \;\;\;\;\frac{F}{F \cdot \left(0 - \sin B\right)} - \frac{x}{B}\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-245}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{F \cdot F + 2}}}{B}\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-59}:\\ \;\;\;\;\frac{F}{F \cdot \left(0 - \sin B\right)} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 57.8% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F}{F \cdot \left(0 - \sin B\right)} - \frac{x}{B}\\
t_1 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{if}\;x \leq -1.66 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -2.8 \cdot 10^{-166}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;x \leq 4.8 \cdot 10^{-60}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.66e-10 or 4.80000000000000019e-60 < x

    1. Initial program 81.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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6487.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified87.9%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{B}\right)}\right) \]
    7. Step-by-step derivation
      1. /-lowering-/.f6492.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{B}\right)\right) \]
    8. Simplified92.0%

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

    if -1.66e-10 < x < -2.7999999999999999e-166 or 8.4999999999999998e-246 < x < 4.80000000000000019e-60

    1. Initial program 71.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6452.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified52.9%

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

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{B}\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      7. clear-numN/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{1}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\frac{x}{\color{blue}{B}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \color{blue}{\frac{x}{B}} \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    7. Applied egg-rr54.4%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - \frac{x}{B}} \]
    8. Taylor expanded in F around -inf

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(-1 \cdot \left(F \cdot \sin B\right)\right)}\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \left(\mathsf{neg}\left(F \cdot \sin B\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \left(0 - F \cdot \sin B\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{\_.f64}\left(0, \left(F \cdot \sin B\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{\_.f64}\left(0, \left(\sin B \cdot F\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\sin B, F\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      6. sin-lowering-sin.f6435.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), F\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    10. Simplified35.2%

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

    if -2.7999999999999999e-166 < x < 8.4999999999999998e-246

    1. Initial program 86.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 B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6447.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified47.6%

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

      \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{B}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{2 + {F}^{2}}}\right), \color{blue}{\left(\frac{F}{B}\right)}\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right), \left(\frac{\color{blue}{F}}{B}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
      8. /-lowering-/.f6439.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{/.f64}\left(F, \color{blue}{B}\right)\right) \]
    8. Simplified39.7%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + F \cdot F}} \cdot \frac{F}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.66 \cdot 10^{-10}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{elif}\;x \leq -2.8 \cdot 10^{-166}:\\ \;\;\;\;\frac{F}{F \cdot \left(0 - \sin B\right)} - \frac{x}{B}\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{-246}:\\ \;\;\;\;\sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{B}\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-60}:\\ \;\;\;\;\frac{F}{F \cdot \left(0 - \sin B\right)} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 56.0% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 7800000:\\ \;\;\;\;\frac{F}{B \cdot \left(\sqrt{x \cdot 2 + \left(F \cdot F + 2\right)} \cdot \left(1 + \left(B \cdot B\right) \cdot -0.16666666666666666\right)\right)} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= B 7800000.0)
   (-
    (/
     F
     (*
      B
      (*
       (sqrt (+ (* x 2.0) (+ (* F F) 2.0)))
       (+ 1.0 (* (* B B) -0.16666666666666666)))))
    (/ x B))
   (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))
double code(double F, double B, double x) {
	double tmp;
	if (B <= 7800000.0) {
		tmp = (F / (B * (sqrt(((x * 2.0) + ((F * F) + 2.0))) * (1.0 + ((B * B) * -0.16666666666666666))))) - (x / B);
	} else {
		tmp = (x * (-1.0 / tan(B))) + (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 (b <= 7800000.0d0) then
        tmp = (f / (b * (sqrt(((x * 2.0d0) + ((f * f) + 2.0d0))) * (1.0d0 + ((b * b) * (-0.16666666666666666d0)))))) - (x / b)
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (B <= 7800000.0) {
		tmp = (F / (B * (Math.sqrt(((x * 2.0) + ((F * F) + 2.0))) * (1.0 + ((B * B) * -0.16666666666666666))))) - (x / B);
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if B <= 7800000.0:
		tmp = (F / (B * (math.sqrt(((x * 2.0) + ((F * F) + 2.0))) * (1.0 + ((B * B) * -0.16666666666666666))))) - (x / B)
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (B <= 7800000.0)
		tmp = Float64(Float64(F / Float64(B * Float64(sqrt(Float64(Float64(x * 2.0) + Float64(Float64(F * F) + 2.0))) * Float64(1.0 + Float64(Float64(B * B) * -0.16666666666666666))))) - Float64(x / B));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (B <= 7800000.0)
		tmp = (F / (B * (sqrt(((x * 2.0) + ((F * F) + 2.0))) * (1.0 + ((B * B) * -0.16666666666666666))))) - (x / B);
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[B, 7800000.0], N[(N[(F / N[(B * N[(N[Sqrt[N[(N[(x * 2.0), $MachinePrecision] + N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;B \leq 7800000:\\
\;\;\;\;\frac{F}{B \cdot \left(\sqrt{x \cdot 2 + \left(F \cdot F + 2\right)} \cdot \left(1 + \left(B \cdot B\right) \cdot -0.16666666666666666\right)\right)} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 7.8e6

    1. Initial program 75.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6451.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified51.4%

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

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{B}\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      7. clear-numN/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{1}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\frac{x}{\color{blue}{B}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \color{blue}{\frac{x}{B}} \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    7. Applied egg-rr64.5%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(B \cdot \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)} + \frac{-1}{6} \cdot \left({B}^{2} \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)}\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)} + \frac{-1}{6} \cdot \left({B}^{2} \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)} + \left(\frac{-1}{6} \cdot {B}^{2}\right) \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      3. distribute-rgt1-inN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\left(\frac{-1}{6} \cdot {B}^{2} + 1\right) \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \left(\left(1 + \frac{-1}{6} \cdot {B}^{2}\right) \cdot \sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\left(1 + \frac{-1}{6} \cdot {B}^{2}\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{6} \cdot {B}^{2}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({B}^{2} \cdot \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({B}^{2}\right), \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(B \cdot B\right), \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \left(\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      12. associate-+r+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(\left(2 + 2 \cdot x\right) + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(\left(2 \cdot x + 2\right) + {F}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      14. associate-+l+N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\left(2 \cdot x + \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      15. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(2 \cdot x\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(x \cdot 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(2 + {F}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      18. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      19. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(B, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    10. Simplified52.9%

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

    if 7.8e6 < B

    1. Initial program 87.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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6456.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified56.2%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{B}\right)}\right) \]
    7. Step-by-step derivation
      1. /-lowering-/.f6462.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{B}\right)\right) \]
    8. Simplified62.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 7800000:\\ \;\;\;\;\frac{F}{B \cdot \left(\sqrt{x \cdot 2 + \left(F \cdot F + 2\right)} \cdot \left(1 + \left(B \cdot B\right) \cdot -0.16666666666666666\right)\right)} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 57.9% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;x \leq -3.6 \cdot 10^{-165}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;x \leq 1.9 \cdot 10^{-58}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.89999999999999981e-10 or 1.8999999999999999e-58 < x

    1. Initial program 81.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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6487.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified87.9%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{B}\right)}\right) \]
    7. Step-by-step derivation
      1. /-lowering-/.f6492.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{B}\right)\right) \]
    8. Simplified92.0%

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

    if -2.89999999999999981e-10 < x < -3.59999999999999984e-165 or 6.6000000000000002e-246 < x < 1.8999999999999999e-58

    1. Initial program 71.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6452.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified52.9%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x}{B}} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
      4. neg-mul-1N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) - \frac{\color{blue}{x}}{B} \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\sin B}\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{-1}{\sin B}\right), \left(\frac{x}{B}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      10. /-lowering-/.f6435.1%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified35.1%

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

    if -3.59999999999999984e-165 < x < 6.6000000000000002e-246

    1. Initial program 86.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 B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6447.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified47.6%

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

      \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{B}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{2 + {F}^{2}}}\right), \color{blue}{\left(\frac{F}{B}\right)}\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right), \left(\frac{\color{blue}{F}}{B}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \left(\frac{F}{B}\right)\right) \]
      8. /-lowering-/.f6439.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right), \mathsf{/.f64}\left(F, \color{blue}{B}\right)\right) \]
    8. Simplified39.7%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + F \cdot F}} \cdot \frac{F}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{-10}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{elif}\;x \leq -3.6 \cdot 10^{-165}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{-246}:\\ \;\;\;\;\sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{B}\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{-58}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 55.9% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq 1050000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.05e6

    1. Initial program 75.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 B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6452.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified52.5%

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

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + 2 \cdot x\right)}} - x\right), \color{blue}{B}\right) \]
    7. Applied egg-rr52.5%

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

    if 1.05e6 < B

    1. Initial program 87.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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6456.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified56.2%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{B}\right)}\right) \]
    7. Step-by-step derivation
      1. /-lowering-/.f6462.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{B}\right)\right) \]
    8. Simplified62.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1050000:\\ \;\;\;\;\frac{\frac{F}{\sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 57.9% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq 1.3 \cdot 10^{-45}:\\
\;\;\;\;0 - \frac{x}{B}\\

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


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

    1. Initial program 72.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6439.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified39.4%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x}{B}} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
      4. neg-mul-1N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) - \frac{\color{blue}{x}}{B} \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\sin B}\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{-1}{\sin B}\right), \left(\frac{x}{B}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      10. /-lowering-/.f6456.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified56.0%

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

    if -2.40000000000000026e-66 < F < 1.29999999999999993e-45

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6440.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified40.7%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6427.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified27.2%

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

    if 1.29999999999999993e-45 < F

    1. Initial program 58.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6430.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified30.7%

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

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{B}\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      7. clear-numN/A

        \[\leadsto {\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}} \cdot \frac{1}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\frac{x}{\color{blue}{B}}\right)\right) \]
      8. div-invN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{B}}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \color{blue}{\frac{x}{B}} \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(F \cdot F + \left(2 + x \cdot 2\right)\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
    7. Applied egg-rr52.4%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{F \cdot F + \left(2 + x \cdot 2\right)}} - \frac{x}{B}} \]
    8. Taylor expanded in F around inf

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \color{blue}{\left(F \cdot \sin B\right)}\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \left(\sin B \cdot F\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\sin B, F\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      3. sin-lowering-sin.f6462.3%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(F, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(B\right), F\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    10. Simplified62.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.4 \cdot 10^{-66}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-45}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 55.9% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq 1050000:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{F \cdot F + 2}} - x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.05e6

    1. Initial program 75.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 B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6452.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified52.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)}, x\right), B\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + {F}^{2}}}\right)\right), x\right), B\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + {F}^{2}}\right)\right)\right), x\right), B\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + {F}^{2}\right)\right)\right)\right), x\right), B\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(F \cdot F\right)\right)\right)\right)\right), x\right), B\right) \]
      6. *-lowering-*.f6452.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(F, F\right)\right)\right)\right)\right), x\right), B\right) \]
    8. Simplified52.5%

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

    if 1.05e6 < B

    1. Initial program 87.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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6456.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified56.2%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{B}\right)}\right) \]
    7. Step-by-step derivation
      1. /-lowering-/.f6462.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{B}\right)\right) \]
    8. Simplified62.2%

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

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

Alternative 24: 62.1% accurate, 2.8× speedup?

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

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

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


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

    1. Initial program 64.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6433.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified33.4%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x}{B}} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
      4. neg-mul-1N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) - \frac{\color{blue}{x}}{B} \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\sin B}\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{-1}{\sin B}\right), \left(\frac{x}{B}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      10. /-lowering-/.f6467.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified67.7%

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

    if -2.25e17 < F

    1. Initial program 85.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6455.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified55.4%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{B}\right)}\right) \]
    7. Step-by-step derivation
      1. /-lowering-/.f6457.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{B}\right)\right) \]
    8. Simplified57.2%

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

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

Alternative 25: 44.5% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{+218}:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 + \left(B \cdot B\right) \cdot \left(\left(B \cdot B\right) \cdot -0.00205026455026455 + -0.019444444444444445\right)\right) + \left(-1 - x\right)}{B}\\

\mathbf{elif}\;F \leq -3.9 \cdot 10^{-50}:\\
\;\;\;\;\frac{-1}{\sin B}\\

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

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


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

    1. Initial program 37.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f648.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified8.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x}{B}} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
      4. neg-mul-1N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) - \frac{\color{blue}{x}}{B} \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\sin B}\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{-1}{\sin B}\right), \left(\frac{x}{B}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      10. /-lowering-/.f6471.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified71.0%

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

      \[\leadsto \color{blue}{\frac{{B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-31}{15120} \cdot {B}^{2} - \frac{7}{360}\right) - \frac{1}{6}\right) - \left(1 + x\right)}{B}} \]
    10. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left({B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-31}{15120} \cdot {B}^{2} - \frac{7}{360}\right) - \frac{1}{6}\right) - \left(1 + x\right)\right), \color{blue}{B}\right) \]
    11. Simplified56.8%

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

    if -2.49999999999999991e218 < F < -3.90000000000000021e-50

    1. Initial program 86.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6450.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified50.7%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x}{B}} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
      4. neg-mul-1N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) - \frac{\color{blue}{x}}{B} \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\sin B}\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{-1}{\sin B}\right), \left(\frac{x}{B}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      10. /-lowering-/.f6449.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified49.6%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]
    9. Taylor expanded in B around inf

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
    10. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(-1, \color{blue}{\sin B}\right) \]
      2. sin-lowering-sin.f6440.6%

        \[\leadsto \mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right) \]
    11. Simplified40.6%

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

    if -3.90000000000000021e-50 < F < 9.20000000000000035e-26

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6439.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified39.5%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6426.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified26.8%

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

    if 9.20000000000000035e-26 < F

    1. Initial program 56.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6495.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified95.2%

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

      \[\leadsto \color{blue}{\frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x\right), \color{blue}{B}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left({B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right) + 1\right) - x\right), B\right) \]
      3. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right) + \left(1 - x\right)\right), B\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left({B}^{2}\right), \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(B \cdot B\right), \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{1}{3} \cdot x\right)\right)\right), \left(1 - x\right)\right), B\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(x \cdot \frac{1}{3}\right)\right)\right), \left(1 - x\right)\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(x, \frac{1}{3}\right)\right)\right), \left(1 - x\right)\right), B\right) \]
      11. --lowering--.f6448.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(x, \frac{1}{3}\right)\right)\right), \mathsf{\_.f64}\left(1, x\right)\right), B\right) \]
    8. Simplified48.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.5 \cdot 10^{+218}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 + \left(B \cdot B\right) \cdot \left(\left(B \cdot B\right) \cdot -0.00205026455026455 + -0.019444444444444445\right)\right) + \left(-1 - x\right)}{B}\\ \mathbf{elif}\;F \leq -3.9 \cdot 10^{-50}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{-26}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \left(1 - x\right)}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 51.2% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;F \leq 6.4 \cdot 10^{-22}:\\
\;\;\;\;0 - \frac{x}{B}\\

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


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

    1. Initial program 72.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6439.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified39.4%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x}{B}} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
      4. neg-mul-1N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) - \frac{\color{blue}{x}}{B} \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\sin B}\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{-1}{\sin B}\right), \left(\frac{x}{B}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      10. /-lowering-/.f6456.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified56.0%

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

    if -2.04999999999999999e-66 < F < 6.39999999999999975e-22

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6439.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified39.2%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6426.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified26.3%

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

    if 6.39999999999999975e-22 < F

    1. Initial program 56.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6495.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified95.2%

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

      \[\leadsto \color{blue}{\frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x\right), \color{blue}{B}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left({B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right) + 1\right) - x\right), B\right) \]
      3. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right) + \left(1 - x\right)\right), B\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left({B}^{2}\right), \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(B \cdot B\right), \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{1}{3} \cdot x\right)\right)\right), \left(1 - x\right)\right), B\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(x \cdot \frac{1}{3}\right)\right)\right), \left(1 - x\right)\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(x, \frac{1}{3}\right)\right)\right), \left(1 - x\right)\right), B\right) \]
      11. --lowering--.f6448.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(x, \frac{1}{3}\right)\right)\right), \mathsf{\_.f64}\left(1, x\right)\right), B\right) \]
    8. Simplified48.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.05 \cdot 10^{-66}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6.4 \cdot 10^{-22}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \left(1 - x\right)}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 27: 44.6% accurate, 10.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.6 \cdot 10^{-48}:\\
\;\;\;\;\frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(-0.16666666666666666 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 + \left(B \cdot B\right) \cdot -0.0001984126984126984\right)\right)\right)} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.05 \cdot 10^{-26}:\\
\;\;\;\;0 - \frac{x}{B}\\

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


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

    1. Initial program 71.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6437.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified37.4%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x}{B}} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
      4. neg-mul-1N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) - \frac{\color{blue}{x}}{B} \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\sin B}\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{-1}{\sin B}\right), \left(\frac{x}{B}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      10. /-lowering-/.f6456.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified56.6%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \color{blue}{\left(B \cdot \left(1 + {B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {B}^{2}\right) - \frac{1}{6}\right)\right)\right)}\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    10. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \left(1 + {B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {B}^{2}\right) - \frac{1}{6}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \left({B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {B}^{2}\right) - \frac{1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({B}^{2}\right), \left({B}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {B}^{2}\right) - \frac{1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(B \cdot B\right), \left({B}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {B}^{2}\right) - \frac{1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \left({B}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {B}^{2}\right) - \frac{1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \left({B}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {B}^{2}\right) + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \left({B}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {B}^{2}\right) + \frac{-1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {B}^{2}\right)\right), \frac{-1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left({B}^{2}\right), \left(\frac{1}{120} + \frac{-1}{5040} \cdot {B}^{2}\right)\right), \frac{-1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(B \cdot B\right), \left(\frac{1}{120} + \frac{-1}{5040} \cdot {B}^{2}\right)\right), \frac{-1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \left(\frac{1}{120} + \frac{-1}{5040} \cdot {B}^{2}\right)\right), \frac{-1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{120}, \left(\frac{-1}{5040} \cdot {B}^{2}\right)\right)\right), \frac{-1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{120}, \left({B}^{2} \cdot \frac{-1}{5040}\right)\right)\right), \frac{-1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\left({B}^{2}\right), \frac{-1}{5040}\right)\right)\right), \frac{-1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\left(B \cdot B\right), \frac{-1}{5040}\right)\right)\right), \frac{-1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      16. *-lowering-*.f6437.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{5040}\right)\right)\right), \frac{-1}{6}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    11. Simplified37.2%

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

    if -5.6000000000000001e-48 < F < 2.0499999999999999e-26

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6439.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified39.1%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6426.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified26.6%

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

    if 2.0499999999999999e-26 < F

    1. Initial program 56.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6495.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified95.2%

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

      \[\leadsto \color{blue}{\frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x\right), \color{blue}{B}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left({B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right) + 1\right) - x\right), B\right) \]
      3. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right) + \left(1 - x\right)\right), B\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left({B}^{2}\right), \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(B \cdot B\right), \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{1}{3} \cdot x\right)\right)\right), \left(1 - x\right)\right), B\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(x \cdot \frac{1}{3}\right)\right)\right), \left(1 - x\right)\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(x, \frac{1}{3}\right)\right)\right), \left(1 - x\right)\right), B\right) \]
      11. --lowering--.f6448.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(x, \frac{1}{3}\right)\right)\right), \mathsf{\_.f64}\left(1, x\right)\right), B\right) \]
    8. Simplified48.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.6 \cdot 10^{-48}:\\ \;\;\;\;\frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(-0.16666666666666666 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 + \left(B \cdot B\right) \cdot -0.0001984126984126984\right)\right)\right)} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.05 \cdot 10^{-26}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \left(1 - x\right)}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 28: 44.5% accurate, 12.9× speedup?

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

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

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

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


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

    1. Initial program 71.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6437.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified37.4%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x}{B}} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
      4. neg-mul-1N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) - \frac{\color{blue}{x}}{B} \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\sin B}\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{-1}{\sin B}\right), \left(\frac{x}{B}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      10. /-lowering-/.f6456.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified56.6%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \color{blue}{\left(B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)\right)}\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    10. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \left(\frac{-1}{6} \cdot {B}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \left({B}^{2} \cdot \frac{-1}{6}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({B}^{2}\right), \frac{-1}{6}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(B \cdot B\right), \frac{-1}{6}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      6. *-lowering-*.f6437.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    11. Simplified37.2%

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

    if -9.3999999999999995e-48 < F < 2.29999999999999999e-21

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6439.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified39.1%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6426.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified26.6%

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

    if 2.29999999999999999e-21 < F

    1. Initial program 56.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\sin B}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\sin B}\right)\right) \]
      2. sin-lowering-sin.f6495.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(B\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{sin.f64}\left(B\right)\right)\right) \]
    5. Simplified95.2%

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

      \[\leadsto \color{blue}{\frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x\right), \color{blue}{B}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left({B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right) + 1\right) - x\right), B\right) \]
      3. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right) + \left(1 - x\right)\right), B\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left({B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left({B}^{2}\right), \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(B \cdot B\right), \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right), \left(1 - x\right)\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(\frac{1}{3} \cdot x\right)\right)\right), \left(1 - x\right)\right), B\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \left(x \cdot \frac{1}{3}\right)\right)\right), \left(1 - x\right)\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(x, \frac{1}{3}\right)\right)\right), \left(1 - x\right)\right), B\right) \]
      11. --lowering--.f6448.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(x, \frac{1}{3}\right)\right)\right), \mathsf{\_.f64}\left(1, x\right)\right), B\right) \]
    8. Simplified48.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.4 \cdot 10^{-48}:\\ \;\;\;\;\frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot -0.16666666666666666\right)} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-21}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \left(1 - x\right)}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 29: 44.6% accurate, 15.4× speedup?

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

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

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

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


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

    1. Initial program 71.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 B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6437.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified37.4%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x}{B}} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
      4. neg-mul-1N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) - \frac{\color{blue}{x}}{B} \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\sin B}\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{-1}{\sin B}\right), \left(\frac{x}{B}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      10. /-lowering-/.f6456.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified56.6%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \color{blue}{\left(B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)\right)}\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    10. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \left(\frac{-1}{6} \cdot {B}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \left({B}^{2} \cdot \frac{-1}{6}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({B}^{2}\right), \frac{-1}{6}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(B \cdot B\right), \frac{-1}{6}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
      6. *-lowering-*.f6437.2%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(B, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right)\right)\right)\right), \mathsf{/.f64}\left(x, B\right)\right) \]
    11. Simplified37.2%

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

    if -5.80000000000000016e-50 < F < 5.2e-23

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6439.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified39.1%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6426.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified26.6%

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

    if 5.2e-23 < F

    1. Initial program 56.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6427.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified27.8%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\color{blue}{\left(\frac{F + \frac{1}{6} \cdot \left({B}^{2} \cdot F\right)}{B}\right)}, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(F + \frac{1}{6} \cdot \left({B}^{2} \cdot F\right)\right), B\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right)}, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(F + \left(\frac{1}{6} \cdot {B}^{2}\right) \cdot F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \color{blue}{2}\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      3. distribute-rgt1-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(\frac{1}{6} \cdot {B}^{2} + 1\right) \cdot F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right)}, \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \frac{1}{6} \cdot {B}^{2}\right) \cdot F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, F\right)}, 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(1 + \frac{1}{6} \cdot {B}^{2}\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right)}, \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{6} \cdot {B}^{2}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, F\right)}, 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({B}^{2} \cdot \frac{1}{6}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{F}\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({B}^{2}\right), \frac{1}{6}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{F}\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(B \cdot B\right), \frac{1}{6}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f6420.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{1}{6}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    8. Simplified20.4%

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

      \[\leadsto \color{blue}{\left(\frac{1}{6} \cdot B + \frac{1}{B}\right) - \frac{x}{B}} \]
    10. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{6} \cdot B + \frac{1}{B}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{B} + \frac{1}{6} \cdot B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\frac{1}{B}\right), \left(\frac{1}{6} \cdot B\right)\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(1, B\right), \left(\frac{1}{6} \cdot B\right)\right), \left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(1, B\right), \left(B \cdot \frac{1}{6}\right)\right), \left(\frac{x}{B}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{*.f64}\left(B, \frac{1}{6}\right)\right), \left(\frac{x}{B}\right)\right) \]
      7. /-lowering-/.f6448.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{*.f64}\left(B, \frac{1}{6}\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    11. Simplified48.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-50}:\\ \;\;\;\;\frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot -0.16666666666666666\right)} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5.2 \cdot 10^{-23}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot 0.16666666666666666\right) - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 30: 44.5% accurate, 15.4× speedup?

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

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

\mathbf{elif}\;F \leq 1.55 \cdot 10^{-24}:\\
\;\;\;\;0 - \frac{x}{B}\\

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


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

    1. Initial program 71.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6438.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified38.1%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x}{B}} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{B}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto -1 \cdot \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
      4. neg-mul-1N/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right) - \frac{\color{blue}{x}}{B} \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\sin B}\right)\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\sin B}\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{-1}{\sin B}\right), \left(\frac{x}{B}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \sin B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \left(\frac{x}{B}\right)\right) \]
      10. /-lowering-/.f6456.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{sin.f64}\left(B\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    8. Simplified56.0%

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

      \[\leadsto \color{blue}{\frac{\frac{-1}{6} \cdot {B}^{2} - \left(1 + x\right)}{B}} \]
    10. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{6} \cdot {B}^{2} - \left(1 + x\right)\right), \color{blue}{B}\right) \]
      2. associate--r+N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{-1}{6} \cdot {B}^{2} - 1\right) - x\right), B\right) \]
      3. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{-1}{6} \cdot {B}^{2} + \left(\mathsf{neg}\left(1\right)\right)\right) - x\right), B\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{-1}{6} \cdot {B}^{2} + -1\right) - x\right), B\right) \]
      5. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{6} \cdot {B}^{2} + \left(-1 - x\right)\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\frac{-1}{6} \cdot {B}^{2}\right), \left(-1 - x\right)\right), B\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left({B}^{2} \cdot \frac{-1}{6}\right), \left(-1 - x\right)\right), B\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left({B}^{2}\right), \frac{-1}{6}\right), \left(-1 - x\right)\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(B \cdot B\right), \frac{-1}{6}\right), \left(-1 - x\right)\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right), \left(-1 - x\right)\right), B\right) \]
      11. --lowering--.f6436.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{-1}{6}\right), \mathsf{\_.f64}\left(-1, x\right)\right), B\right) \]
    11. Simplified36.5%

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

    if -1.45000000000000008e-59 < F < 1.55e-24

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6439.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified39.5%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6426.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified26.8%

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

    if 1.55e-24 < F

    1. Initial program 56.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6427.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified27.8%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\color{blue}{\left(\frac{F + \frac{1}{6} \cdot \left({B}^{2} \cdot F\right)}{B}\right)}, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(F + \frac{1}{6} \cdot \left({B}^{2} \cdot F\right)\right), B\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right)}, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(F + \left(\frac{1}{6} \cdot {B}^{2}\right) \cdot F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \color{blue}{2}\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      3. distribute-rgt1-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(\frac{1}{6} \cdot {B}^{2} + 1\right) \cdot F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right)}, \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \frac{1}{6} \cdot {B}^{2}\right) \cdot F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, F\right)}, 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(1 + \frac{1}{6} \cdot {B}^{2}\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right)}, \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{6} \cdot {B}^{2}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, F\right)}, 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({B}^{2} \cdot \frac{1}{6}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{F}\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({B}^{2}\right), \frac{1}{6}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{F}\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(B \cdot B\right), \frac{1}{6}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f6420.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{1}{6}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    8. Simplified20.4%

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

      \[\leadsto \color{blue}{\left(\frac{1}{6} \cdot B + \frac{1}{B}\right) - \frac{x}{B}} \]
    10. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{6} \cdot B + \frac{1}{B}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{B} + \frac{1}{6} \cdot B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\frac{1}{B}\right), \left(\frac{1}{6} \cdot B\right)\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(1, B\right), \left(\frac{1}{6} \cdot B\right)\right), \left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(1, B\right), \left(B \cdot \frac{1}{6}\right)\right), \left(\frac{x}{B}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{*.f64}\left(B, \frac{1}{6}\right)\right), \left(\frac{x}{B}\right)\right) \]
      7. /-lowering-/.f6448.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{*.f64}\left(B, \frac{1}{6}\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    11. Simplified48.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.45 \cdot 10^{-59}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot -0.16666666666666666 + \left(-1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{-24}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot 0.16666666666666666\right) - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 31: 44.5% accurate, 15.4× speedup?

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

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

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

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


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

    1. Initial program 71.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6430.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified30.8%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{\color{blue}{B}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + x\right)\right)\right), \color{blue}{B}\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
      6. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 - x\right), B\right) \]
      7. --lowering--.f6436.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, x\right), B\right) \]
    8. Simplified36.3%

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

    if -1.14000000000000004e-54 < F < 1.59999999999999994e-22

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6439.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified39.5%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6426.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified26.8%

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

    if 1.59999999999999994e-22 < F

    1. Initial program 56.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\frac{x}{B}\right)}\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(F, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6427.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{F}, \mathsf{sin.f64}\left(B\right)\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    5. Simplified27.8%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\color{blue}{\left(\frac{F + \frac{1}{6} \cdot \left({B}^{2} \cdot F\right)}{B}\right)}, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(F + \frac{1}{6} \cdot \left({B}^{2} \cdot F\right)\right), B\right), \mathsf{pow.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right)}, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(F + \left(\frac{1}{6} \cdot {B}^{2}\right) \cdot F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \color{blue}{2}\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      3. distribute-rgt1-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(\frac{1}{6} \cdot {B}^{2} + 1\right) \cdot F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right)}, \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \frac{1}{6} \cdot {B}^{2}\right) \cdot F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, F\right)}, 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(1 + \frac{1}{6} \cdot {B}^{2}\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right)}, \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{6} \cdot {B}^{2}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(F, F\right)}, 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({B}^{2} \cdot \frac{1}{6}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{F}\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({B}^{2}\right), \frac{1}{6}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{F}\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(B \cdot B\right), \frac{1}{6}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f6420.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(x, B\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \frac{1}{6}\right)\right), F\right), B\right), \mathsf{pow.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), 2\right), \mathsf{*.f64}\left(2, x\right)\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, 2\right)\right)\right)\right)\right) \]
    8. Simplified20.4%

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

      \[\leadsto \color{blue}{\left(\frac{1}{6} \cdot B + \frac{1}{B}\right) - \frac{x}{B}} \]
    10. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{6} \cdot B + \frac{1}{B}\right), \color{blue}{\left(\frac{x}{B}\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{B} + \frac{1}{6} \cdot B\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(\frac{1}{B}\right), \left(\frac{1}{6} \cdot B\right)\right), \left(\frac{\color{blue}{x}}{B}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(1, B\right), \left(\frac{1}{6} \cdot B\right)\right), \left(\frac{x}{B}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(1, B\right), \left(B \cdot \frac{1}{6}\right)\right), \left(\frac{x}{B}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{*.f64}\left(B, \frac{1}{6}\right)\right), \left(\frac{x}{B}\right)\right) \]
      7. /-lowering-/.f6448.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(1, B\right), \mathsf{*.f64}\left(B, \frac{1}{6}\right)\right), \mathsf{/.f64}\left(x, \color{blue}{B}\right)\right) \]
    11. Simplified48.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.14 \cdot 10^{-54}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-22}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot 0.16666666666666666\right) - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 32: 44.5% accurate, 21.6× speedup?

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

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

\mathbf{elif}\;F \leq 1.4 \cdot 10^{-22}:\\
\;\;\;\;0 - \frac{x}{B}\\

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


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

    1. Initial program 71.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6430.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified30.8%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{\color{blue}{B}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + x\right)\right)\right), \color{blue}{B}\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
      6. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 - x\right), B\right) \]
      7. --lowering--.f6436.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, x\right), B\right) \]
    8. Simplified36.3%

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

    if -9.0000000000000001e-52 < F < 1.39999999999999997e-22

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6439.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified39.5%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6426.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified26.8%

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

    if 1.39999999999999997e-22 < F

    1. Initial program 56.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6443.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified43.7%

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

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(1 - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f6447.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, x\right), B\right) \]
    8. Simplified47.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-52}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-22}:\\ \;\;\;\;0 - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 33: 37.0% accurate, 32.3× speedup?

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

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

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


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

    1. Initial program 71.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6430.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified30.8%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{\color{blue}{B}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + x\right)\right)\right), \color{blue}{B}\right) \]
      4. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
      6. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 - x\right), B\right) \]
      7. --lowering--.f6436.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, x\right), B\right) \]
    8. Simplified36.3%

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

    if -1.6e-51 < F

    1. Initial program 83.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 B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
      11. *-lowering-*.f6441.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    5. Simplified41.0%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot x\right)}, B\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(x\right)\right), B\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 - x\right), B\right) \]
      3. --lowering--.f6429.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, x\right), B\right) \]
    8. Simplified29.2%

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

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

Alternative 34: 30.3% accurate, 64.8× speedup?

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

\\
\frac{-1 - x}{B}
\end{array}
Derivation
  1. Initial program 79.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 B around 0

    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
  4. Step-by-step derivation
    1. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
    2. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
    4. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
    7. +-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
    8. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    11. *-lowering-*.f6437.4%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
  5. Simplified37.4%

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

    \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
  7. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{\color{blue}{B}} \]
    2. mul-1-negN/A

      \[\leadsto \frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B} \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + x\right)\right)\right), \color{blue}{B}\right) \]
    4. distribute-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\left(-1 + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
    6. unsub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\left(-1 - x\right), B\right) \]
    7. --lowering--.f6426.6%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, x\right), B\right) \]
  8. Simplified26.6%

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

Alternative 35: 10.9% 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 79.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 B around 0

    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
  4. Step-by-step derivation
    1. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x\right), \color{blue}{B}\right) \]
    2. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right), x\right), B\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right), x\right), B\right) \]
    4. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\left(\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}\right)\right)\right), x\right), B\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(2 + \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left(2 \cdot x + {F}^{2}\right)\right)\right)\right)\right), x\right), B\right) \]
    7. +-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \left({F}^{2} + 2 \cdot x\right)\right)\right)\right)\right), x\right), B\right) \]
    8. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left({F}^{2}\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(F \cdot F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \left(2 \cdot x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
    11. *-lowering-*.f6437.4%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(F, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{*.f64}\left(F, F\right), \mathsf{*.f64}\left(2, x\right)\right)\right)\right)\right)\right), x\right), B\right) \]
  5. Simplified37.4%

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

    \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
  7. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{\color{blue}{B}} \]
    2. mul-1-negN/A

      \[\leadsto \frac{\mathsf{neg}\left(\left(1 + x\right)\right)}{B} \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + x\right)\right)\right), \color{blue}{B}\right) \]
    4. distribute-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\left(-1 + \left(\mathsf{neg}\left(x\right)\right)\right), B\right) \]
    6. unsub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\left(-1 - x\right), B\right) \]
    7. --lowering--.f6426.6%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, x\right), B\right) \]
  8. Simplified26.6%

    \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]
  9. Taylor expanded in x around 0

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  10. Step-by-step derivation
    1. /-lowering-/.f649.3%

      \[\leadsto \mathsf{/.f64}\left(-1, \color{blue}{B}\right) \]
  11. Simplified9.3%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  12. Add Preprocessing

Reproduce

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