VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.0% → 98.9%
Time: 7.9s
Alternatives: 25
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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    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}

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 25 alternatives:

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

Initial Program: 77.0% 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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

Alternative 1: 98.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.25}\\
t_1 := \cos B \cdot x\\
\mathbf{if}\;F \leq -120000:\\
\;\;\;\;\frac{0.5 \cdot \mathsf{fma}\left(2, x, 2\right)}{\left(F \cdot F\right) \cdot \sin B} - \frac{1 + t\_1}{\sin B}\\

\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left(t\_0 \cdot t\_0\right)\\

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


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

    1. Initial program 59.2%

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

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

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

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

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

    if -1.2e5 < F < 1.94999999999999992e-8

    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. Step-by-step derivation
      1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

    if 1.94999999999999992e-8 < F

    1. Initial program 59.6%

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

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

        \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
      2. lower-/.f64N/A

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

        \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
      4. *-commutativeN/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      6. lower-cos.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      7. lift-sin.f6498.4

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
    5. Applied rewrites98.4%

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

Alternative 2: 98.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\sin B}\\

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


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

    1. Initial program 59.2%

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

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

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

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

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

    if -1.2e5 < F < 1.94999999999999992e-8

    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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
      12. lower-*.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
    4. Applied rewrites99.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}} \cdot \frac{F}{\sin B} \]
      11. inv-powN/A

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

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

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

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

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

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

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

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

    if 1.94999999999999992e-8 < F

    1. Initial program 59.6%

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

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

        \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
      2. lower-/.f64N/A

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

        \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
      4. *-commutativeN/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      6. lower-cos.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      7. lift-sin.f6498.4

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
    5. Applied rewrites98.4%

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

Alternative 3: 99.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{+33}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\

\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot 1}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\

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


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

    1. Initial program 55.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 \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
      3. div-add-revN/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      4. lower-/.f64N/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      5. lower-+.f64N/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      6. *-commutativeN/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      7. lower-*.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      8. lower-cos.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      9. lift-sin.f6499.7

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
    5. Applied rewrites99.7%

      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
    6. Step-by-step derivation
      1. metadata-eval99.7

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      2. metadata-eval99.7

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      3. associate-*l/99.7

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

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      5. lift-neg.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{1 + \cos B \cdot x}{\sin B}\right) \]
      6. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{1 + \cos B \cdot x}{\sin B}\right) \]
    7. Applied rewrites99.7%

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

    if -3.9999999999999998e33 < F < 1.94999999999999992e-8

    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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
      12. lower-*.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
    4. Applied rewrites99.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}} \cdot \frac{F}{\sin B} \]
      11. inv-powN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 \cdot x + \left(F \cdot F + 2\right)}}} \]
      9. pow2N/A

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + \color{blue}{F \cdot F}\right)}} \]
      13. frac-timesN/A

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

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

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

    if 1.94999999999999992e-8 < F

    1. Initial program 59.6%

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

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

        \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
      2. lower-/.f64N/A

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

        \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
      4. *-commutativeN/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      6. lower-cos.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      7. lift-sin.f6498.4

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
    5. Applied rewrites98.4%

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

Alternative 4: 91.9% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\\
\mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\

\mathbf{elif}\;F \leq 1.25 \cdot 10^{-132}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sqrt{t\_0}} \cdot \frac{F}{B}\\

\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + F \cdot \frac{{t\_0}^{-0.5}}{\sin B}\\

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


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

    1. Initial program 57.6%

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

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

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
      3. div-add-revN/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      4. lower-/.f64N/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      5. lower-+.f64N/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      6. *-commutativeN/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      7. lower-*.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      8. lower-cos.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      9. lift-sin.f6499.7

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
    5. Applied rewrites99.7%

      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
    6. Step-by-step derivation
      1. metadata-eval99.7

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      2. metadata-eval99.7

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      3. associate-*l/99.7

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

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      5. lift-neg.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{1 + \cos B \cdot x}{\sin B}\right) \]
      6. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{1 + \cos B \cdot x}{\sin B}\right) \]
    7. Applied rewrites99.7%

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

    if -4e20 < F < 1.25e-132

    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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
      12. lower-*.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
    4. Applied rewrites99.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}} \cdot \frac{F}{\sin B} \]
      11. inv-powN/A

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\color{blue}{B}} \]
    8. Step-by-step derivation
      1. Applied rewrites84.6%

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

      if 1.25e-132 < F < 1.94999999999999992e-8

      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. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot {\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}^{\frac{-1}{2}}}{\color{blue}{\sin B}} \]
        7. associate-/l*N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \]
      8. Step-by-step derivation
        1. lower-/.f6477.6

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

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

      if 1.94999999999999992e-8 < F

      1. Initial program 59.6%

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

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

          \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
        2. lower-/.f64N/A

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

          \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
        4. *-commutativeN/A

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        5. lower-*.f64N/A

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        6. lower-cos.f64N/A

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        7. lift-sin.f6498.4

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      5. Applied rewrites98.4%

        \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
    9. Recombined 4 regimes into one program.
    10. Add Preprocessing

    Alternative 5: 91.9% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\ \mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + t\_0 \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (let* ((t_0 (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))))
       (if (<= F -4e+20)
         (/ (- (fma (cos B) x 1.0)) (sin B))
         (if (<= F 1.1e-132)
           (+ (- (* x (/ 1.0 (tan B)))) (* t_0 (/ F B)))
           (if (<= F 1.95e-8)
             (+ (- (/ x B)) (* t_0 (/ F (sin B))))
             (/ (- 1.0 (* (cos B) x)) (sin B)))))))
    double code(double F, double B, double x) {
    	double t_0 = 1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)));
    	double tmp;
    	if (F <= -4e+20) {
    		tmp = -fma(cos(B), x, 1.0) / sin(B);
    	} else if (F <= 1.1e-132) {
    		tmp = -(x * (1.0 / tan(B))) + (t_0 * (F / B));
    	} else if (F <= 1.95e-8) {
    		tmp = -(x / B) + (t_0 * (F / sin(B)));
    	} else {
    		tmp = (1.0 - (cos(B) * x)) / sin(B);
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	t_0 = Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))
    	tmp = 0.0
    	if (F <= -4e+20)
    		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
    	elseif (F <= 1.1e-132)
    		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(t_0 * Float64(F / B)));
    	elseif (F <= 1.95e-8)
    		tmp = Float64(Float64(-Float64(x / B)) + Float64(t_0 * Float64(F / sin(B))));
    	else
    		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+20], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e-132], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[((-N[(x / B), $MachinePrecision]) + N[(t$95$0 * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
    \mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\
    \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
    
    \mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\
    \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + t\_0 \cdot \frac{F}{B}\\
    
    \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
    \;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot \frac{F}{\sin B}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if F < -4e20

      1. Initial program 57.6%

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

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

          \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
        2. lower-neg.f64N/A

          \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
        3. div-add-revN/A

          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
        4. lower-/.f64N/A

          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
        5. lower-+.f64N/A

          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
        6. *-commutativeN/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        7. lower-*.f64N/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        8. lower-cos.f64N/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        9. lift-sin.f6499.7

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      5. Applied rewrites99.7%

        \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
      6. Step-by-step derivation
        1. metadata-eval99.7

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        2. metadata-eval99.7

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        3. associate-*l/99.7

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

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        5. lift-neg.f64N/A

          \[\leadsto \mathsf{neg}\left(\frac{1 + \cos B \cdot x}{\sin B}\right) \]
        6. lift-/.f64N/A

          \[\leadsto \mathsf{neg}\left(\frac{1 + \cos B \cdot x}{\sin B}\right) \]
      7. Applied rewrites99.7%

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

      if -4e20 < F < 1.09999999999999995e-132

      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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
        12. lower-*.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
      4. Applied rewrites99.4%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}} \cdot \frac{F}{\sin B} \]
        11. inv-powN/A

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\color{blue}{B}} \]
      8. Step-by-step derivation
        1. Applied rewrites84.6%

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

        if 1.09999999999999995e-132 < F < 1.94999999999999992e-8

        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. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
          12. lower-*.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
        4. Applied rewrites99.5%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}} \cdot \frac{F}{\sin B} \]
          11. inv-powN/A

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

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

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

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

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

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

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

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

          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\sin B} \]
        8. Step-by-step derivation
          1. lower-/.f6477.5

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

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

        if 1.94999999999999992e-8 < F

        1. Initial program 59.6%

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

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

            \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
          2. lower-/.f64N/A

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

            \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
          4. *-commutativeN/A

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
          5. lower-*.f64N/A

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
          6. lower-cos.f64N/A

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
          7. lift-sin.f6498.4

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        5. Applied rewrites98.4%

          \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
      9. Recombined 4 regimes into one program.
      10. Add Preprocessing

      Alternative 6: 84.9% accurate, 1.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\ t_1 := -x \cdot \frac{1}{\tan B}\\ \mathbf{if}\;F \leq -5 \cdot 10^{+21}:\\ \;\;\;\;t\_1 + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\ \;\;\;\;t\_1 + t\_0 \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
      (FPCore (F B x)
       :precision binary64
       (let* ((t_0 (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0)))))
              (t_1 (- (* x (/ 1.0 (tan B))))))
         (if (<= F -5e+21)
           (+ t_1 (/ -1.0 B))
           (if (<= F 1.1e-132)
             (+ t_1 (* t_0 (/ F B)))
             (if (<= F 1.95e-8)
               (+ (- (/ x B)) (* t_0 (/ F (sin B))))
               (/ (- 1.0 (* (cos B) x)) (sin B)))))))
      double code(double F, double B, double x) {
      	double t_0 = 1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)));
      	double t_1 = -(x * (1.0 / tan(B)));
      	double tmp;
      	if (F <= -5e+21) {
      		tmp = t_1 + (-1.0 / B);
      	} else if (F <= 1.1e-132) {
      		tmp = t_1 + (t_0 * (F / B));
      	} else if (F <= 1.95e-8) {
      		tmp = -(x / B) + (t_0 * (F / sin(B)));
      	} else {
      		tmp = (1.0 - (cos(B) * x)) / sin(B);
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	t_0 = Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))
      	t_1 = Float64(-Float64(x * Float64(1.0 / tan(B))))
      	tmp = 0.0
      	if (F <= -5e+21)
      		tmp = Float64(t_1 + Float64(-1.0 / B));
      	elseif (F <= 1.1e-132)
      		tmp = Float64(t_1 + Float64(t_0 * Float64(F / B)));
      	elseif (F <= 1.95e-8)
      		tmp = Float64(Float64(-Float64(x / B)) + Float64(t_0 * Float64(F / sin(B))));
      	else
      		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
      	end
      	return tmp
      end
      
      code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -5e+21], N[(t$95$1 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e-132], N[(t$95$1 + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[((-N[(x / B), $MachinePrecision]) + N[(t$95$0 * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
      t_1 := -x \cdot \frac{1}{\tan B}\\
      \mathbf{if}\;F \leq -5 \cdot 10^{+21}:\\
      \;\;\;\;t\_1 + \frac{-1}{B}\\
      
      \mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\
      \;\;\;\;t\_1 + t\_0 \cdot \frac{F}{B}\\
      
      \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
      \;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot \frac{F}{\sin B}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if F < -5e21

        1. Initial program 57.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
          4. inv-powN/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
          5. lower-pow.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
          6. +-commutativeN/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
          7. lower-+.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
          8. lower-fma.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
          9. pow2N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
          10. lift-*.f6444.8

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
        5. Applied rewrites44.8%

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
        7. Step-by-step derivation
          1. lower-/.f6473.3

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
        8. Applied rewrites73.3%

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

        if -5e21 < F < 1.09999999999999995e-132

        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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
          12. lower-*.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
        4. Applied rewrites99.4%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}} \cdot \frac{F}{\sin B} \]
          11. inv-powN/A

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

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\color{blue}{B}} \]
        8. Step-by-step derivation
          1. Applied rewrites84.5%

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

          if 1.09999999999999995e-132 < F < 1.94999999999999992e-8

          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. Step-by-step derivation
            1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
            12. lower-*.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
          4. Applied rewrites99.5%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}} \cdot \frac{F}{\sin B} \]
            11. inv-powN/A

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

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

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

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

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

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

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

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

            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\sin B} \]
          8. Step-by-step derivation
            1. lower-/.f6477.5

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

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

          if 1.94999999999999992e-8 < F

          1. Initial program 59.6%

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

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

              \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
            2. lower-/.f64N/A

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

              \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
            4. *-commutativeN/A

              \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
            5. lower-*.f64N/A

              \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
            6. lower-cos.f64N/A

              \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
            7. lift-sin.f6498.4

              \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
          5. Applied rewrites98.4%

            \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
        9. Recombined 4 regimes into one program.
        10. Add Preprocessing

        Alternative 7: 73.8% accurate, 1.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\ t_1 := -x \cdot \frac{1}{\tan B}\\ \mathbf{if}\;F \leq -5 \cdot 10^{+21}:\\ \;\;\;\;t\_1 + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\ \;\;\;\;t\_1 + t\_0 \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 2.65 \cdot 10^{+137}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
        (FPCore (F B x)
         :precision binary64
         (let* ((t_0 (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0)))))
                (t_1 (- (* x (/ 1.0 (tan B))))))
           (if (<= F -5e+21)
             (+ t_1 (/ -1.0 B))
             (if (<= F 1.1e-132)
               (+ t_1 (* t_0 (/ F B)))
               (if (<= F 2.65e+137)
                 (+ (- (/ x B)) (* t_0 (/ F (sin B))))
                 (- (/ (* (cos B) x) (sin B))))))))
        double code(double F, double B, double x) {
        	double t_0 = 1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)));
        	double t_1 = -(x * (1.0 / tan(B)));
        	double tmp;
        	if (F <= -5e+21) {
        		tmp = t_1 + (-1.0 / B);
        	} else if (F <= 1.1e-132) {
        		tmp = t_1 + (t_0 * (F / B));
        	} else if (F <= 2.65e+137) {
        		tmp = -(x / B) + (t_0 * (F / sin(B)));
        	} else {
        		tmp = -((cos(B) * x) / sin(B));
        	}
        	return tmp;
        }
        
        function code(F, B, x)
        	t_0 = Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))
        	t_1 = Float64(-Float64(x * Float64(1.0 / tan(B))))
        	tmp = 0.0
        	if (F <= -5e+21)
        		tmp = Float64(t_1 + Float64(-1.0 / B));
        	elseif (F <= 1.1e-132)
        		tmp = Float64(t_1 + Float64(t_0 * Float64(F / B)));
        	elseif (F <= 2.65e+137)
        		tmp = Float64(Float64(-Float64(x / B)) + Float64(t_0 * Float64(F / sin(B))));
        	else
        		tmp = Float64(-Float64(Float64(cos(B) * x) / sin(B)));
        	end
        	return tmp
        end
        
        code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -5e+21], N[(t$95$1 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e-132], N[(t$95$1 + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e+137], N[((-N[(x / B), $MachinePrecision]) + N[(t$95$0 * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision])]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
        t_1 := -x \cdot \frac{1}{\tan B}\\
        \mathbf{if}\;F \leq -5 \cdot 10^{+21}:\\
        \;\;\;\;t\_1 + \frac{-1}{B}\\
        
        \mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\
        \;\;\;\;t\_1 + t\_0 \cdot \frac{F}{B}\\
        
        \mathbf{elif}\;F \leq 2.65 \cdot 10^{+137}:\\
        \;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot \frac{F}{\sin B}\\
        
        \mathbf{else}:\\
        \;\;\;\;-\frac{\cos B \cdot x}{\sin B}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if F < -5e21

          1. Initial program 57.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
          4. Step-by-step derivation
            1. lower-*.f64N/A

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
            4. inv-powN/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
            5. lower-pow.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
            6. +-commutativeN/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
            7. lower-+.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
            8. lower-fma.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
            9. pow2N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
            10. lift-*.f6444.8

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
          5. Applied rewrites44.8%

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
          7. Step-by-step derivation
            1. lower-/.f6473.3

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
          8. Applied rewrites73.3%

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

          if -5e21 < F < 1.09999999999999995e-132

          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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
            12. lower-*.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
          4. Applied rewrites99.4%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}} \cdot \frac{F}{\sin B} \]
            11. inv-powN/A

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

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

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

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

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

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\color{blue}{B}} \]
          8. Step-by-step derivation
            1. Applied rewrites84.5%

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

            if 1.09999999999999995e-132 < F < 2.64999999999999984e137

            1. Initial program 94.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. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
              12. lower-*.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
            4. Applied rewrites94.1%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}} \cdot \frac{F}{\sin B} \]
              11. inv-powN/A

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

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

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

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

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

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

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

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

              \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\sin B} \]
            8. Step-by-step derivation
              1. lower-/.f6474.0

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

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

            if 2.64999999999999984e137 < F

            1. Initial program 37.1%

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

              \[\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. lower-neg.f64N/A

                \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
              3. lower-/.f64N/A

                \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
              4. *-commutativeN/A

                \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
              5. lower-*.f64N/A

                \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
              6. lower-cos.f64N/A

                \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
              7. lift-sin.f6450.4

                \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
            5. Applied rewrites50.4%

              \[\leadsto \color{blue}{-\frac{\cos B \cdot x}{\sin B}} \]
          9. Recombined 4 regimes into one program.
          10. Add Preprocessing

          Alternative 8: 73.8% accurate, 2.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\ t_1 := -x \cdot \frac{1}{\tan B}\\ t_2 := t\_1 + \frac{-1}{B}\\ \mathbf{if}\;F \leq -5 \cdot 10^{+21}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\ \;\;\;\;t\_1 + t\_0 \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 2.65 \cdot 10^{+137}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{+185}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
          (FPCore (F B x)
           :precision binary64
           (let* ((t_0 (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0)))))
                  (t_1 (- (* x (/ 1.0 (tan B)))))
                  (t_2 (+ t_1 (/ -1.0 B))))
             (if (<= F -5e+21)
               t_2
               (if (<= F 1.1e-132)
                 (+ t_1 (* t_0 (/ F B)))
                 (if (<= F 2.65e+137)
                   (+ (- (/ x B)) (* t_0 (/ F (sin B))))
                   (if (<= F 1.4e+185) t_2 (/ (- 1.0 x) B)))))))
          double code(double F, double B, double x) {
          	double t_0 = 1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)));
          	double t_1 = -(x * (1.0 / tan(B)));
          	double t_2 = t_1 + (-1.0 / B);
          	double tmp;
          	if (F <= -5e+21) {
          		tmp = t_2;
          	} else if (F <= 1.1e-132) {
          		tmp = t_1 + (t_0 * (F / B));
          	} else if (F <= 2.65e+137) {
          		tmp = -(x / B) + (t_0 * (F / sin(B)));
          	} else if (F <= 1.4e+185) {
          		tmp = t_2;
          	} else {
          		tmp = (1.0 - x) / B;
          	}
          	return tmp;
          }
          
          function code(F, B, x)
          	t_0 = Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))
          	t_1 = Float64(-Float64(x * Float64(1.0 / tan(B))))
          	t_2 = Float64(t_1 + Float64(-1.0 / B))
          	tmp = 0.0
          	if (F <= -5e+21)
          		tmp = t_2;
          	elseif (F <= 1.1e-132)
          		tmp = Float64(t_1 + Float64(t_0 * Float64(F / B)));
          	elseif (F <= 2.65e+137)
          		tmp = Float64(Float64(-Float64(x / B)) + Float64(t_0 * Float64(F / sin(B))));
          	elseif (F <= 1.4e+185)
          		tmp = t_2;
          	else
          		tmp = Float64(Float64(1.0 - x) / B);
          	end
          	return tmp
          end
          
          code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$2 = N[(t$95$1 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5e+21], t$95$2, If[LessEqual[F, 1.1e-132], N[(t$95$1 + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e+137], N[((-N[(x / B), $MachinePrecision]) + N[(t$95$0 * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e+185], t$95$2, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
          t_1 := -x \cdot \frac{1}{\tan B}\\
          t_2 := t\_1 + \frac{-1}{B}\\
          \mathbf{if}\;F \leq -5 \cdot 10^{+21}:\\
          \;\;\;\;t\_2\\
          
          \mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\
          \;\;\;\;t\_1 + t\_0 \cdot \frac{F}{B}\\
          
          \mathbf{elif}\;F \leq 2.65 \cdot 10^{+137}:\\
          \;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot \frac{F}{\sin B}\\
          
          \mathbf{elif}\;F \leq 1.4 \cdot 10^{+185}:\\
          \;\;\;\;t\_2\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{1 - x}{B}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if F < -5e21 or 2.64999999999999984e137 < F < 1.39999999999999991e185

            1. Initial program 57.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 B around 0

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
            4. Step-by-step derivation
              1. lower-*.f64N/A

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

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
              4. inv-powN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
              5. lower-pow.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
              6. +-commutativeN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
              7. lower-+.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
              8. lower-fma.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
              9. pow2N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
              10. lift-*.f6445.2

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
            5. Applied rewrites45.2%

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
            7. Step-by-step derivation
              1. lower-/.f6470.3

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
            8. Applied rewrites70.3%

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

            if -5e21 < F < 1.09999999999999995e-132

            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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
              12. lower-*.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
            4. Applied rewrites99.4%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}} \cdot \frac{F}{\sin B} \]
              11. inv-powN/A

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

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

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

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

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

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\color{blue}{B}} \]
            8. Step-by-step derivation
              1. Applied rewrites84.5%

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

              if 1.09999999999999995e-132 < F < 2.64999999999999984e137

              1. Initial program 94.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. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
                12. lower-*.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
              4. Applied rewrites94.1%

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}} \cdot \frac{F}{\sin B} \]
                11. inv-powN/A

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

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

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

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

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

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

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

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

                \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\sin B} \]
              8. Step-by-step derivation
                1. lower-/.f6474.0

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

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

              if 1.39999999999999991e185 < F

              1. Initial program 29.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
              4. Step-by-step derivation
                1. lower-/.f64N/A

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

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

                \[\leadsto \frac{1 - x}{B} \]
              7. Step-by-step derivation
                1. Applied rewrites49.2%

                  \[\leadsto \frac{1 - x}{B} \]
              8. Recombined 4 regimes into one program.
              9. Add Preprocessing

              Alternative 9: 73.8% accurate, 2.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := -x \cdot \frac{1}{\tan B}\\ t_1 := t\_0 + \frac{-1}{B}\\ t_2 := \mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\\ \mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\ \;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{t\_2}}\\ \mathbf{elif}\;F \leq 2.65 \cdot 10^{+137}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sqrt{t\_2}} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{+185}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
              (FPCore (F B x)
               :precision binary64
               (let* ((t_0 (- (* x (/ 1.0 (tan B)))))
                      (t_1 (+ t_0 (/ -1.0 B)))
                      (t_2 (fma 2.0 x (fma F F 2.0))))
                 (if (<= F -4e+20)
                   t_1
                   (if (<= F 1.1e-132)
                     (+ t_0 (* (/ F B) (sqrt (/ 1.0 t_2))))
                     (if (<= F 2.65e+137)
                       (+ (- (/ x B)) (* (/ 1.0 (sqrt t_2)) (/ F (sin B))))
                       (if (<= F 1.4e+185) t_1 (/ (- 1.0 x) B)))))))
              double code(double F, double B, double x) {
              	double t_0 = -(x * (1.0 / tan(B)));
              	double t_1 = t_0 + (-1.0 / B);
              	double t_2 = fma(2.0, x, fma(F, F, 2.0));
              	double tmp;
              	if (F <= -4e+20) {
              		tmp = t_1;
              	} else if (F <= 1.1e-132) {
              		tmp = t_0 + ((F / B) * sqrt((1.0 / t_2)));
              	} else if (F <= 2.65e+137) {
              		tmp = -(x / B) + ((1.0 / sqrt(t_2)) * (F / sin(B)));
              	} else if (F <= 1.4e+185) {
              		tmp = t_1;
              	} else {
              		tmp = (1.0 - x) / B;
              	}
              	return tmp;
              }
              
              function code(F, B, x)
              	t_0 = Float64(-Float64(x * Float64(1.0 / tan(B))))
              	t_1 = Float64(t_0 + Float64(-1.0 / B))
              	t_2 = fma(2.0, x, fma(F, F, 2.0))
              	tmp = 0.0
              	if (F <= -4e+20)
              		tmp = t_1;
              	elseif (F <= 1.1e-132)
              		tmp = Float64(t_0 + Float64(Float64(F / B) * sqrt(Float64(1.0 / t_2))));
              	elseif (F <= 2.65e+137)
              		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(1.0 / sqrt(t_2)) * Float64(F / sin(B))));
              	elseif (F <= 1.4e+185)
              		tmp = t_1;
              	else
              		tmp = Float64(Float64(1.0 - x) / B);
              	end
              	return tmp
              end
              
              code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$1 = N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+20], t$95$1, If[LessEqual[F, 1.1e-132], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e+137], N[((-N[(x / B), $MachinePrecision]) + N[(N[(1.0 / N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e+185], t$95$1, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := -x \cdot \frac{1}{\tan B}\\
              t_1 := t\_0 + \frac{-1}{B}\\
              t_2 := \mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\\
              \mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\
              \;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{t\_2}}\\
              
              \mathbf{elif}\;F \leq 2.65 \cdot 10^{+137}:\\
              \;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sqrt{t\_2}} \cdot \frac{F}{\sin B}\\
              
              \mathbf{elif}\;F \leq 1.4 \cdot 10^{+185}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{1 - x}{B}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if F < -4e20 or 2.64999999999999984e137 < F < 1.39999999999999991e185

                1. Initial program 57.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                4. Step-by-step derivation
                  1. lower-*.f64N/A

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

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                  4. inv-powN/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                  5. lower-pow.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                  6. +-commutativeN/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                  7. lower-+.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                  8. lower-fma.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
                  9. pow2N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                  10. lift-*.f6445.3

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                5. Applied rewrites45.3%

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
                7. Step-by-step derivation
                  1. lower-/.f6470.3

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
                8. Applied rewrites70.3%

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

                if -4e20 < F < 1.09999999999999995e-132

                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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                4. Step-by-step derivation
                  1. lower-*.f64N/A

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

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                  4. inv-powN/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                  5. lower-pow.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                  6. +-commutativeN/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                  7. lower-+.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                  8. lower-fma.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
                  9. pow2N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                  10. lift-*.f6484.6

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

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                  2. lift-+.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                  3. lift-*.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                  4. lift-fma.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \]
                  5. unpow-1N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \]
                  6. lower-/.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \]
                  7. pow2N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                  8. associate-+r+N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \]
                  9. pow2N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \]
                  10. lift-fma.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \]
                  11. lift-fma.f6484.6

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \]
                7. Applied rewrites84.6%

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

                if 1.09999999999999995e-132 < F < 2.64999999999999984e137

                1. Initial program 94.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. Step-by-step derivation
                  1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
                  12. lower-*.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
                4. Applied rewrites94.1%

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}} \cdot \frac{F}{\sin B} \]
                  11. inv-powN/A

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\sin B} \]
                8. Step-by-step derivation
                  1. lower-/.f6474.0

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

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

                if 1.39999999999999991e185 < F

                1. Initial program 29.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                4. Step-by-step derivation
                  1. lower-/.f64N/A

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

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

                  \[\leadsto \frac{1 - x}{B} \]
                7. Step-by-step derivation
                  1. Applied rewrites49.2%

                    \[\leadsto \frac{1 - x}{B} \]
                8. Recombined 4 regimes into one program.
                9. Add Preprocessing

                Alternative 10: 74.7% accurate, 2.1× speedup?

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

                  1. Initial program 83.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                  4. Step-by-step derivation
                    1. lower-*.f64N/A

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                    4. inv-powN/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                    5. lower-pow.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                    6. +-commutativeN/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                    7. lower-+.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                    8. lower-fma.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
                    9. pow2N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                    10. lift-*.f6482.3

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                  5. Applied rewrites82.3%

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
                  7. Step-by-step derivation
                    1. lower-/.f6494.2

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
                  8. Applied rewrites94.2%

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

                  if -1.09999999999999997e-35 < x < 1e9

                  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. Step-by-step derivation
                    1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
                    12. lower-*.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\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}} \]
                  4. Applied rewrites72.2%

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}} \cdot \frac{F}{\sin B} \]
                    11. inv-powN/A

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\sin B} \]
                  8. Step-by-step derivation
                    1. lower-/.f6459.9

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

                    \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\sin B} \]
                3. Recombined 2 regimes into one program.
                4. Add Preprocessing

                Alternative 11: 55.6% accurate, 2.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{if}\;B \leq 0.0064:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\ \end{array} \end{array} \]
                (FPCore (F B x)
                 :precision binary64
                 (let* ((t_0 (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
                   (if (<= B 0.0064)
                     (/
                      (-
                       (fma
                        F
                        t_0
                        (*
                         (* B B)
                         (fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))))
                       x)
                      B)
                     (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B)))))
                double code(double F, double B, double x) {
                	double t_0 = 1.0 / sqrt((2.0 + fma(2.0, x, (F * F))));
                	double tmp;
                	if (B <= 0.0064) {
                		tmp = (fma(F, t_0, ((B * B) * fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)))) - x) / B;
                	} else {
                		tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
                	}
                	return tmp;
                }
                
                function code(F, B, x)
                	t_0 = Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F)))))
                	tmp = 0.0
                	if (B <= 0.0064)
                		tmp = Float64(Float64(fma(F, t_0, Float64(Float64(B * B) * fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)))) - x) / B);
                	else
                		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B));
                	end
                	return tmp
                end
                
                code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 0.0064], N[(N[(N[(F * t$95$0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $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}
                t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
                \mathbf{if}\;B \leq 0.0064:\\
                \;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if B < 0.00640000000000000031

                  1. Initial program 74.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. lower-/.f64N/A

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

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

                    \[\leadsto \frac{-1 \cdot x}{B} \]
                  7. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                    2. lower-neg.f6438.5

                      \[\leadsto \frac{-x}{B} \]
                  8. Applied rewrites38.5%

                    \[\leadsto \frac{-x}{B} \]
                  9. 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}} \]
                  10. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \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}{\color{blue}{B}} \]
                  11. Applied rewrites57.3%

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

                  if 0.00640000000000000031 < B

                  1. Initial program 84.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 B around 0

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                  4. Step-by-step derivation
                    1. lower-*.f64N/A

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                    4. inv-powN/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                    5. lower-pow.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                    6. +-commutativeN/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                    7. lower-+.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                    8. lower-fma.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
                    9. pow2N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                    10. lift-*.f6455.8

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                  5. Applied rewrites55.8%

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
                  8. Applied rewrites50.6%

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

                Alternative 12: 57.7% accurate, 2.9× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 4 \cdot 10^{+86}:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                (FPCore (F B x)
                 :precision binary64
                 (let* ((t_0 (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
                   (if (<= F -4e+20)
                     (- (/ (+ 1.0 x) (sin B)))
                     (if (<= F 4e+86)
                       (/
                        (-
                         (fma
                          F
                          t_0
                          (*
                           (* B B)
                           (fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))))
                         x)
                        B)
                       (/ (- 1.0 x) B)))))
                double code(double F, double B, double x) {
                	double t_0 = 1.0 / sqrt((2.0 + fma(2.0, x, (F * F))));
                	double tmp;
                	if (F <= -4e+20) {
                		tmp = -((1.0 + x) / sin(B));
                	} else if (F <= 4e+86) {
                		tmp = (fma(F, t_0, ((B * B) * fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)))) - x) / B;
                	} else {
                		tmp = (1.0 - x) / B;
                	}
                	return tmp;
                }
                
                function code(F, B, x)
                	t_0 = Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F)))))
                	tmp = 0.0
                	if (F <= -4e+20)
                		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
                	elseif (F <= 4e+86)
                		tmp = Float64(Float64(fma(F, t_0, Float64(Float64(B * B) * fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)))) - x) / B);
                	else
                		tmp = Float64(Float64(1.0 - x) / B);
                	end
                	return tmp
                end
                
                code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+20], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 4e+86], N[(N[(N[(F * t$95$0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
                \mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\
                \;\;\;\;-\frac{1 + x}{\sin B}\\
                
                \mathbf{elif}\;F \leq 4 \cdot 10^{+86}:\\
                \;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{1 - x}{B}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if F < -4e20

                  1. Initial program 57.6%

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

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

                      \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                    2. lower-neg.f64N/A

                      \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                    3. div-add-revN/A

                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                    4. lower-/.f64N/A

                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                    5. lower-+.f64N/A

                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                    6. *-commutativeN/A

                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                    7. lower-*.f64N/A

                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                    8. lower-cos.f64N/A

                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                    9. lift-sin.f6499.7

                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                  5. Applied rewrites99.7%

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

                    \[\leadsto -\frac{1 + x}{\sin B} \]
                  7. Step-by-step derivation
                    1. Applied rewrites77.9%

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

                    if -4e20 < F < 4.0000000000000001e86

                    1. Initial program 98.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. lower-/.f64N/A

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

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

                      \[\leadsto \frac{-1 \cdot x}{B} \]
                    7. Step-by-step derivation
                      1. mul-1-negN/A

                        \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                      2. lower-neg.f6433.0

                        \[\leadsto \frac{-x}{B} \]
                    8. Applied rewrites33.0%

                      \[\leadsto \frac{-x}{B} \]
                    9. 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}} \]
                    10. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \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}{\color{blue}{B}} \]
                    11. Applied rewrites50.8%

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

                    if 4.0000000000000001e86 < F

                    1. Initial program 47.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. lower-/.f64N/A

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

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

                      \[\leadsto \frac{1 - x}{B} \]
                    7. Step-by-step derivation
                      1. Applied rewrites49.4%

                        \[\leadsto \frac{1 - x}{B} \]
                    8. Recombined 3 regimes into one program.
                    9. Add Preprocessing

                    Alternative 13: 50.9% accurate, 3.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.2 \cdot 10^{+99}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - \mathsf{fma}\left(0.041666666666666664, x, 0.019444444444444445\right), -0.16666666666666666 \cdot x\right) - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\ \mathbf{elif}\;F \leq -9 \cdot 10^{+22}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+140}:\\ \;\;\;\;\left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                    (FPCore (F B x)
                     :precision binary64
                     (if (<= F -4.2e+99)
                       (/
                        (-
                         (*
                          (* B B)
                          (-
                           (fma
                            (* B B)
                            (-
                             (fma
                              -0.16666666666666666
                              (* x -0.3333333333333333)
                              (* 0.008333333333333333 x))
                             (fma 0.041666666666666664 x 0.019444444444444445))
                            (* -0.16666666666666666 x))
                           (fma -0.5 x 0.16666666666666666)))
                         (+ 1.0 x))
                        B)
                       (if (<= F -9e+22)
                         (/ -1.0 (sin B))
                         (if (<= F 1.8e+140)
                           (+
                            (-
                             (*
                              x
                              (/
                               (fma
                                (* B B)
                                (-
                                 (*
                                  (* B B)
                                  (- (* -0.0021164021164021165 (* B B)) 0.022222222222222223))
                                 0.3333333333333333)
                                1.0)
                               B)))
                            (/ (* F 1.0) (* B (sqrt (fma F F (fma 2.0 x 2.0))))))
                           (/ (- 1.0 x) B)))))
                    double code(double F, double B, double x) {
                    	double tmp;
                    	if (F <= -4.2e+99) {
                    		tmp = (((B * B) * (fma((B * B), (fma(-0.16666666666666666, (x * -0.3333333333333333), (0.008333333333333333 * x)) - fma(0.041666666666666664, x, 0.019444444444444445)), (-0.16666666666666666 * x)) - fma(-0.5, x, 0.16666666666666666))) - (1.0 + x)) / B;
                    	} else if (F <= -9e+22) {
                    		tmp = -1.0 / sin(B);
                    	} else if (F <= 1.8e+140) {
                    		tmp = -(x * (fma((B * B), (((B * B) * ((-0.0021164021164021165 * (B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B)) + ((F * 1.0) / (B * sqrt(fma(F, F, fma(2.0, x, 2.0)))));
                    	} else {
                    		tmp = (1.0 - x) / B;
                    	}
                    	return tmp;
                    }
                    
                    function code(F, B, x)
                    	tmp = 0.0
                    	if (F <= -4.2e+99)
                    		tmp = Float64(Float64(Float64(Float64(B * B) * Float64(fma(Float64(B * B), Float64(fma(-0.16666666666666666, Float64(x * -0.3333333333333333), Float64(0.008333333333333333 * x)) - fma(0.041666666666666664, x, 0.019444444444444445)), Float64(-0.16666666666666666 * x)) - fma(-0.5, x, 0.16666666666666666))) - Float64(1.0 + x)) / B);
                    	elseif (F <= -9e+22)
                    		tmp = Float64(-1.0 / sin(B));
                    	elseif (F <= 1.8e+140)
                    		tmp = Float64(Float64(-Float64(x * Float64(fma(Float64(B * B), Float64(Float64(Float64(B * B) * Float64(Float64(-0.0021164021164021165 * Float64(B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B))) + Float64(Float64(F * 1.0) / Float64(B * sqrt(fma(F, F, fma(2.0, x, 2.0))))));
                    	else
                    		tmp = Float64(Float64(1.0 - x) / B);
                    	end
                    	return tmp
                    end
                    
                    code[F_, B_, x_] := If[LessEqual[F, -4.2e+99], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(x * -0.3333333333333333), $MachinePrecision] + N[(0.008333333333333333 * x), $MachinePrecision]), $MachinePrecision] - N[(0.041666666666666664 * x + 0.019444444444444445), $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -9e+22], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e+140], N[((-N[(x * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.0021164021164021165 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.022222222222222223), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * 1.0), $MachinePrecision] / N[(B * N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;F \leq -4.2 \cdot 10^{+99}:\\
                    \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - \mathsf{fma}\left(0.041666666666666664, x, 0.019444444444444445\right), -0.16666666666666666 \cdot x\right) - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\
                    
                    \mathbf{elif}\;F \leq -9 \cdot 10^{+22}:\\
                    \;\;\;\;\frac{-1}{\sin B}\\
                    
                    \mathbf{elif}\;F \leq 1.8 \cdot 10^{+140}:\\
                    \;\;\;\;\left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{1 - x}{B}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 4 regimes
                    2. if F < -4.2000000000000002e99

                      1. Initial program 46.2%

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

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

                          \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                        2. lower-neg.f64N/A

                          \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                        3. div-add-revN/A

                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        4. lower-/.f64N/A

                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        5. lower-+.f64N/A

                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        6. *-commutativeN/A

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        7. lower-*.f64N/A

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        8. lower-cos.f64N/A

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        9. lift-sin.f6499.7

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                      5. Applied rewrites99.7%

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

                        \[\leadsto \frac{{B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot x + {B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + \frac{1}{120} \cdot x\right) - \left(\frac{7}{360} + \frac{1}{24} \cdot x\right)\right)\right) - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{\color{blue}{B}} \]
                      7. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \frac{{B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot x + {B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + \frac{1}{120} \cdot x\right) - \left(\frac{7}{360} + \frac{1}{24} \cdot x\right)\right)\right) - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                      8. Applied rewrites50.9%

                        \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - \mathsf{fma}\left(0.041666666666666664, x, 0.019444444444444445\right), -0.16666666666666666 \cdot x\right) - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{\color{blue}{B}} \]

                      if -4.2000000000000002e99 < F < -8.9999999999999996e22

                      1. Initial program 92.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 \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                      4. Step-by-step derivation
                        1. mul-1-negN/A

                          \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                        2. lower-neg.f64N/A

                          \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                        3. div-add-revN/A

                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        4. lower-/.f64N/A

                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        5. lower-+.f64N/A

                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        6. *-commutativeN/A

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        7. lower-*.f64N/A

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        8. lower-cos.f64N/A

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        9. lift-sin.f6499.8

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                      5. Applied rewrites99.8%

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

                        \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                      7. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \frac{-1}{\sin B} \]
                        2. lift-sin.f6460.4

                          \[\leadsto \frac{-1}{\sin B} \]
                      8. Applied rewrites60.4%

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

                      if -8.9999999999999996e22 < F < 1.8e140

                      1. Initial program 97.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                      4. Step-by-step derivation
                        1. lower-*.f64N/A

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

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

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                        4. inv-powN/A

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                        5. lower-pow.f64N/A

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                        6. +-commutativeN/A

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                        7. lower-+.f64N/A

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                        8. lower-fma.f64N/A

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
                        9. pow2N/A

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                        10. lift-*.f6477.4

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

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

                        \[\leadsto \left(-x \cdot \color{blue}{\frac{1 + {B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right)}{B}}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                      7. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \left(-x \cdot \frac{1 + {B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right)}{\color{blue}{B}}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                        2. +-commutativeN/A

                          \[\leadsto \left(-x \cdot \frac{{B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right) + 1}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                        3. lower-fma.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left({B}^{2}, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                        4. unpow2N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                        5. lower-*.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                        6. lower--.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                        7. lower-*.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                        8. unpow2N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                        9. lower-*.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                        10. lower--.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                        11. lower-*.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                        12. unpow2N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                        13. lower-*.f6448.0

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                      8. Applied rewrites48.0%

                        \[\leadsto \left(-x \cdot \color{blue}{\frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                      9. Taylor expanded in B around 0

                        \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                      10. Step-by-step derivation
                        1. lower-*.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                        2. lift-/.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                        3. sqrt-divN/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                        4. metadata-evalN/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\color{blue}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                        5. lower-/.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                        6. lower-sqrt.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                        7. pow2N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                        8. lower-+.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                        9. lift-fma.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                        10. lift-*.f6447.9

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                      11. Applied rewrites47.9%

                        \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \color{blue}{\frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}} \]
                      12. Step-by-step derivation
                        1. lift-*.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}} \]
                        2. lift-/.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{\color{blue}{1}}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                        3. lift-/.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\color{blue}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}} \]
                        4. lift-sqrt.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                        5. lift-+.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                        6. lift-*.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                        7. lift-fma.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                        8. frac-timesN/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{\color{blue}{B \cdot \sqrt{2 + \left(2 \cdot x + F \cdot F\right)}}} \]
                        9. lower-/.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{\color{blue}{B \cdot \sqrt{2 + \left(2 \cdot x + F \cdot F\right)}}} \]
                        10. lower-*.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{\color{blue}{B} \cdot \sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                        11. lower-*.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \color{blue}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}}} \]
                        12. lower-sqrt.f64N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                        13. +-commutativeN/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\left(2 \cdot x + F \cdot F\right) + 2}} \]
                        14. pow2N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                        15. associate-+r+N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{2 \cdot x + \left({F}^{2} + 2\right)}} \]
                        16. pow2N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{2 \cdot x + \left(F \cdot F + 2\right)}} \]
                        17. +-commutativeN/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}} \]
                        18. pow2N/A

                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\left({F}^{2} + 2\right) + 2 \cdot x}} \]
                      13. Applied rewrites50.1%

                        \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F \cdot 1}{\color{blue}{B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}} \]

                      if 1.8e140 < F

                      1. Initial program 36.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                      4. Step-by-step derivation
                        1. lower-/.f64N/A

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

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

                        \[\leadsto \frac{1 - x}{B} \]
                      7. Step-by-step derivation
                        1. Applied rewrites50.0%

                          \[\leadsto \frac{1 - x}{B} \]
                      8. Recombined 4 regimes into one program.
                      9. Add Preprocessing

                      Alternative 14: 57.4% accurate, 3.0× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+140}:\\ \;\;\;\;\left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                      (FPCore (F B x)
                       :precision binary64
                       (if (<= F -4e+20)
                         (- (/ (+ 1.0 x) (sin B)))
                         (if (<= F 1.8e+140)
                           (+
                            (-
                             (*
                              x
                              (/
                               (fma
                                (* B B)
                                (-
                                 (*
                                  (* B B)
                                  (- (* -0.0021164021164021165 (* B B)) 0.022222222222222223))
                                 0.3333333333333333)
                                1.0)
                               B)))
                            (/ (* F 1.0) (* B (sqrt (fma F F (fma 2.0 x 2.0))))))
                           (/ (- 1.0 x) B))))
                      double code(double F, double B, double x) {
                      	double tmp;
                      	if (F <= -4e+20) {
                      		tmp = -((1.0 + x) / sin(B));
                      	} else if (F <= 1.8e+140) {
                      		tmp = -(x * (fma((B * B), (((B * B) * ((-0.0021164021164021165 * (B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B)) + ((F * 1.0) / (B * sqrt(fma(F, F, fma(2.0, x, 2.0)))));
                      	} else {
                      		tmp = (1.0 - x) / B;
                      	}
                      	return tmp;
                      }
                      
                      function code(F, B, x)
                      	tmp = 0.0
                      	if (F <= -4e+20)
                      		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
                      	elseif (F <= 1.8e+140)
                      		tmp = Float64(Float64(-Float64(x * Float64(fma(Float64(B * B), Float64(Float64(Float64(B * B) * Float64(Float64(-0.0021164021164021165 * Float64(B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B))) + Float64(Float64(F * 1.0) / Float64(B * sqrt(fma(F, F, fma(2.0, x, 2.0))))));
                      	else
                      		tmp = Float64(Float64(1.0 - x) / B);
                      	end
                      	return tmp
                      end
                      
                      code[F_, B_, x_] := If[LessEqual[F, -4e+20], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.8e+140], N[((-N[(x * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.0021164021164021165 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.022222222222222223), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * 1.0), $MachinePrecision] / N[(B * N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\
                      \;\;\;\;-\frac{1 + x}{\sin B}\\
                      
                      \mathbf{elif}\;F \leq 1.8 \cdot 10^{+140}:\\
                      \;\;\;\;\left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{1 - x}{B}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if F < -4e20

                        1. Initial program 57.6%

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

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

                            \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                          2. lower-neg.f64N/A

                            \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                          3. div-add-revN/A

                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                          4. lower-/.f64N/A

                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                          5. lower-+.f64N/A

                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                          6. *-commutativeN/A

                            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                          7. lower-*.f64N/A

                            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                          8. lower-cos.f64N/A

                            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                          9. lift-sin.f6499.7

                            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        5. Applied rewrites99.7%

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

                          \[\leadsto -\frac{1 + x}{\sin B} \]
                        7. Step-by-step derivation
                          1. Applied rewrites77.9%

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

                          if -4e20 < F < 1.8e140

                          1. Initial program 97.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                          4. Step-by-step derivation
                            1. lower-*.f64N/A

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

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

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                            4. inv-powN/A

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                            5. lower-pow.f64N/A

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                            6. +-commutativeN/A

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                            7. lower-+.f64N/A

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                            8. lower-fma.f64N/A

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
                            9. pow2N/A

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            10. lift-*.f6477.4

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

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

                            \[\leadsto \left(-x \cdot \color{blue}{\frac{1 + {B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right)}{B}}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                          7. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \left(-x \cdot \frac{1 + {B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right)}{\color{blue}{B}}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            2. +-commutativeN/A

                              \[\leadsto \left(-x \cdot \frac{{B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right) + 1}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            3. lower-fma.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left({B}^{2}, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            4. unpow2N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            5. lower-*.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            6. lower--.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            7. lower-*.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            8. unpow2N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            9. lower-*.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            10. lower--.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            11. lower-*.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            12. unpow2N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            13. lower-*.f6447.9

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                          8. Applied rewrites47.9%

                            \[\leadsto \left(-x \cdot \color{blue}{\frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                          9. Taylor expanded in B around 0

                            \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                          10. Step-by-step derivation
                            1. lower-*.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                            2. lift-/.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                            3. sqrt-divN/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                            4. metadata-evalN/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\color{blue}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                            5. lower-/.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                            6. lower-sqrt.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                            7. pow2N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                            8. lower-+.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                            9. lift-fma.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                            10. lift-*.f6447.9

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                          11. Applied rewrites47.9%

                            \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \color{blue}{\frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}} \]
                          12. Step-by-step derivation
                            1. lift-*.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}} \]
                            2. lift-/.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{\color{blue}{1}}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                            3. lift-/.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\color{blue}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}} \]
                            4. lift-sqrt.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                            5. lift-+.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                            6. lift-*.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                            7. lift-fma.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                            8. frac-timesN/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{\color{blue}{B \cdot \sqrt{2 + \left(2 \cdot x + F \cdot F\right)}}} \]
                            9. lower-/.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{\color{blue}{B \cdot \sqrt{2 + \left(2 \cdot x + F \cdot F\right)}}} \]
                            10. lower-*.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{\color{blue}{B} \cdot \sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                            11. lower-*.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \color{blue}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}}} \]
                            12. lower-sqrt.f64N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                            13. +-commutativeN/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\left(2 \cdot x + F \cdot F\right) + 2}} \]
                            14. pow2N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                            15. associate-+r+N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{2 \cdot x + \left({F}^{2} + 2\right)}} \]
                            16. pow2N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{2 \cdot x + \left(F \cdot F + 2\right)}} \]
                            17. +-commutativeN/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}} \]
                            18. pow2N/A

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\left({F}^{2} + 2\right) + 2 \cdot x}} \]
                          13. Applied rewrites50.0%

                            \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F \cdot 1}{\color{blue}{B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}} \]

                          if 1.8e140 < F

                          1. Initial program 36.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                          4. Step-by-step derivation
                            1. lower-/.f64N/A

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

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

                            \[\leadsto \frac{1 - x}{B} \]
                          7. Step-by-step derivation
                            1. Applied rewrites50.0%

                              \[\leadsto \frac{1 - x}{B} \]
                          8. Recombined 3 regimes into one program.
                          9. Add Preprocessing

                          Alternative 15: 50.2% accurate, 3.2× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.4 \cdot 10^{+89}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - \mathsf{fma}\left(0.041666666666666664, x, 0.019444444444444445\right), -0.16666666666666666 \cdot x\right) - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{+140}:\\ \;\;\;\;\left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                          (FPCore (F B x)
                           :precision binary64
                           (if (<= F -4.4e+89)
                             (/
                              (-
                               (*
                                (* B B)
                                (-
                                 (fma
                                  (* B B)
                                  (-
                                   (fma
                                    -0.16666666666666666
                                    (* x -0.3333333333333333)
                                    (* 0.008333333333333333 x))
                                   (fma 0.041666666666666664 x 0.019444444444444445))
                                  (* -0.16666666666666666 x))
                                 (fma -0.5 x 0.16666666666666666)))
                               (+ 1.0 x))
                              B)
                             (if (<= F 1.8e+140)
                               (+
                                (-
                                 (*
                                  x
                                  (/
                                   (fma
                                    (* B B)
                                    (-
                                     (*
                                      (* B B)
                                      (- (* -0.0021164021164021165 (* B B)) 0.022222222222222223))
                                     0.3333333333333333)
                                    1.0)
                                   B)))
                                (/ (* F 1.0) (* B (sqrt (fma F F (fma 2.0 x 2.0))))))
                               (/ (- 1.0 x) B))))
                          double code(double F, double B, double x) {
                          	double tmp;
                          	if (F <= -4.4e+89) {
                          		tmp = (((B * B) * (fma((B * B), (fma(-0.16666666666666666, (x * -0.3333333333333333), (0.008333333333333333 * x)) - fma(0.041666666666666664, x, 0.019444444444444445)), (-0.16666666666666666 * x)) - fma(-0.5, x, 0.16666666666666666))) - (1.0 + x)) / B;
                          	} else if (F <= 1.8e+140) {
                          		tmp = -(x * (fma((B * B), (((B * B) * ((-0.0021164021164021165 * (B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B)) + ((F * 1.0) / (B * sqrt(fma(F, F, fma(2.0, x, 2.0)))));
                          	} else {
                          		tmp = (1.0 - x) / B;
                          	}
                          	return tmp;
                          }
                          
                          function code(F, B, x)
                          	tmp = 0.0
                          	if (F <= -4.4e+89)
                          		tmp = Float64(Float64(Float64(Float64(B * B) * Float64(fma(Float64(B * B), Float64(fma(-0.16666666666666666, Float64(x * -0.3333333333333333), Float64(0.008333333333333333 * x)) - fma(0.041666666666666664, x, 0.019444444444444445)), Float64(-0.16666666666666666 * x)) - fma(-0.5, x, 0.16666666666666666))) - Float64(1.0 + x)) / B);
                          	elseif (F <= 1.8e+140)
                          		tmp = Float64(Float64(-Float64(x * Float64(fma(Float64(B * B), Float64(Float64(Float64(B * B) * Float64(Float64(-0.0021164021164021165 * Float64(B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B))) + Float64(Float64(F * 1.0) / Float64(B * sqrt(fma(F, F, fma(2.0, x, 2.0))))));
                          	else
                          		tmp = Float64(Float64(1.0 - x) / B);
                          	end
                          	return tmp
                          end
                          
                          code[F_, B_, x_] := If[LessEqual[F, -4.4e+89], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(x * -0.3333333333333333), $MachinePrecision] + N[(0.008333333333333333 * x), $MachinePrecision]), $MachinePrecision] - N[(0.041666666666666664 * x + 0.019444444444444445), $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.8e+140], N[((-N[(x * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.0021164021164021165 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.022222222222222223), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * 1.0), $MachinePrecision] / N[(B * N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;F \leq -4.4 \cdot 10^{+89}:\\
                          \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - \mathsf{fma}\left(0.041666666666666664, x, 0.019444444444444445\right), -0.16666666666666666 \cdot x\right) - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\
                          
                          \mathbf{elif}\;F \leq 1.8 \cdot 10^{+140}:\\
                          \;\;\;\;\left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{1 - x}{B}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if F < -4.4e89

                            1. Initial program 47.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 \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                            4. Step-by-step derivation
                              1. mul-1-negN/A

                                \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                              2. lower-neg.f64N/A

                                \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                              3. div-add-revN/A

                                \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                              4. lower-/.f64N/A

                                \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                              5. lower-+.f64N/A

                                \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                              6. *-commutativeN/A

                                \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                              7. lower-*.f64N/A

                                \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                              8. lower-cos.f64N/A

                                \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                              9. lift-sin.f6499.7

                                \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                            5. Applied rewrites99.7%

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

                              \[\leadsto \frac{{B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot x + {B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + \frac{1}{120} \cdot x\right) - \left(\frac{7}{360} + \frac{1}{24} \cdot x\right)\right)\right) - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{\color{blue}{B}} \]
                            7. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \frac{{B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot x + {B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + \frac{1}{120} \cdot x\right) - \left(\frac{7}{360} + \frac{1}{24} \cdot x\right)\right)\right) - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                            8. Applied rewrites50.7%

                              \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - \mathsf{fma}\left(0.041666666666666664, x, 0.019444444444444445\right), -0.16666666666666666 \cdot x\right) - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{\color{blue}{B}} \]

                            if -4.4e89 < F < 1.8e140

                            1. Initial program 97.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                            4. Step-by-step derivation
                              1. lower-*.f64N/A

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

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

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                              4. inv-powN/A

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                              5. lower-pow.f64N/A

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                              6. +-commutativeN/A

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                              7. lower-+.f64N/A

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                              8. lower-fma.f64N/A

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
                              9. pow2N/A

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              10. lift-*.f6476.1

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            5. Applied rewrites76.1%

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

                              \[\leadsto \left(-x \cdot \color{blue}{\frac{1 + {B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right)}{B}}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            7. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \left(-x \cdot \frac{1 + {B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right)}{\color{blue}{B}}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              2. +-commutativeN/A

                                \[\leadsto \left(-x \cdot \frac{{B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right) + 1}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              3. lower-fma.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left({B}^{2}, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              4. unpow2N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              5. lower-*.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              6. lower--.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              7. lower-*.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              8. unpow2N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              9. lower-*.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              10. lower--.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              11. lower-*.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              12. unpow2N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              13. lower-*.f6447.6

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            8. Applied rewrites47.6%

                              \[\leadsto \left(-x \cdot \color{blue}{\frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                            9. Taylor expanded in B around 0

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                            10. Step-by-step derivation
                              1. lower-*.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                              2. lift-/.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                              3. sqrt-divN/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                              4. metadata-evalN/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\color{blue}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                              5. lower-/.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                              6. lower-sqrt.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                              7. pow2N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                              8. lower-+.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                              9. lift-fma.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                              10. lift-*.f6447.6

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                            11. Applied rewrites47.6%

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \color{blue}{\frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}} \]
                            12. Step-by-step derivation
                              1. lift-*.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}} \]
                              2. lift-/.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{\color{blue}{1}}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                              3. lift-/.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\color{blue}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}} \]
                              4. lift-sqrt.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                              5. lift-+.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                              6. lift-*.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
                              7. lift-fma.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                              8. frac-timesN/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{\color{blue}{B \cdot \sqrt{2 + \left(2 \cdot x + F \cdot F\right)}}} \]
                              9. lower-/.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{\color{blue}{B \cdot \sqrt{2 + \left(2 \cdot x + F \cdot F\right)}}} \]
                              10. lower-*.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{\color{blue}{B} \cdot \sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                              11. lower-*.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \color{blue}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}}} \]
                              12. lower-sqrt.f64N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
                              13. +-commutativeN/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\left(2 \cdot x + F \cdot F\right) + 2}} \]
                              14. pow2N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
                              15. associate-+r+N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{2 \cdot x + \left({F}^{2} + 2\right)}} \]
                              16. pow2N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{2 \cdot x + \left(F \cdot F + 2\right)}} \]
                              17. +-commutativeN/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}} \]
                              18. pow2N/A

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\left({F}^{2} + 2\right) + 2 \cdot x}} \]
                            13. Applied rewrites50.1%

                              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F \cdot 1}{\color{blue}{B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}} \]

                            if 1.8e140 < F

                            1. Initial program 36.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                            4. Step-by-step derivation
                              1. lower-/.f64N/A

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

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

                              \[\leadsto \frac{1 - x}{B} \]
                            7. Step-by-step derivation
                              1. Applied rewrites50.0%

                                \[\leadsto \frac{1 - x}{B} \]
                            8. Recombined 3 regimes into one program.
                            9. Add Preprocessing

                            Alternative 16: 50.4% accurate, 4.4× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.96 \cdot 10^{+99}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - \mathsf{fma}\left(0.041666666666666664, x, 0.019444444444444445\right), -0.16666666666666666 \cdot x\right) - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\ \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\ \end{array} \end{array} \]
                            (FPCore (F B x)
                             :precision binary64
                             (if (<= F -1.96e+99)
                               (/
                                (-
                                 (*
                                  (* B B)
                                  (-
                                   (fma
                                    (* B B)
                                    (-
                                     (fma
                                      -0.16666666666666666
                                      (* x -0.3333333333333333)
                                      (* 0.008333333333333333 x))
                                     (fma 0.041666666666666664 x 0.019444444444444445))
                                    (* -0.16666666666666666 x))
                                   (fma -0.5 x 0.16666666666666666)))
                                 (+ 1.0 x))
                                B)
                               (if (<= F 1.95e-8)
                                 (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                                 (/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
                            double code(double F, double B, double x) {
                            	double tmp;
                            	if (F <= -1.96e+99) {
                            		tmp = (((B * B) * (fma((B * B), (fma(-0.16666666666666666, (x * -0.3333333333333333), (0.008333333333333333 * x)) - fma(0.041666666666666664, x, 0.019444444444444445)), (-0.16666666666666666 * x)) - fma(-0.5, x, 0.16666666666666666))) - (1.0 + x)) / B;
                            	} else if (F <= 1.95e-8) {
                            		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                            	} else {
                            		tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
                            	}
                            	return tmp;
                            }
                            
                            function code(F, B, x)
                            	tmp = 0.0
                            	if (F <= -1.96e+99)
                            		tmp = Float64(Float64(Float64(Float64(B * B) * Float64(fma(Float64(B * B), Float64(fma(-0.16666666666666666, Float64(x * -0.3333333333333333), Float64(0.008333333333333333 * x)) - fma(0.041666666666666664, x, 0.019444444444444445)), Float64(-0.16666666666666666 * x)) - fma(-0.5, x, 0.16666666666666666))) - Float64(1.0 + x)) / B);
                            	elseif (F <= 1.95e-8)
                            		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
                            	else
                            		tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B);
                            	end
                            	return tmp
                            end
                            
                            code[F_, B_, x_] := If[LessEqual[F, -1.96e+99], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(x * -0.3333333333333333), $MachinePrecision] + N[(0.008333333333333333 * x), $MachinePrecision]), $MachinePrecision] - N[(0.041666666666666664 * x + 0.019444444444444445), $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;F \leq -1.96 \cdot 10^{+99}:\\
                            \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - \mathsf{fma}\left(0.041666666666666664, x, 0.019444444444444445\right), -0.16666666666666666 \cdot x\right) - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\
                            
                            \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
                            \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if F < -1.95999999999999992e99

                              1. Initial program 46.2%

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

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

                                  \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                                2. lower-neg.f64N/A

                                  \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                3. div-add-revN/A

                                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                4. lower-/.f64N/A

                                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                5. lower-+.f64N/A

                                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                6. *-commutativeN/A

                                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                7. lower-*.f64N/A

                                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                8. lower-cos.f64N/A

                                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                9. lift-sin.f6499.7

                                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                              5. Applied rewrites99.7%

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

                                \[\leadsto \frac{{B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot x + {B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + \frac{1}{120} \cdot x\right) - \left(\frac{7}{360} + \frac{1}{24} \cdot x\right)\right)\right) - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{\color{blue}{B}} \]
                              7. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{{B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot x + {B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + \frac{1}{120} \cdot x\right) - \left(\frac{7}{360} + \frac{1}{24} \cdot x\right)\right)\right) - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                              8. Applied rewrites50.9%

                                \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - \mathsf{fma}\left(0.041666666666666664, x, 0.019444444444444445\right), -0.16666666666666666 \cdot x\right) - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{\color{blue}{B}} \]

                              if -1.95999999999999992e99 < F < 1.94999999999999992e-8

                              1. Initial program 98.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. lower-/.f64N/A

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

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

                                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                2. lift-+.f64N/A

                                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                3. lift-*.f64N/A

                                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                4. lift-fma.f64N/A

                                  \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                5. unpow-1N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                                6. lower-/.f64N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                                7. pow2N/A

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

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                                9. pow2N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                                10. lift-fma.f64N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                11. lift-fma.f6450.7

                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                              7. Applied rewrites50.7%

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

                              if 1.94999999999999992e-8 < F

                              1. Initial program 59.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. lower-/.f64N/A

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

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

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

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                                2. div-addN/A

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

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

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

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

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                7. lower-fma.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, 1\right) - x}{B} \]
                                8. +-commutativeN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                9. associate-*r/N/A

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

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                11. associate-*r/N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                12. div-addN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                13. lower-/.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                14. +-commutativeN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot x + 2}{{F}^{2}}, 1\right) - x}{B} \]
                                15. lower-fma.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{{F}^{2}}, 1\right) - x}{B} \]
                                16. pow2N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                17. lift-*.f6449.4

                                  \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                              8. Applied rewrites49.4%

                                \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                            3. Recombined 3 regimes into one program.
                            4. Add Preprocessing

                            Alternative 17: 50.3% accurate, 4.8× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.75 \cdot 10^{+99}:\\ \;\;\;\;\left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\ \end{array} \end{array} \]
                            (FPCore (F B x)
                             :precision binary64
                             (if (<= F -1.75e+99)
                               (+
                                (-
                                 (*
                                  x
                                  (/
                                   (fma
                                    (* B B)
                                    (-
                                     (*
                                      (* B B)
                                      (- (* -0.0021164021164021165 (* B B)) 0.022222222222222223))
                                     0.3333333333333333)
                                    1.0)
                                   B)))
                                (/ -1.0 B))
                               (if (<= F 1.95e-8)
                                 (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                                 (/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
                            double code(double F, double B, double x) {
                            	double tmp;
                            	if (F <= -1.75e+99) {
                            		tmp = -(x * (fma((B * B), (((B * B) * ((-0.0021164021164021165 * (B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B)) + (-1.0 / B);
                            	} else if (F <= 1.95e-8) {
                            		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                            	} else {
                            		tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
                            	}
                            	return tmp;
                            }
                            
                            function code(F, B, x)
                            	tmp = 0.0
                            	if (F <= -1.75e+99)
                            		tmp = Float64(Float64(-Float64(x * Float64(fma(Float64(B * B), Float64(Float64(Float64(B * B) * Float64(Float64(-0.0021164021164021165 * Float64(B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B))) + Float64(-1.0 / B));
                            	elseif (F <= 1.95e-8)
                            		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
                            	else
                            		tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B);
                            	end
                            	return tmp
                            end
                            
                            code[F_, B_, x_] := If[LessEqual[F, -1.75e+99], N[((-N[(x * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.0021164021164021165 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.022222222222222223), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;F \leq -1.75 \cdot 10^{+99}:\\
                            \;\;\;\;\left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{-1}{B}\\
                            
                            \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
                            \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if F < -1.7499999999999999e99

                              1. Initial program 46.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                              4. Step-by-step derivation
                                1. lower-*.f64N/A

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

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

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                                4. inv-powN/A

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                                5. lower-pow.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                                6. +-commutativeN/A

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                                7. lower-+.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                                8. lower-fma.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
                                9. pow2N/A

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                                10. lift-*.f6439.2

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              5. Applied rewrites39.2%

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

                                \[\leadsto \left(-x \cdot \color{blue}{\frac{1 + {B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right)}{B}}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              7. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{1 + {B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right)}{\color{blue}{B}}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                                2. +-commutativeN/A

                                  \[\leadsto \left(-x \cdot \frac{{B}^{2} \cdot \left({B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right) + 1}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                                3. lower-fma.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left({B}^{2}, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                                4. unpow2N/A

                                  \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                                5. lower-*.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                                6. lower--.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                                7. lower-*.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, {B}^{2} \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                                8. unpow2N/A

                                  \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                                9. lower-*.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                                10. lower--.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                                11. lower-*.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot {B}^{2} - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                                12. unpow2N/A

                                  \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                                13. lower-*.f6415.4

                                  \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              8. Applied rewrites15.4%

                                \[\leadsto \left(-x \cdot \color{blue}{\frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                              9. Taylor expanded in F around -inf

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(\frac{-2}{945} \cdot \left(B \cdot B\right) - \frac{1}{45}\right) - \frac{1}{3}, 1\right)}{B}\right) + \frac{-1}{\color{blue}{B}} \]
                              10. Step-by-step derivation
                                1. lower-/.f6450.7

                                  \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{-1}{B} \]
                              11. Applied rewrites50.7%

                                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{-1}{\color{blue}{B}} \]

                              if -1.7499999999999999e99 < F < 1.94999999999999992e-8

                              1. Initial program 98.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. lower-/.f64N/A

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

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

                                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                2. lift-+.f64N/A

                                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                3. lift-*.f64N/A

                                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                4. lift-fma.f64N/A

                                  \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                5. unpow-1N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                                6. lower-/.f64N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                                7. pow2N/A

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

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                                9. pow2N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                                10. lift-fma.f64N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                11. lift-fma.f6450.7

                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                              7. Applied rewrites50.7%

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

                              if 1.94999999999999992e-8 < F

                              1. Initial program 59.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. lower-/.f64N/A

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

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

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

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                                2. div-addN/A

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

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

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

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

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                7. lower-fma.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, 1\right) - x}{B} \]
                                8. +-commutativeN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                9. associate-*r/N/A

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

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                11. associate-*r/N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                12. div-addN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                13. lower-/.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                14. +-commutativeN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot x + 2}{{F}^{2}}, 1\right) - x}{B} \]
                                15. lower-fma.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{{F}^{2}}, 1\right) - x}{B} \]
                                16. pow2N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                17. lift-*.f6449.4

                                  \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                              8. Applied rewrites49.4%

                                \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                            3. Recombined 3 regimes into one program.
                            4. Add Preprocessing

                            Alternative 18: 50.4% accurate, 5.7× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.96 \cdot 10^{+99}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\ \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\ \end{array} \end{array} \]
                            (FPCore (F B x)
                             :precision binary64
                             (if (<= F -1.96e+99)
                               (/
                                (-
                                 (*
                                  (* B B)
                                  (- (* -0.16666666666666666 x) (fma -0.5 x 0.16666666666666666)))
                                 (+ 1.0 x))
                                B)
                               (if (<= F 1.95e-8)
                                 (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                                 (/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
                            double code(double F, double B, double x) {
                            	double tmp;
                            	if (F <= -1.96e+99) {
                            		tmp = (((B * B) * ((-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - (1.0 + x)) / B;
                            	} else if (F <= 1.95e-8) {
                            		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                            	} else {
                            		tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
                            	}
                            	return tmp;
                            }
                            
                            function code(F, B, x)
                            	tmp = 0.0
                            	if (F <= -1.96e+99)
                            		tmp = Float64(Float64(Float64(Float64(B * B) * Float64(Float64(-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - Float64(1.0 + x)) / B);
                            	elseif (F <= 1.95e-8)
                            		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
                            	else
                            		tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B);
                            	end
                            	return tmp
                            end
                            
                            code[F_, B_, x_] := If[LessEqual[F, -1.96e+99], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.16666666666666666 * x), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;F \leq -1.96 \cdot 10^{+99}:\\
                            \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\
                            
                            \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
                            \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if F < -1.95999999999999992e99

                              1. Initial program 46.2%

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

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

                                  \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                                2. lower-neg.f64N/A

                                  \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                3. div-add-revN/A

                                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                4. lower-/.f64N/A

                                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                5. lower-+.f64N/A

                                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                6. *-commutativeN/A

                                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                7. lower-*.f64N/A

                                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                8. lower-cos.f64N/A

                                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                9. lift-sin.f6499.7

                                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                              5. Applied rewrites99.7%

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

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

                                  \[\leadsto \frac{{B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                2. lower--.f64N/A

                                  \[\leadsto \frac{{B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                3. lower-*.f64N/A

                                  \[\leadsto \frac{{B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                4. unpow2N/A

                                  \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                5. lower-*.f64N/A

                                  \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                6. lower--.f64N/A

                                  \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                7. lower-*.f64N/A

                                  \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                8. +-commutativeN/A

                                  \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{-1}{2} \cdot x + \frac{1}{6}\right)\right) - \left(1 + x\right)}{B} \]
                                9. lower-fma.f64N/A

                                  \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6}\right)\right) - \left(1 + x\right)}{B} \]
                                10. lower-+.f6451.1

                                  \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B} \]
                              8. Applied rewrites51.1%

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

                              if -1.95999999999999992e99 < F < 1.94999999999999992e-8

                              1. Initial program 98.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. lower-/.f64N/A

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

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

                                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                2. lift-+.f64N/A

                                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                3. lift-*.f64N/A

                                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                4. lift-fma.f64N/A

                                  \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                5. unpow-1N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                                6. lower-/.f64N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                                7. pow2N/A

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

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                                9. pow2N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                                10. lift-fma.f64N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                11. lift-fma.f6450.7

                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                              7. Applied rewrites50.7%

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

                              if 1.94999999999999992e-8 < F

                              1. Initial program 59.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. lower-/.f64N/A

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

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

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

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                                2. div-addN/A

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

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

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

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

                                  \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                7. lower-fma.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, 1\right) - x}{B} \]
                                8. +-commutativeN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                9. associate-*r/N/A

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

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                11. associate-*r/N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                12. div-addN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                13. lower-/.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                14. +-commutativeN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot x + 2}{{F}^{2}}, 1\right) - x}{B} \]
                                15. lower-fma.f64N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{{F}^{2}}, 1\right) - x}{B} \]
                                16. pow2N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                17. lift-*.f6449.4

                                  \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                              8. Applied rewrites49.4%

                                \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                            3. Recombined 3 regimes into one program.
                            4. Add Preprocessing

                            Alternative 19: 50.3% accurate, 6.7× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.8:\\ \;\;\;\;\mathsf{fma}\left(0.5, \frac{2}{B \cdot \left(F \cdot F\right)}, -\frac{1 + x}{B}\right)\\ \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\ \end{array} \end{array} \]
                            (FPCore (F B x)
                             :precision binary64
                             (if (<= F -6.8)
                               (fma 0.5 (/ 2.0 (* B (* F F))) (- (/ (+ 1.0 x) B)))
                               (if (<= F 1.95e-8)
                                 (/ (- (* (sqrt 0.5) F) x) B)
                                 (/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
                            double code(double F, double B, double x) {
                            	double tmp;
                            	if (F <= -6.8) {
                            		tmp = fma(0.5, (2.0 / (B * (F * F))), -((1.0 + x) / B));
                            	} else if (F <= 1.95e-8) {
                            		tmp = ((sqrt(0.5) * F) - x) / B;
                            	} else {
                            		tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
                            	}
                            	return tmp;
                            }
                            
                            function code(F, B, x)
                            	tmp = 0.0
                            	if (F <= -6.8)
                            		tmp = fma(0.5, Float64(2.0 / Float64(B * Float64(F * F))), Float64(-Float64(Float64(1.0 + x) / B)));
                            	elseif (F <= 1.95e-8)
                            		tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B);
                            	else
                            		tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B);
                            	end
                            	return tmp
                            end
                            
                            code[F_, B_, x_] := If[LessEqual[F, -6.8], N[(0.5 * N[(2.0 / N[(B * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + (-N[(N[(1.0 + x), $MachinePrecision] / B), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;F \leq -6.8:\\
                            \;\;\;\;\mathsf{fma}\left(0.5, \frac{2}{B \cdot \left(F \cdot F\right)}, -\frac{1 + x}{B}\right)\\
                            
                            \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
                            \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if F < -6.79999999999999982

                              1. Initial program 59.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. lower-/.f64N/A

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

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

                                \[\leadsto -1 \cdot \frac{1 + x}{B} + \color{blue}{\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{B \cdot {F}^{2}}} \]
                              7. Step-by-step derivation
                                1. metadata-evalN/A

                                  \[\leadsto -1 \cdot \frac{1 + x}{B} + \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{\color{blue}{B} \cdot {F}^{2}} \]
                                2. +-commutativeN/A

                                  \[\leadsto \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{B \cdot {F}^{2}} + -1 \cdot \color{blue}{\frac{1 + x}{B}} \]
                                3. lower-fma.f64N/A

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

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

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{\frac{2 + 2 \cdot x}{B}}{{F}^{\color{blue}{2}}}, -1 \cdot \frac{1 + x}{B}\right) \]
                                6. lower-/.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{\frac{2 + 2 \cdot x}{B}}{{F}^{\color{blue}{2}}}, -1 \cdot \frac{1 + x}{B}\right) \]
                                7. lower-/.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{\frac{2 + 2 \cdot x}{B}}{{F}^{2}}, -1 \cdot \frac{1 + x}{B}\right) \]
                                8. +-commutativeN/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{\frac{2 \cdot x + 2}{B}}{{F}^{2}}, -1 \cdot \frac{1 + x}{B}\right) \]
                                9. lower-fma.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{{F}^{2}}, -1 \cdot \frac{1 + x}{B}\right) \]
                                10. pow2N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F \cdot F}, -1 \cdot \frac{1 + x}{B}\right) \]
                                11. lift-*.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F \cdot F}, -1 \cdot \frac{1 + x}{B}\right) \]
                                12. mul-1-negN/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F \cdot F}, \mathsf{neg}\left(\frac{1 + x}{B}\right)\right) \]
                                13. lower-neg.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F \cdot F}, -\frac{1 + x}{B}\right) \]
                                14. lower-/.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F \cdot F}, -\frac{1 + x}{B}\right) \]
                                15. lower-+.f6439.7

                                  \[\leadsto \mathsf{fma}\left(0.5, \frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F \cdot F}, -\frac{1 + x}{B}\right) \]
                              8. Applied rewrites39.7%

                                \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F \cdot F}}, -\frac{1 + x}{B}\right) \]
                              9. Taylor expanded in x around 0

                                \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{2}{B \cdot \color{blue}{{F}^{2}}}, -\frac{1 + x}{B}\right) \]
                              10. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{2}{B \cdot {F}^{\color{blue}{2}}}, -\frac{1 + x}{B}\right) \]
                                2. lower-*.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{2}{B \cdot {F}^{2}}, -\frac{1 + x}{B}\right) \]
                                3. pow2N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \frac{2}{B \cdot \left(F \cdot F\right)}, -\frac{1 + x}{B}\right) \]
                                4. lift-*.f6450.8

                                  \[\leadsto \mathsf{fma}\left(0.5, \frac{2}{B \cdot \left(F \cdot F\right)}, -\frac{1 + x}{B}\right) \]
                              11. Applied rewrites50.8%

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

                              if -6.79999999999999982 < F < 1.94999999999999992e-8

                              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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                              4. Step-by-step derivation
                                1. lower-/.f64N/A

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

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

                                \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                              7. Step-by-step derivation
                                1. inv-powN/A

                                  \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                2. lower-pow.f64N/A

                                  \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                3. +-commutativeN/A

                                  \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                                4. lower-fma.f6450.5

                                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                              8. Applied rewrites50.5%

                                \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                              9. Taylor expanded in x around 0

                                \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F - x}{B} \]
                              10. Step-by-step derivation
                                1. Applied rewrites50.5%

                                  \[\leadsto \frac{\sqrt{0.5} \cdot F - x}{B} \]

                                if 1.94999999999999992e-8 < F

                                1. Initial program 59.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. lower-/.f64N/A

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

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

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

                                    \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                                  2. div-addN/A

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

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

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

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

                                    \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                  7. lower-fma.f64N/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, 1\right) - x}{B} \]
                                  8. +-commutativeN/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                  9. associate-*r/N/A

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

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                  11. associate-*r/N/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                  12. div-addN/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                  13. lower-/.f64N/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                  14. +-commutativeN/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot x + 2}{{F}^{2}}, 1\right) - x}{B} \]
                                  15. lower-fma.f64N/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{{F}^{2}}, 1\right) - x}{B} \]
                                  16. pow2N/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                  17. lift-*.f6449.4

                                    \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                8. Applied rewrites49.4%

                                  \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                              11. Recombined 3 regimes into one program.
                              12. Add Preprocessing

                              Alternative 20: 50.3% accurate, 6.7× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.8:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\ \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\ \end{array} \end{array} \]
                              (FPCore (F B x)
                               :precision binary64
                               (if (<= F -6.8)
                                 (/
                                  (-
                                   (*
                                    (* B B)
                                    (- (* -0.16666666666666666 x) (fma -0.5 x 0.16666666666666666)))
                                   (+ 1.0 x))
                                  B)
                                 (if (<= F 1.95e-8)
                                   (/ (- (* (sqrt 0.5) F) x) B)
                                   (/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
                              double code(double F, double B, double x) {
                              	double tmp;
                              	if (F <= -6.8) {
                              		tmp = (((B * B) * ((-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - (1.0 + x)) / B;
                              	} else if (F <= 1.95e-8) {
                              		tmp = ((sqrt(0.5) * F) - x) / B;
                              	} else {
                              		tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
                              	}
                              	return tmp;
                              }
                              
                              function code(F, B, x)
                              	tmp = 0.0
                              	if (F <= -6.8)
                              		tmp = Float64(Float64(Float64(Float64(B * B) * Float64(Float64(-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - Float64(1.0 + x)) / B);
                              	elseif (F <= 1.95e-8)
                              		tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B);
                              	else
                              		tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B);
                              	end
                              	return tmp
                              end
                              
                              code[F_, B_, x_] := If[LessEqual[F, -6.8], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.16666666666666666 * x), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;F \leq -6.8:\\
                              \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\
                              
                              \mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
                              \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if F < -6.79999999999999982

                                1. Initial program 59.6%

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

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

                                    \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                                  2. lower-neg.f64N/A

                                    \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                  3. div-add-revN/A

                                    \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                  4. lower-/.f64N/A

                                    \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                  5. lower-+.f64N/A

                                    \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                  6. *-commutativeN/A

                                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                  7. lower-*.f64N/A

                                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                  8. lower-cos.f64N/A

                                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                  9. lift-sin.f6499.3

                                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                5. Applied rewrites99.3%

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

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

                                    \[\leadsto \frac{{B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                  2. lower--.f64N/A

                                    \[\leadsto \frac{{B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                  3. lower-*.f64N/A

                                    \[\leadsto \frac{{B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                  4. unpow2N/A

                                    \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                  5. lower-*.f64N/A

                                    \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                  6. lower--.f64N/A

                                    \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                  7. lower-*.f64N/A

                                    \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                  8. +-commutativeN/A

                                    \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{-1}{2} \cdot x + \frac{1}{6}\right)\right) - \left(1 + x\right)}{B} \]
                                  9. lower-fma.f64N/A

                                    \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6}\right)\right) - \left(1 + x\right)}{B} \]
                                  10. lower-+.f6450.7

                                    \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B} \]
                                8. Applied rewrites50.7%

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

                                if -6.79999999999999982 < F < 1.94999999999999992e-8

                                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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                4. Step-by-step derivation
                                  1. lower-/.f64N/A

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

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

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                7. Step-by-step derivation
                                  1. inv-powN/A

                                    \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                  2. lower-pow.f64N/A

                                    \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                  3. +-commutativeN/A

                                    \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                                  4. lower-fma.f6450.5

                                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                8. Applied rewrites50.5%

                                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                9. Taylor expanded in x around 0

                                  \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F - x}{B} \]
                                10. Step-by-step derivation
                                  1. Applied rewrites50.5%

                                    \[\leadsto \frac{\sqrt{0.5} \cdot F - x}{B} \]

                                  if 1.94999999999999992e-8 < F

                                  1. Initial program 59.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. lower-/.f64N/A

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

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

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

                                      \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                                    2. div-addN/A

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

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

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

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

                                      \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                    7. lower-fma.f64N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, 1\right) - x}{B} \]
                                    8. +-commutativeN/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                    9. associate-*r/N/A

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

                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                    11. associate-*r/N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                    12. div-addN/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                    13. lower-/.f64N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                    14. +-commutativeN/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot x + 2}{{F}^{2}}, 1\right) - x}{B} \]
                                    15. lower-fma.f64N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{{F}^{2}}, 1\right) - x}{B} \]
                                    16. pow2N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                    17. lift-*.f6449.4

                                      \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                  8. Applied rewrites49.4%

                                    \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                11. Recombined 3 regimes into one program.
                                12. Add Preprocessing

                                Alternative 21: 50.2% accurate, 7.7× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.8:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\ \mathbf{elif}\;F \leq 7500000000000:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                (FPCore (F B x)
                                 :precision binary64
                                 (if (<= F -6.8)
                                   (/
                                    (-
                                     (*
                                      (* B B)
                                      (- (* -0.16666666666666666 x) (fma -0.5 x 0.16666666666666666)))
                                     (+ 1.0 x))
                                    B)
                                   (if (<= F 7500000000000.0) (/ (- (* (sqrt 0.5) F) x) B) (/ (- 1.0 x) B))))
                                double code(double F, double B, double x) {
                                	double tmp;
                                	if (F <= -6.8) {
                                		tmp = (((B * B) * ((-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - (1.0 + x)) / B;
                                	} else if (F <= 7500000000000.0) {
                                		tmp = ((sqrt(0.5) * F) - x) / B;
                                	} else {
                                		tmp = (1.0 - x) / B;
                                	}
                                	return tmp;
                                }
                                
                                function code(F, B, x)
                                	tmp = 0.0
                                	if (F <= -6.8)
                                		tmp = Float64(Float64(Float64(Float64(B * B) * Float64(Float64(-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - Float64(1.0 + x)) / B);
                                	elseif (F <= 7500000000000.0)
                                		tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B);
                                	else
                                		tmp = Float64(Float64(1.0 - x) / B);
                                	end
                                	return tmp
                                end
                                
                                code[F_, B_, x_] := If[LessEqual[F, -6.8], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.16666666666666666 * x), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7500000000000.0], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;F \leq -6.8:\\
                                \;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\
                                
                                \mathbf{elif}\;F \leq 7500000000000:\\
                                \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{1 - x}{B}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if F < -6.79999999999999982

                                  1. Initial program 59.6%

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

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

                                      \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                                    2. lower-neg.f64N/A

                                      \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                    3. div-add-revN/A

                                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                    4. lower-/.f64N/A

                                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                    5. lower-+.f64N/A

                                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                    6. *-commutativeN/A

                                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                    7. lower-*.f64N/A

                                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                    8. lower-cos.f64N/A

                                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                    9. lift-sin.f6499.3

                                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                  5. Applied rewrites99.3%

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

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

                                      \[\leadsto \frac{{B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                    2. lower--.f64N/A

                                      \[\leadsto \frac{{B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                    3. lower-*.f64N/A

                                      \[\leadsto \frac{{B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                    4. unpow2N/A

                                      \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                    5. lower-*.f64N/A

                                      \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                    6. lower--.f64N/A

                                      \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                    7. lower-*.f64N/A

                                      \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{B} \]
                                    8. +-commutativeN/A

                                      \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \left(\frac{-1}{2} \cdot x + \frac{1}{6}\right)\right) - \left(1 + x\right)}{B} \]
                                    9. lower-fma.f64N/A

                                      \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(\frac{-1}{6} \cdot x - \mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6}\right)\right) - \left(1 + x\right)}{B} \]
                                    10. lower-+.f6450.7

                                      \[\leadsto \frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B} \]
                                  8. Applied rewrites50.7%

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

                                  if -6.79999999999999982 < F < 7.5e12

                                  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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                  4. Step-by-step derivation
                                    1. lower-/.f64N/A

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

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

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                  7. Step-by-step derivation
                                    1. inv-powN/A

                                      \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                    2. lower-pow.f64N/A

                                      \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                    3. +-commutativeN/A

                                      \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                                    4. lower-fma.f6449.7

                                      \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                  8. Applied rewrites49.7%

                                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                  9. Taylor expanded in x around 0

                                    \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F - x}{B} \]
                                  10. Step-by-step derivation
                                    1. Applied rewrites49.6%

                                      \[\leadsto \frac{\sqrt{0.5} \cdot F - x}{B} \]

                                    if 7.5e12 < F

                                    1. Initial program 57.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                    4. Step-by-step derivation
                                      1. lower-/.f64N/A

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

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

                                      \[\leadsto \frac{1 - x}{B} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites50.5%

                                        \[\leadsto \frac{1 - x}{B} \]
                                    8. Recombined 3 regimes into one program.
                                    9. Add Preprocessing

                                    Alternative 22: 49.6% accurate, 8.8× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.05 \cdot 10^{-29}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 7500000000000:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                    (FPCore (F B x)
                                     :precision binary64
                                     (if (<= F -1.05e-29)
                                       (/ (- -1.0 x) B)
                                       (if (<= F 7500000000000.0) (/ (- (* (sqrt 0.5) F) x) B) (/ (- 1.0 x) B))))
                                    double code(double F, double B, double x) {
                                    	double tmp;
                                    	if (F <= -1.05e-29) {
                                    		tmp = (-1.0 - x) / B;
                                    	} else if (F <= 7500000000000.0) {
                                    		tmp = ((sqrt(0.5) * F) - x) / B;
                                    	} else {
                                    		tmp = (1.0 - x) / B;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    module fmin_fmax_functions
                                        implicit none
                                        private
                                        public fmax
                                        public fmin
                                    
                                        interface fmax
                                            module procedure fmax88
                                            module procedure fmax44
                                            module procedure fmax84
                                            module procedure fmax48
                                        end interface
                                        interface fmin
                                            module procedure fmin88
                                            module procedure fmin44
                                            module procedure fmin84
                                            module procedure fmin48
                                        end interface
                                    contains
                                        real(8) function fmax88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmax44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmax84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmax48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmin44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmin48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                        end function
                                    end module
                                    
                                    real(8) function code(f, b, x)
                                    use fmin_fmax_functions
                                        real(8), intent (in) :: f
                                        real(8), intent (in) :: b
                                        real(8), intent (in) :: x
                                        real(8) :: tmp
                                        if (f <= (-1.05d-29)) then
                                            tmp = ((-1.0d0) - x) / b
                                        else if (f <= 7500000000000.0d0) then
                                            tmp = ((sqrt(0.5d0) * f) - x) / b
                                        else
                                            tmp = (1.0d0 - x) / b
                                        end if
                                        code = tmp
                                    end function
                                    
                                    public static double code(double F, double B, double x) {
                                    	double tmp;
                                    	if (F <= -1.05e-29) {
                                    		tmp = (-1.0 - x) / B;
                                    	} else if (F <= 7500000000000.0) {
                                    		tmp = ((Math.sqrt(0.5) * F) - x) / B;
                                    	} else {
                                    		tmp = (1.0 - x) / B;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    def code(F, B, x):
                                    	tmp = 0
                                    	if F <= -1.05e-29:
                                    		tmp = (-1.0 - x) / B
                                    	elif F <= 7500000000000.0:
                                    		tmp = ((math.sqrt(0.5) * F) - x) / B
                                    	else:
                                    		tmp = (1.0 - x) / B
                                    	return tmp
                                    
                                    function code(F, B, x)
                                    	tmp = 0.0
                                    	if (F <= -1.05e-29)
                                    		tmp = Float64(Float64(-1.0 - x) / B);
                                    	elseif (F <= 7500000000000.0)
                                    		tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B);
                                    	else
                                    		tmp = Float64(Float64(1.0 - x) / B);
                                    	end
                                    	return tmp
                                    end
                                    
                                    function tmp_2 = code(F, B, x)
                                    	tmp = 0.0;
                                    	if (F <= -1.05e-29)
                                    		tmp = (-1.0 - x) / B;
                                    	elseif (F <= 7500000000000.0)
                                    		tmp = ((sqrt(0.5) * F) - x) / B;
                                    	else
                                    		tmp = (1.0 - x) / B;
                                    	end
                                    	tmp_2 = tmp;
                                    end
                                    
                                    code[F_, B_, x_] := If[LessEqual[F, -1.05e-29], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7500000000000.0], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;F \leq -1.05 \cdot 10^{-29}:\\
                                    \;\;\;\;\frac{-1 - x}{B}\\
                                    
                                    \mathbf{elif}\;F \leq 7500000000000:\\
                                    \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{1 - x}{B}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 regimes
                                    2. if F < -1.04999999999999995e-29

                                      1. Initial program 62.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. lower-/.f64N/A

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

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

                                        \[\leadsto \frac{-1 - x}{B} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites48.6%

                                          \[\leadsto \frac{-1 - x}{B} \]

                                        if -1.04999999999999995e-29 < F < 7.5e12

                                        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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                        4. Step-by-step derivation
                                          1. lower-/.f64N/A

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

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

                                          \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                        7. Step-by-step derivation
                                          1. inv-powN/A

                                            \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                          2. lower-pow.f64N/A

                                            \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                          3. +-commutativeN/A

                                            \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                                          4. lower-fma.f6449.9

                                            \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                        8. Applied rewrites49.9%

                                          \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                        9. Taylor expanded in x around 0

                                          \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F - x}{B} \]
                                        10. Step-by-step derivation
                                          1. Applied rewrites49.8%

                                            \[\leadsto \frac{\sqrt{0.5} \cdot F - x}{B} \]

                                          if 7.5e12 < F

                                          1. Initial program 57.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                          4. Step-by-step derivation
                                            1. lower-/.f64N/A

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

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

                                            \[\leadsto \frac{1 - x}{B} \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites50.5%

                                              \[\leadsto \frac{1 - x}{B} \]
                                          8. Recombined 3 regimes into one program.
                                          9. Add Preprocessing

                                          Alternative 23: 43.4% accurate, 13.6× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.2 \cdot 10^{-75}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-93}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                          (FPCore (F B x)
                                           :precision binary64
                                           (if (<= F -4.2e-75)
                                             (/ (- -1.0 x) B)
                                             (if (<= F 4.2e-93) (/ (- x) B) (/ (- 1.0 x) B))))
                                          double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= -4.2e-75) {
                                          		tmp = (-1.0 - x) / B;
                                          	} else if (F <= 4.2e-93) {
                                          		tmp = -x / B;
                                          	} else {
                                          		tmp = (1.0 - x) / B;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          module fmin_fmax_functions
                                              implicit none
                                              private
                                              public fmax
                                              public fmin
                                          
                                              interface fmax
                                                  module procedure fmax88
                                                  module procedure fmax44
                                                  module procedure fmax84
                                                  module procedure fmax48
                                              end interface
                                              interface fmin
                                                  module procedure fmin88
                                                  module procedure fmin44
                                                  module procedure fmin84
                                                  module procedure fmin48
                                              end interface
                                          contains
                                              real(8) function fmax88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmax44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmax84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmax48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmin44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmin48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                              end function
                                          end module
                                          
                                          real(8) function code(f, b, x)
                                          use fmin_fmax_functions
                                              real(8), intent (in) :: f
                                              real(8), intent (in) :: b
                                              real(8), intent (in) :: x
                                              real(8) :: tmp
                                              if (f <= (-4.2d-75)) then
                                                  tmp = ((-1.0d0) - x) / b
                                              else if (f <= 4.2d-93) then
                                                  tmp = -x / b
                                              else
                                                  tmp = (1.0d0 - x) / b
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= -4.2e-75) {
                                          		tmp = (-1.0 - x) / B;
                                          	} else if (F <= 4.2e-93) {
                                          		tmp = -x / B;
                                          	} else {
                                          		tmp = (1.0 - x) / B;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(F, B, x):
                                          	tmp = 0
                                          	if F <= -4.2e-75:
                                          		tmp = (-1.0 - x) / B
                                          	elif F <= 4.2e-93:
                                          		tmp = -x / B
                                          	else:
                                          		tmp = (1.0 - x) / B
                                          	return tmp
                                          
                                          function code(F, B, x)
                                          	tmp = 0.0
                                          	if (F <= -4.2e-75)
                                          		tmp = Float64(Float64(-1.0 - x) / B);
                                          	elseif (F <= 4.2e-93)
                                          		tmp = Float64(Float64(-x) / B);
                                          	else
                                          		tmp = Float64(Float64(1.0 - x) / B);
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(F, B, x)
                                          	tmp = 0.0;
                                          	if (F <= -4.2e-75)
                                          		tmp = (-1.0 - x) / B;
                                          	elseif (F <= 4.2e-93)
                                          		tmp = -x / B;
                                          	else
                                          		tmp = (1.0 - x) / B;
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[F_, B_, x_] := If[LessEqual[F, -4.2e-75], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.2e-93], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;F \leq -4.2 \cdot 10^{-75}:\\
                                          \;\;\;\;\frac{-1 - x}{B}\\
                                          
                                          \mathbf{elif}\;F \leq 4.2 \cdot 10^{-93}:\\
                                          \;\;\;\;\frac{-x}{B}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{1 - x}{B}\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if F < -4.2000000000000002e-75

                                            1. Initial program 66.1%

                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in 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. lower-/.f64N/A

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

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

                                              \[\leadsto \frac{-1 - x}{B} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites45.8%

                                                \[\leadsto \frac{-1 - x}{B} \]

                                              if -4.2000000000000002e-75 < F < 4.2000000000000002e-93

                                              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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                              4. Step-by-step derivation
                                                1. lower-/.f64N/A

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

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

                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                              7. Step-by-step derivation
                                                1. mul-1-negN/A

                                                  \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                2. lower-neg.f6439.2

                                                  \[\leadsto \frac{-x}{B} \]
                                              8. Applied rewrites39.2%

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

                                              if 4.2000000000000002e-93 < F

                                              1. Initial program 66.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. lower-/.f64N/A

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

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

                                                \[\leadsto \frac{1 - x}{B} \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites45.0%

                                                  \[\leadsto \frac{1 - x}{B} \]
                                              8. Recombined 3 regimes into one program.
                                              9. Add Preprocessing

                                              Alternative 24: 36.7% accurate, 17.5× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.2 \cdot 10^{-75}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                              (FPCore (F B x)
                                               :precision binary64
                                               (if (<= F -4.2e-75) (/ (- -1.0 x) B) (/ (- x) B)))
                                              double code(double F, double B, double x) {
                                              	double tmp;
                                              	if (F <= -4.2e-75) {
                                              		tmp = (-1.0 - x) / B;
                                              	} else {
                                              		tmp = -x / B;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              module fmin_fmax_functions
                                                  implicit none
                                                  private
                                                  public fmax
                                                  public fmin
                                              
                                                  interface fmax
                                                      module procedure fmax88
                                                      module procedure fmax44
                                                      module procedure fmax84
                                                      module procedure fmax48
                                                  end interface
                                                  interface fmin
                                                      module procedure fmin88
                                                      module procedure fmin44
                                                      module procedure fmin84
                                                      module procedure fmin48
                                                  end interface
                                              contains
                                                  real(8) function fmax88(x, y) result (res)
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                  end function
                                                  real(4) function fmax44(x, y) result (res)
                                                      real(4), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmax84(x, y) result(res)
                                                      real(8), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmax48(x, y) result(res)
                                                      real(4), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin88(x, y) result (res)
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                  end function
                                                  real(4) function fmin44(x, y) result (res)
                                                      real(4), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin84(x, y) result(res)
                                                      real(8), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin48(x, y) result(res)
                                                      real(4), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                  end function
                                              end module
                                              
                                              real(8) function code(f, b, x)
                                              use fmin_fmax_functions
                                                  real(8), intent (in) :: f
                                                  real(8), intent (in) :: b
                                                  real(8), intent (in) :: x
                                                  real(8) :: tmp
                                                  if (f <= (-4.2d-75)) then
                                                      tmp = ((-1.0d0) - x) / b
                                                  else
                                                      tmp = -x / b
                                                  end if
                                                  code = tmp
                                              end function
                                              
                                              public static double code(double F, double B, double x) {
                                              	double tmp;
                                              	if (F <= -4.2e-75) {
                                              		tmp = (-1.0 - x) / B;
                                              	} else {
                                              		tmp = -x / B;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(F, B, x):
                                              	tmp = 0
                                              	if F <= -4.2e-75:
                                              		tmp = (-1.0 - x) / B
                                              	else:
                                              		tmp = -x / B
                                              	return tmp
                                              
                                              function code(F, B, x)
                                              	tmp = 0.0
                                              	if (F <= -4.2e-75)
                                              		tmp = Float64(Float64(-1.0 - x) / B);
                                              	else
                                              		tmp = Float64(Float64(-x) / B);
                                              	end
                                              	return tmp
                                              end
                                              
                                              function tmp_2 = code(F, B, x)
                                              	tmp = 0.0;
                                              	if (F <= -4.2e-75)
                                              		tmp = (-1.0 - x) / B;
                                              	else
                                              		tmp = -x / B;
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[F_, B_, x_] := If[LessEqual[F, -4.2e-75], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;F \leq -4.2 \cdot 10^{-75}:\\
                                              \;\;\;\;\frac{-1 - x}{B}\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\frac{-x}{B}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if F < -4.2000000000000002e-75

                                                1. Initial program 66.1%

                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in 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. lower-/.f64N/A

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

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

                                                  \[\leadsto \frac{-1 - x}{B} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites45.8%

                                                    \[\leadsto \frac{-1 - x}{B} \]

                                                  if -4.2000000000000002e-75 < F

                                                  1. Initial program 82.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  4. Step-by-step derivation
                                                    1. lower-/.f64N/A

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

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

                                                    \[\leadsto \frac{-1 \cdot x}{B} \]
                                                  7. Step-by-step derivation
                                                    1. mul-1-negN/A

                                                      \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                    2. lower-neg.f6432.1

                                                      \[\leadsto \frac{-x}{B} \]
                                                  8. Applied rewrites32.1%

                                                    \[\leadsto \frac{-x}{B} \]
                                                8. Recombined 2 regimes into one program.
                                                9. Add Preprocessing

                                                Alternative 25: 29.6% accurate, 26.3× speedup?

                                                \[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
                                                (FPCore (F B x) :precision binary64 (/ (- x) B))
                                                double code(double F, double B, double x) {
                                                	return -x / B;
                                                }
                                                
                                                module fmin_fmax_functions
                                                    implicit none
                                                    private
                                                    public fmax
                                                    public fmin
                                                
                                                    interface fmax
                                                        module procedure fmax88
                                                        module procedure fmax44
                                                        module procedure fmax84
                                                        module procedure fmax48
                                                    end interface
                                                    interface fmin
                                                        module procedure fmin88
                                                        module procedure fmin44
                                                        module procedure fmin84
                                                        module procedure fmin48
                                                    end interface
                                                contains
                                                    real(8) function fmax88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmax44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmin44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                    end function
                                                end module
                                                
                                                real(8) function code(f, b, x)
                                                use fmin_fmax_functions
                                                    real(8), intent (in) :: f
                                                    real(8), intent (in) :: b
                                                    real(8), intent (in) :: x
                                                    code = -x / b
                                                end function
                                                
                                                public static double code(double F, double B, double x) {
                                                	return -x / B;
                                                }
                                                
                                                def code(F, B, x):
                                                	return -x / B
                                                
                                                function code(F, B, x)
                                                	return Float64(Float64(-x) / B)
                                                end
                                                
                                                function tmp = code(F, B, x)
                                                	tmp = -x / B;
                                                end
                                                
                                                code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \frac{-x}{B}
                                                \end{array}
                                                
                                                Derivation
                                                1. Initial program 77.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. lower-/.f64N/A

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

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

                                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                                7. Step-by-step derivation
                                                  1. mul-1-negN/A

                                                    \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                  2. lower-neg.f6429.6

                                                    \[\leadsto \frac{-x}{B} \]
                                                8. Applied rewrites29.6%

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

                                                Reproduce

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