VandenBroeck and Keller, Equation (23)

Percentage Accurate: 75.9% → 99.6%
Time: 6.8s
Alternatives: 25
Speedup: 1.4×

Specification

?
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
(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]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}

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

\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
(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]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}

Alternative 1: 99.6% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 10^{+116}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, t\_0\right)\\


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

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{-1}, \frac{-x}{\tan B}\right) \]
    5. Step-by-step derivation
      1. Applied rewrites55.3%

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

          \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot -1 + \frac{-x}{\tan B}} \]
        2. add-flipN/A

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

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

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

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

          \[\leadsto \color{blue}{\frac{1 \cdot -1}{\sin B}} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
        7. *-lft-identityN/A

          \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
        8. lift-/.f64N/A

          \[\leadsto \frac{-1}{\sin B} - \left(\mathsf{neg}\left(\color{blue}{\frac{-x}{\tan B}}\right)\right) \]
        9. distribute-neg-frac2N/A

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

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

          \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
        12. lower-/.f6455.3

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

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

      if -1.99999999999999995e38 < F < 1.00000000000000002e116

      1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

      if 1.00000000000000002e116 < F

      1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, \frac{-x}{\tan B}\right) \]
      6. Applied rewrites52.3%

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

    Alternative 2: 99.6% accurate, 1.0× speedup?

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

      1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{-1}, \frac{-x}{\tan B}\right) \]
      5. Step-by-step derivation
        1. Applied rewrites55.3%

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

            \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot -1 + \frac{-x}{\tan B}} \]
          2. add-flipN/A

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

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

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

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

            \[\leadsto \color{blue}{\frac{1 \cdot -1}{\sin B}} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
          7. *-lft-identityN/A

            \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
          8. lift-/.f64N/A

            \[\leadsto \frac{-1}{\sin B} - \left(\mathsf{neg}\left(\color{blue}{\frac{-x}{\tan B}}\right)\right) \]
          9. distribute-neg-frac2N/A

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

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

            \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
          12. lower-/.f6455.3

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

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

        if -1.5e32 < F < 1.25e26

        1. Initial program 75.9%

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

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

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

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

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

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

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

        if 1.25e26 < F

        1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, \frac{-x}{\tan B}\right) \]
        6. Applied rewrites52.3%

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

      Alternative 3: 99.5% accurate, 1.1× speedup?

      \[\begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{+32}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{+126}:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - \cos B \cdot x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, \frac{-x}{\tan B}\right)\\ \end{array} \]
      (FPCore (F B x)
       :precision binary64
       (if (<= F -1.5e+32)
         (- (/ -1.0 (sin B)) (/ x (tan B)))
         (if (<= F 3.5e+126)
           (/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) (* (cos B) x)) (sin B))
           (fma F (/ 1.0 (* F (sin B))) (/ (- x) (tan B))))))
      double code(double F, double B, double x) {
      	double tmp;
      	if (F <= -1.5e+32) {
      		tmp = (-1.0 / sin(B)) - (x / tan(B));
      	} else if (F <= 3.5e+126) {
      		tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - (cos(B) * x)) / sin(B);
      	} else {
      		tmp = fma(F, (1.0 / (F * sin(B))), (-x / tan(B)));
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	tmp = 0.0
      	if (F <= -1.5e+32)
      		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
      	elseif (F <= 3.5e+126)
      		tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - Float64(cos(B) * x)) / sin(B));
      	else
      		tmp = fma(F, Float64(1.0 / Float64(F * sin(B))), Float64(Float64(-x) / tan(B)));
      	end
      	return tmp
      end
      
      code[F_, B_, x_] := If[LessEqual[F, -1.5e+32], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e+126], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      \mathbf{if}\;F \leq -1.5 \cdot 10^{+32}:\\
      \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
      
      \mathbf{elif}\;F \leq 3.5 \cdot 10^{+126}:\\
      \;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - \cos B \cdot x}{\sin B}\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, \frac{-x}{\tan B}\right)\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if F < -1.5e32

        1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{-1}, \frac{-x}{\tan B}\right) \]
        5. Step-by-step derivation
          1. Applied rewrites55.3%

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

              \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot -1 + \frac{-x}{\tan B}} \]
            2. add-flipN/A

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

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

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

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

              \[\leadsto \color{blue}{\frac{1 \cdot -1}{\sin B}} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
            7. *-lft-identityN/A

              \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
            8. lift-/.f64N/A

              \[\leadsto \frac{-1}{\sin B} - \left(\mathsf{neg}\left(\color{blue}{\frac{-x}{\tan B}}\right)\right) \]
            9. distribute-neg-frac2N/A

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

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

              \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
            12. lower-/.f6455.3

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

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

          if -1.5e32 < F < 3.5000000000000003e126

          1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

          if 3.5000000000000003e126 < F

          1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, \frac{-x}{\tan B}\right) \]
          6. Applied rewrites52.3%

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

        Alternative 4: 97.6% accurate, 1.1× speedup?

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

          1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{-1}, \frac{-x}{\tan B}\right) \]
          5. Step-by-step derivation
            1. Applied rewrites55.3%

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

                \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot -1 + \frac{-x}{\tan B}} \]
              2. add-flipN/A

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

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

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

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

                \[\leadsto \color{blue}{\frac{1 \cdot -1}{\sin B}} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
              7. *-lft-identityN/A

                \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
              8. lift-/.f64N/A

                \[\leadsto \frac{-1}{\sin B} - \left(\mathsf{neg}\left(\color{blue}{\frac{-x}{\tan B}}\right)\right) \]
              9. distribute-neg-frac2N/A

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

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

                \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
              12. lower-/.f6455.3

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

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

            if -2.04999999999999995e-12 < F < 2.5000000000000001e-28

            1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{2}\right)\right)}^{\frac{-1}{2}}}{\sin B}, \frac{-x}{\tan B}\right) \]
            5. Step-by-step derivation
              1. Applied rewrites56.1%

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

              if 2.5000000000000001e-28 < F

              1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, \frac{-x}{\tan B}\right) \]
              6. Applied rewrites52.3%

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

            Alternative 5: 97.5% accurate, 1.1× speedup?

            \[\begin{array}{l} \mathbf{if}\;F \leq -2.05 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-28}:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5} \cdot F - \cos B \cdot x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, \frac{-x}{\tan B}\right)\\ \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (if (<= F -2.05e-12)
               (- (/ -1.0 (sin B)) (/ x (tan B)))
               (if (<= F 2.5e-28)
                 (/ (- (* (pow (fma x 2.0 2.0) -0.5) F) (* (cos B) x)) (sin B))
                 (fma F (/ 1.0 (* F (sin B))) (/ (- x) (tan B))))))
            double code(double F, double B, double x) {
            	double tmp;
            	if (F <= -2.05e-12) {
            		tmp = (-1.0 / sin(B)) - (x / tan(B));
            	} else if (F <= 2.5e-28) {
            		tmp = ((pow(fma(x, 2.0, 2.0), -0.5) * F) - (cos(B) * x)) / sin(B);
            	} else {
            		tmp = fma(F, (1.0 / (F * sin(B))), (-x / tan(B)));
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	tmp = 0.0
            	if (F <= -2.05e-12)
            		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
            	elseif (F <= 2.5e-28)
            		tmp = Float64(Float64(Float64((fma(x, 2.0, 2.0) ^ -0.5) * F) - Float64(cos(B) * x)) / sin(B));
            	else
            		tmp = fma(F, Float64(1.0 / Float64(F * sin(B))), Float64(Float64(-x) / tan(B)));
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := If[LessEqual[F, -2.05e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.5e-28], N[(N[(N[(N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
            
            \begin{array}{l}
            \mathbf{if}\;F \leq -2.05 \cdot 10^{-12}:\\
            \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
            
            \mathbf{elif}\;F \leq 2.5 \cdot 10^{-28}:\\
            \;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5} \cdot F - \cos B \cdot x}{\sin B}\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, \frac{-x}{\tan B}\right)\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if F < -2.04999999999999995e-12

              1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{-1}, \frac{-x}{\tan B}\right) \]
              5. Step-by-step derivation
                1. Applied rewrites55.3%

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

                    \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot -1 + \frac{-x}{\tan B}} \]
                  2. add-flipN/A

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

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

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

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

                    \[\leadsto \color{blue}{\frac{1 \cdot -1}{\sin B}} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
                  7. *-lft-identityN/A

                    \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
                  8. lift-/.f64N/A

                    \[\leadsto \frac{-1}{\sin B} - \left(\mathsf{neg}\left(\color{blue}{\frac{-x}{\tan B}}\right)\right) \]
                  9. distribute-neg-frac2N/A

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

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

                    \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
                  12. lower-/.f6455.3

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

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

                if -2.04999999999999995e-12 < F < 2.5000000000000001e-28

                1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

                  if 2.5000000000000001e-28 < F

                  1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, \frac{-x}{\tan B}\right) \]
                  6. Applied rewrites52.3%

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

                Alternative 6: 90.9% accurate, 1.3× speedup?

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

                  1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{-1}, \frac{-x}{\tan B}\right) \]
                  5. Step-by-step derivation
                    1. Applied rewrites55.3%

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

                        \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot -1 + \frac{-x}{\tan B}} \]
                      2. add-flipN/A

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

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

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

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

                        \[\leadsto \color{blue}{\frac{1 \cdot -1}{\sin B}} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
                      7. *-lft-identityN/A

                        \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
                      8. lift-/.f64N/A

                        \[\leadsto \frac{-1}{\sin B} - \left(\mathsf{neg}\left(\color{blue}{\frac{-x}{\tan B}}\right)\right) \]
                      9. distribute-neg-frac2N/A

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

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

                        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
                      12. lower-/.f6455.3

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

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

                    if -6.0000000000000003e-12 < F < 2.2999999999999999e24

                    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\color{blue}{B}}, \frac{-x}{\tan B}\right) \]
                    5. Step-by-step derivation
                      1. Applied rewrites69.4%

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

                      if 2.2999999999999999e24 < F

                      1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, \frac{-x}{\tan B}\right) \]
                      6. Applied rewrites52.3%

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

                    Alternative 7: 90.8% accurate, 1.3× speedup?

                    \[\begin{array}{l} \mathbf{if}\;F \leq -6 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{-25}:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{F} \cdot F - \cos B \cdot x}{\sin B}\\ \end{array} \]
                    (FPCore (F B x)
                     :precision binary64
                     (if (<= F -6e-12)
                       (- (/ -1.0 (sin B)) (/ x (tan B)))
                       (if (<= F 9e-25)
                         (fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) B) (/ (- x) (tan B)))
                         (/ (- (* (/ 1.0 F) F) (* (cos B) x)) (sin B)))))
                    double code(double F, double B, double x) {
                    	double tmp;
                    	if (F <= -6e-12) {
                    		tmp = (-1.0 / sin(B)) - (x / tan(B));
                    	} else if (F <= 9e-25) {
                    		tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / B), (-x / tan(B)));
                    	} else {
                    		tmp = (((1.0 / F) * F) - (cos(B) * x)) / sin(B);
                    	}
                    	return tmp;
                    }
                    
                    function code(F, B, x)
                    	tmp = 0.0
                    	if (F <= -6e-12)
                    		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
                    	elseif (F <= 9e-25)
                    		tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / B), Float64(Float64(-x) / tan(B)));
                    	else
                    		tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - Float64(cos(B) * x)) / sin(B));
                    	end
                    	return tmp
                    end
                    
                    code[F_, B_, x_] := If[LessEqual[F, -6e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9e-25], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    \mathbf{if}\;F \leq -6 \cdot 10^{-12}:\\
                    \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
                    
                    \mathbf{elif}\;F \leq 9 \cdot 10^{-25}:\\
                    \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, \frac{-x}{\tan B}\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{\frac{1}{F} \cdot F - \cos B \cdot x}{\sin B}\\
                    
                    
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if F < -6.0000000000000003e-12

                      1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{-1}, \frac{-x}{\tan B}\right) \]
                      5. Step-by-step derivation
                        1. Applied rewrites55.3%

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

                            \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot -1 + \frac{-x}{\tan B}} \]
                          2. add-flipN/A

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

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

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

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

                            \[\leadsto \color{blue}{\frac{1 \cdot -1}{\sin B}} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
                          7. *-lft-identityN/A

                            \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
                          8. lift-/.f64N/A

                            \[\leadsto \frac{-1}{\sin B} - \left(\mathsf{neg}\left(\color{blue}{\frac{-x}{\tan B}}\right)\right) \]
                          9. distribute-neg-frac2N/A

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

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

                            \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
                          12. lower-/.f6455.3

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

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

                        if -6.0000000000000003e-12 < F < 9.0000000000000002e-25

                        1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\color{blue}{B}}, \frac{-x}{\tan B}\right) \]
                        5. Step-by-step derivation
                          1. Applied rewrites69.4%

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

                          if 9.0000000000000002e-25 < F

                          1. Initial program 75.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. Taylor expanded in F around inf

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

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

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

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                            2. metadata-eval47.6

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

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

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

                              \[\leadsto \frac{F}{\sin B} \cdot \frac{1}{F} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                            6. sub-flip-reverseN/A

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

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

                        Alternative 8: 79.9% accurate, 1.4× speedup?

                        \[\begin{array}{l} \mathbf{if}\;F \leq -6 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, \frac{-x}{\tan B}\right)\\ \end{array} \]
                        (FPCore (F B x)
                         :precision binary64
                         (if (<= F -6e-12)
                           (- (/ -1.0 (sin B)) (/ x (tan B)))
                           (fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) B) (/ (- x) (tan B)))))
                        double code(double F, double B, double x) {
                        	double tmp;
                        	if (F <= -6e-12) {
                        		tmp = (-1.0 / sin(B)) - (x / tan(B));
                        	} else {
                        		tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / B), (-x / tan(B)));
                        	}
                        	return tmp;
                        }
                        
                        function code(F, B, x)
                        	tmp = 0.0
                        	if (F <= -6e-12)
                        		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
                        	else
                        		tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / B), Float64(Float64(-x) / tan(B)));
                        	end
                        	return tmp
                        end
                        
                        code[F_, B_, x_] := If[LessEqual[F, -6e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        \mathbf{if}\;F \leq -6 \cdot 10^{-12}:\\
                        \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, \frac{-x}{\tan B}\right)\\
                        
                        
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if F < -6.0000000000000003e-12

                          1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{-1}, \frac{-x}{\tan B}\right) \]
                          5. Step-by-step derivation
                            1. Applied rewrites55.3%

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

                                \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot -1 + \frac{-x}{\tan B}} \]
                              2. add-flipN/A

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

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

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

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

                                \[\leadsto \color{blue}{\frac{1 \cdot -1}{\sin B}} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
                              7. *-lft-identityN/A

                                \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \left(\mathsf{neg}\left(\frac{-x}{\tan B}\right)\right) \]
                              8. lift-/.f64N/A

                                \[\leadsto \frac{-1}{\sin B} - \left(\mathsf{neg}\left(\color{blue}{\frac{-x}{\tan B}}\right)\right) \]
                              9. distribute-neg-frac2N/A

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

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

                                \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
                              12. lower-/.f6455.3

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

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

                            if -6.0000000000000003e-12 < F

                            1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\color{blue}{B}}, \frac{-x}{\tan B}\right) \]
                            5. Step-by-step derivation
                              1. Applied rewrites69.4%

                                \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\color{blue}{B}}, \frac{-x}{\tan B}\right) \]
                            6. Recombined 2 regimes into one program.
                            7. Add Preprocessing

                            Alternative 9: 75.1% accurate, 1.4× speedup?

                            \[\begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{+148}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, -1, -1 \cdot \frac{x}{B}\right)\\ \mathbf{elif}\;F \leq -5.5 \cdot 10^{-160}:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, \frac{-x}{\tan B}\right)\\ \end{array} \]
                            (FPCore (F B x)
                             :precision binary64
                             (if (<= F -6.8e+148)
                               (fma (/ 1.0 (sin B)) -1.0 (* -1.0 (/ x B)))
                               (if (<= F -5.5e-160)
                                 (/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) (sin B))
                                 (fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) B) (/ (- x) (tan B))))))
                            double code(double F, double B, double x) {
                            	double tmp;
                            	if (F <= -6.8e+148) {
                            		tmp = fma((1.0 / sin(B)), -1.0, (-1.0 * (x / B)));
                            	} else if (F <= -5.5e-160) {
                            		tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / sin(B);
                            	} else {
                            		tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / B), (-x / tan(B)));
                            	}
                            	return tmp;
                            }
                            
                            function code(F, B, x)
                            	tmp = 0.0
                            	if (F <= -6.8e+148)
                            		tmp = fma(Float64(1.0 / sin(B)), -1.0, Float64(-1.0 * Float64(x / B)));
                            	elseif (F <= -5.5e-160)
                            		tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / sin(B));
                            	else
                            		tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / B), Float64(Float64(-x) / tan(B)));
                            	end
                            	return tmp
                            end
                            
                            code[F_, B_, x_] := If[LessEqual[F, -6.8e+148], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * -1.0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.5e-160], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            \mathbf{if}\;F \leq -6.8 \cdot 10^{+148}:\\
                            \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, -1, -1 \cdot \frac{x}{B}\right)\\
                            
                            \mathbf{elif}\;F \leq -5.5 \cdot 10^{-160}:\\
                            \;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{\sin B}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, \frac{-x}{\tan B}\right)\\
                            
                            
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if F < -6.8000000000000006e148

                              1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{-1}, \frac{-x}{\tan B}\right) \]
                              5. Step-by-step derivation
                                1. Applied rewrites55.3%

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

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, -1, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                                3. Step-by-step derivation
                                  1. lower-*.f64N/A

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, -1, -1 \cdot \color{blue}{\frac{x}{B}}\right) \]
                                  2. lower-/.f6436.1

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, -1, -1 \cdot \frac{x}{\color{blue}{B}}\right) \]
                                4. Applied rewrites36.1%

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

                                if -6.8000000000000006e148 < F < -5.5e-160

                                1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F - \color{blue}{x}}{\sin B} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites59.4%

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

                                  if -5.5e-160 < F

                                  1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\color{blue}{B}}, \frac{-x}{\tan B}\right) \]
                                  5. Step-by-step derivation
                                    1. Applied rewrites69.4%

                                      \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\color{blue}{B}}, \frac{-x}{\tan B}\right) \]
                                  6. Recombined 3 regimes into one program.
                                  7. Add Preprocessing

                                  Alternative 10: 74.0% accurate, 1.5× speedup?

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

                                    1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                      5. lower-sin.f6455.4

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

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

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

                                    if -8.00000000000000024e-117 < x < 8.59999999999999996e-14

                                    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F - \color{blue}{x}}{\sin B} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites59.4%

                                        \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - \color{blue}{x}}{\sin B} \]
                                    7. Recombined 2 regimes into one program.
                                    8. Add Preprocessing

                                    Alternative 11: 70.5% accurate, 1.9× speedup?

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

                                      1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{-1}, \frac{-x}{\tan B}\right) \]
                                      5. Step-by-step derivation
                                        1. Applied rewrites55.3%

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

                                          \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, -1, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                                        3. Step-by-step derivation
                                          1. lower-*.f64N/A

                                            \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, -1, -1 \cdot \color{blue}{\frac{x}{B}}\right) \]
                                          2. lower-/.f6436.1

                                            \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, -1, -1 \cdot \frac{x}{\color{blue}{B}}\right) \]
                                        4. Applied rewrites36.1%

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

                                        if -2.04999999999999995e-12 < F < -1.69999999999999994e-54

                                        1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{\sin B} \]
                                          10. lower-sin.f6430.3

                                            \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B} \]
                                        6. Applied rewrites30.3%

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

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

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

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

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

                                            \[\leadsto \frac{{\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{\sin B} \cdot \color{blue}{F} \]
                                          6. lower-/.f6430.3

                                            \[\leadsto \frac{{\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B} \cdot F \]
                                          7. lift-+.f64N/A

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

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

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

                                            \[\leadsto \frac{{\left(F \cdot F + 2\right)}^{\frac{-1}{2}}}{\sin B} \cdot F \]
                                          11. lift-fma.f6430.3

                                            \[\leadsto \frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{\sin B} \cdot F \]
                                        8. Applied rewrites30.3%

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

                                          \[\leadsto \frac{{2}^{\frac{-1}{2}}}{\sin B} \cdot F \]
                                        10. Step-by-step derivation
                                          1. Applied rewrites19.6%

                                            \[\leadsto \frac{{2}^{-0.5}}{\sin B} \cdot F \]

                                          if -1.69999999999999994e-54 < F < 2.35e21 or 1.04999999999999997e132 < F

                                          1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                            5. lower-sin.f6455.4

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

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

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

                                          if 2.35e21 < F < 1.04999999999999997e132

                                          1. Initial program 75.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. Taylor expanded in F around inf

                                            \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                                          3. Step-by-step derivation
                                            1. lower-/.f64N/A

                                              \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                            2. lower-sin.f6417.4

                                              \[\leadsto \frac{1}{\sin B} \]
                                          4. Applied rewrites17.4%

                                            \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                                        11. Recombined 4 regimes into one program.
                                        12. Add Preprocessing

                                        Alternative 12: 68.7% accurate, 1.7× speedup?

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

                                          1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                            5. lower-sin.f6455.4

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

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

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

                                          if -7.99999999999999983e-120 < x < 1.35000000000000003e-38

                                          1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{\sin B} \]
                                            10. lower-sin.f6430.3

                                              \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B} \]
                                          6. Applied rewrites30.3%

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

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

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

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

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

                                              \[\leadsto \frac{{\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{\sin B} \cdot \color{blue}{F} \]
                                            6. lower-/.f6430.3

                                              \[\leadsto \frac{{\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B} \cdot F \]
                                            7. lift-+.f64N/A

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

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

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

                                              \[\leadsto \frac{{\left(F \cdot F + 2\right)}^{\frac{-1}{2}}}{\sin B} \cdot F \]
                                            11. lift-fma.f6430.3

                                              \[\leadsto \frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{\sin B} \cdot F \]
                                          8. Applied rewrites30.3%

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

                                        Alternative 13: 64.9% accurate, 2.2× speedup?

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

                                          1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{-1}, \frac{-x}{\tan B}\right) \]
                                          5. Step-by-step derivation
                                            1. Applied rewrites55.3%

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

                                              \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, -1, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                                            3. Step-by-step derivation
                                              1. lower-*.f64N/A

                                                \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, -1, -1 \cdot \color{blue}{\frac{x}{B}}\right) \]
                                              2. lower-/.f6436.1

                                                \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, -1, -1 \cdot \frac{x}{\color{blue}{B}}\right) \]
                                            4. Applied rewrites36.1%

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

                                            if -2.2e-55 < F < 2.35e21 or 1.04999999999999997e132 < F

                                            1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                              5. lower-sin.f6455.4

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

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

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

                                            if 2.35e21 < F < 1.04999999999999997e132

                                            1. Initial program 75.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. Taylor expanded in F around inf

                                              \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                              2. lower-sin.f6417.4

                                                \[\leadsto \frac{1}{\sin B} \]
                                            4. Applied rewrites17.4%

                                              \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                                          6. Recombined 3 regimes into one program.
                                          7. Add Preprocessing

                                          Alternative 14: 63.7% accurate, 1.9× speedup?

                                          \[\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l} \mathbf{if}\;\left|B\right| \leq 9 \cdot 10^{-18}:\\ \;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{\left|B\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan \left(\left|B\right|\right)}\\ \end{array} \]
                                          (FPCore (F B x)
                                           :precision binary64
                                           (*
                                            (copysign 1.0 B)
                                            (if (<= (fabs B) 9e-18)
                                              (/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) (fabs B))
                                              (/ (- x) (tan (fabs B))))))
                                          double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (fabs(B) <= 9e-18) {
                                          		tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / fabs(B);
                                          	} else {
                                          		tmp = -x / tan(fabs(B));
                                          	}
                                          	return copysign(1.0, B) * tmp;
                                          }
                                          
                                          function code(F, B, x)
                                          	tmp = 0.0
                                          	if (abs(B) <= 9e-18)
                                          		tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / abs(B));
                                          	else
                                          		tmp = Float64(Float64(-x) / tan(abs(B)));
                                          	end
                                          	return Float64(copysign(1.0, B) * tmp)
                                          end
                                          
                                          code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[B], $MachinePrecision], 9e-18], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision], N[((-x) / N[Tan[N[Abs[B], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                          
                                          \mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
                                          \mathbf{if}\;\left|B\right| \leq 9 \cdot 10^{-18}:\\
                                          \;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{\left|B\right|}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{-x}{\tan \left(\left|B\right|\right)}\\
                                          
                                          
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if B < 8.99999999999999987e-18

                                            1. Initial program 75.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. Taylor expanded in B around 0

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

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

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

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

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

                                            if 8.99999999999999987e-18 < B

                                            1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                              5. lower-sin.f6455.4

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

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

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

                                          Alternative 15: 57.1% accurate, 2.2× speedup?

                                          \[\begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -1.7 \cdot 10^{-54}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+21}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{+132}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                                          (FPCore (F B x)
                                           :precision binary64
                                           (let* ((t_0 (/ (- x) (tan B))))
                                             (if (<= F -1.7e-54)
                                               (/ -1.0 (sin B))
                                               (if (<= F 2.35e+21) t_0 (if (<= F 1.05e+132) (/ 1.0 (sin B)) t_0)))))
                                          double code(double F, double B, double x) {
                                          	double t_0 = -x / tan(B);
                                          	double tmp;
                                          	if (F <= -1.7e-54) {
                                          		tmp = -1.0 / sin(B);
                                          	} else if (F <= 2.35e+21) {
                                          		tmp = t_0;
                                          	} else if (F <= 1.05e+132) {
                                          		tmp = 1.0 / sin(B);
                                          	} else {
                                          		tmp = t_0;
                                          	}
                                          	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) :: t_0
                                              real(8) :: tmp
                                              t_0 = -x / tan(b)
                                              if (f <= (-1.7d-54)) then
                                                  tmp = (-1.0d0) / sin(b)
                                              else if (f <= 2.35d+21) then
                                                  tmp = t_0
                                              else if (f <= 1.05d+132) then
                                                  tmp = 1.0d0 / sin(b)
                                              else
                                                  tmp = t_0
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double F, double B, double x) {
                                          	double t_0 = -x / Math.tan(B);
                                          	double tmp;
                                          	if (F <= -1.7e-54) {
                                          		tmp = -1.0 / Math.sin(B);
                                          	} else if (F <= 2.35e+21) {
                                          		tmp = t_0;
                                          	} else if (F <= 1.05e+132) {
                                          		tmp = 1.0 / Math.sin(B);
                                          	} else {
                                          		tmp = t_0;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(F, B, x):
                                          	t_0 = -x / math.tan(B)
                                          	tmp = 0
                                          	if F <= -1.7e-54:
                                          		tmp = -1.0 / math.sin(B)
                                          	elif F <= 2.35e+21:
                                          		tmp = t_0
                                          	elif F <= 1.05e+132:
                                          		tmp = 1.0 / math.sin(B)
                                          	else:
                                          		tmp = t_0
                                          	return tmp
                                          
                                          function code(F, B, x)
                                          	t_0 = Float64(Float64(-x) / tan(B))
                                          	tmp = 0.0
                                          	if (F <= -1.7e-54)
                                          		tmp = Float64(-1.0 / sin(B));
                                          	elseif (F <= 2.35e+21)
                                          		tmp = t_0;
                                          	elseif (F <= 1.05e+132)
                                          		tmp = Float64(1.0 / sin(B));
                                          	else
                                          		tmp = t_0;
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(F, B, x)
                                          	t_0 = -x / tan(B);
                                          	tmp = 0.0;
                                          	if (F <= -1.7e-54)
                                          		tmp = -1.0 / sin(B);
                                          	elseif (F <= 2.35e+21)
                                          		tmp = t_0;
                                          	elseif (F <= 1.05e+132)
                                          		tmp = 1.0 / sin(B);
                                          	else
                                          		tmp = t_0;
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.7e-54], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.35e+21], t$95$0, If[LessEqual[F, 1.05e+132], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                                          
                                          \begin{array}{l}
                                          t_0 := \frac{-x}{\tan B}\\
                                          \mathbf{if}\;F \leq -1.7 \cdot 10^{-54}:\\
                                          \;\;\;\;\frac{-1}{\sin B}\\
                                          
                                          \mathbf{elif}\;F \leq 2.35 \cdot 10^{+21}:\\
                                          \;\;\;\;t\_0\\
                                          
                                          \mathbf{elif}\;F \leq 1.05 \cdot 10^{+132}:\\
                                          \;\;\;\;\frac{1}{\sin B}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;t\_0\\
                                          
                                          
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if F < -1.69999999999999994e-54

                                            1. Initial program 75.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. Taylor expanded in F around -inf

                                              \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                              2. lower-sin.f6417.2

                                                \[\leadsto \frac{-1}{\sin B} \]
                                            4. Applied rewrites17.2%

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

                                            if -1.69999999999999994e-54 < F < 2.35e21 or 1.04999999999999997e132 < F

                                            1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                              5. lower-sin.f6455.4

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

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

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

                                            if 2.35e21 < F < 1.04999999999999997e132

                                            1. Initial program 75.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. Taylor expanded in F around inf

                                              \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                              2. lower-sin.f6417.4

                                                \[\leadsto \frac{1}{\sin B} \]
                                            4. Applied rewrites17.4%

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

                                          Alternative 16: 45.6% accurate, 2.5× speedup?

                                          \[\begin{array}{l} \mathbf{if}\;F \leq -1.15 \cdot 10^{-54}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+21}:\\ \;\;\;\;-1 \cdot \frac{x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
                                          (FPCore (F B x)
                                           :precision binary64
                                           (if (<= F -1.15e-54)
                                             (/ -1.0 (sin B))
                                             (if (<= F 2.35e+21) (* -1.0 (/ x (sin B))) (/ 1.0 (sin B)))))
                                          double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= -1.15e-54) {
                                          		tmp = -1.0 / sin(B);
                                          	} else if (F <= 2.35e+21) {
                                          		tmp = -1.0 * (x / sin(B));
                                          	} else {
                                          		tmp = 1.0 / sin(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.15d-54)) then
                                                  tmp = (-1.0d0) / sin(b)
                                              else if (f <= 2.35d+21) then
                                                  tmp = (-1.0d0) * (x / sin(b))
                                              else
                                                  tmp = 1.0d0 / sin(b)
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= -1.15e-54) {
                                          		tmp = -1.0 / Math.sin(B);
                                          	} else if (F <= 2.35e+21) {
                                          		tmp = -1.0 * (x / Math.sin(B));
                                          	} else {
                                          		tmp = 1.0 / Math.sin(B);
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(F, B, x):
                                          	tmp = 0
                                          	if F <= -1.15e-54:
                                          		tmp = -1.0 / math.sin(B)
                                          	elif F <= 2.35e+21:
                                          		tmp = -1.0 * (x / math.sin(B))
                                          	else:
                                          		tmp = 1.0 / math.sin(B)
                                          	return tmp
                                          
                                          function code(F, B, x)
                                          	tmp = 0.0
                                          	if (F <= -1.15e-54)
                                          		tmp = Float64(-1.0 / sin(B));
                                          	elseif (F <= 2.35e+21)
                                          		tmp = Float64(-1.0 * Float64(x / sin(B)));
                                          	else
                                          		tmp = Float64(1.0 / sin(B));
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(F, B, x)
                                          	tmp = 0.0;
                                          	if (F <= -1.15e-54)
                                          		tmp = -1.0 / sin(B);
                                          	elseif (F <= 2.35e+21)
                                          		tmp = -1.0 * (x / sin(B));
                                          	else
                                          		tmp = 1.0 / sin(B);
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[F_, B_, x_] := If[LessEqual[F, -1.15e-54], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.35e+21], N[(-1.0 * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
                                          
                                          \begin{array}{l}
                                          \mathbf{if}\;F \leq -1.15 \cdot 10^{-54}:\\
                                          \;\;\;\;\frac{-1}{\sin B}\\
                                          
                                          \mathbf{elif}\;F \leq 2.35 \cdot 10^{+21}:\\
                                          \;\;\;\;-1 \cdot \frac{x}{\sin B}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{1}{\sin B}\\
                                          
                                          
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if F < -1.1499999999999999e-54

                                            1. Initial program 75.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. Taylor expanded in F around -inf

                                              \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                              2. lower-sin.f6417.2

                                                \[\leadsto \frac{-1}{\sin B} \]
                                            4. Applied rewrites17.2%

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

                                            if -1.1499999999999999e-54 < F < 2.35e21

                                            1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                              5. lower-sin.f6455.4

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

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

                                              \[\leadsto -1 \cdot \frac{x}{\sin \color{blue}{B}} \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites31.6%

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

                                              if 2.35e21 < F

                                              1. Initial program 75.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. Taylor expanded in F around inf

                                                \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                                2. lower-sin.f6417.4

                                                  \[\leadsto \frac{1}{\sin B} \]
                                              4. Applied rewrites17.4%

                                                \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                                            7. Recombined 3 regimes into one program.
                                            8. Add Preprocessing

                                            Alternative 17: 44.2% accurate, 2.6× speedup?

                                            \[\begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-76}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+21}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= F -1.8e-76)
                                               (/ -1.0 (sin B))
                                               (if (<= F 2.35e+21)
                                                 (/ (fma -1.0 x (* 0.3333333333333333 (* (pow B 2.0) x))) B)
                                                 (/ 1.0 (sin B)))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -1.8e-76) {
                                            		tmp = -1.0 / sin(B);
                                            	} else if (F <= 2.35e+21) {
                                            		tmp = fma(-1.0, x, (0.3333333333333333 * (pow(B, 2.0) * x))) / B;
                                            	} else {
                                            		tmp = 1.0 / sin(B);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (F <= -1.8e-76)
                                            		tmp = Float64(-1.0 / sin(B));
                                            	elseif (F <= 2.35e+21)
                                            		tmp = Float64(fma(-1.0, x, Float64(0.3333333333333333 * Float64((B ^ 2.0) * x))) / B);
                                            	else
                                            		tmp = Float64(1.0 / sin(B));
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[F, -1.8e-76], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.35e+21], N[(N[(-1.0 * x + N[(0.3333333333333333 * N[(N[Power[B, 2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
                                            
                                            \begin{array}{l}
                                            \mathbf{if}\;F \leq -1.8 \cdot 10^{-76}:\\
                                            \;\;\;\;\frac{-1}{\sin B}\\
                                            
                                            \mathbf{elif}\;F \leq 2.35 \cdot 10^{+21}:\\
                                            \;\;\;\;\frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{1}{\sin B}\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if F < -1.8e-76

                                              1. Initial program 75.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. Taylor expanded in F around -inf

                                                \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                2. lower-sin.f6417.2

                                                  \[\leadsto \frac{-1}{\sin B} \]
                                              4. Applied rewrites17.2%

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

                                              if -1.8e-76 < F < 2.35e21

                                              1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                  \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                                5. lower-sin.f6455.4

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

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

                                                \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                              6. Taylor expanded in B around 0

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

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

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

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, \frac{1}{3} \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                                4. lower-*.f64N/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, \frac{1}{3} \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                                5. lower-pow.f6429.3

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                              8. Applied rewrites29.3%

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

                                              if 2.35e21 < F

                                              1. Initial program 75.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. Taylor expanded in F around inf

                                                \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                                2. lower-sin.f6417.4

                                                  \[\leadsto \frac{1}{\sin B} \]
                                              4. Applied rewrites17.4%

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

                                            Alternative 18: 36.8% accurate, 2.9× speedup?

                                            \[\begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-76}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+21}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{+132}:\\ \;\;\;\;\frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{B}\\ \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= F -1.8e-76)
                                               (/ -1.0 (sin B))
                                               (if (<= F 2.35e+21)
                                                 (/ (fma -1.0 x (* 0.3333333333333333 (* (pow B 2.0) x))) B)
                                                 (if (<= F 1.1e+132) (/ 1.0 B) (- (/ x B))))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -1.8e-76) {
                                            		tmp = -1.0 / sin(B);
                                            	} else if (F <= 2.35e+21) {
                                            		tmp = fma(-1.0, x, (0.3333333333333333 * (pow(B, 2.0) * x))) / B;
                                            	} else if (F <= 1.1e+132) {
                                            		tmp = 1.0 / B;
                                            	} else {
                                            		tmp = -(x / B);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (F <= -1.8e-76)
                                            		tmp = Float64(-1.0 / sin(B));
                                            	elseif (F <= 2.35e+21)
                                            		tmp = Float64(fma(-1.0, x, Float64(0.3333333333333333 * Float64((B ^ 2.0) * x))) / B);
                                            	elseif (F <= 1.1e+132)
                                            		tmp = Float64(1.0 / B);
                                            	else
                                            		tmp = Float64(-Float64(x / B));
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[F, -1.8e-76], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.35e+21], N[(N[(-1.0 * x + N[(0.3333333333333333 * N[(N[Power[B, 2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.1e+132], N[(1.0 / B), $MachinePrecision], (-N[(x / B), $MachinePrecision])]]]
                                            
                                            \begin{array}{l}
                                            \mathbf{if}\;F \leq -1.8 \cdot 10^{-76}:\\
                                            \;\;\;\;\frac{-1}{\sin B}\\
                                            
                                            \mathbf{elif}\;F \leq 2.35 \cdot 10^{+21}:\\
                                            \;\;\;\;\frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B}\\
                                            
                                            \mathbf{elif}\;F \leq 1.1 \cdot 10^{+132}:\\
                                            \;\;\;\;\frac{1}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;-\frac{x}{B}\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 4 regimes
                                            2. if F < -1.8e-76

                                              1. Initial program 75.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. Taylor expanded in F around -inf

                                                \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                2. lower-sin.f6417.2

                                                  \[\leadsto \frac{-1}{\sin B} \]
                                              4. Applied rewrites17.2%

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

                                              if -1.8e-76 < F < 2.35e21

                                              1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                  \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                                5. lower-sin.f6455.4

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

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

                                                \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                              6. Taylor expanded in B around 0

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

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

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

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, \frac{1}{3} \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                                4. lower-*.f64N/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, \frac{1}{3} \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                                5. lower-pow.f6429.3

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                              8. Applied rewrites29.3%

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

                                              if 2.35e21 < F < 1.09999999999999994e132

                                              1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{\sin B} \]
                                                10. lower-sin.f6430.3

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B} \]
                                              6. Applied rewrites30.3%

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                4. lower-*.f64N/A

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                9. metadata-eval16.2

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{B} \]
                                              9. Applied rewrites16.2%

                                                \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\color{blue}{B}} \]
                                              10. Taylor expanded in F around inf

                                                \[\leadsto \frac{1}{B} \]
                                              11. Step-by-step derivation
                                                1. lower-/.f6410.3

                                                  \[\leadsto \frac{1}{B} \]
                                              12. Applied rewrites10.3%

                                                \[\leadsto \frac{1}{B} \]

                                              if 1.09999999999999994e132 < F

                                              1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                  \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                                5. lower-sin.f6455.4

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

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

                                                \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                                              6. Step-by-step derivation
                                                1. lower-/.f6429.4

                                                  \[\leadsto -1 \cdot \frac{x}{B} \]
                                              7. Applied rewrites29.4%

                                                \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                                              8. Step-by-step derivation
                                                1. lift-*.f64N/A

                                                  \[\leadsto -1 \cdot \color{blue}{\frac{x}{B}} \]
                                                2. mul-1-negN/A

                                                  \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
                                                3. lower-neg.f6429.4

                                                  \[\leadsto -\frac{x}{B} \]
                                              9. Applied rewrites29.4%

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

                                            Alternative 19: 36.3% accurate, 3.0× speedup?

                                            \[\begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{-123}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B}\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{-154}:\\ \;\;\;\;\left({\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot F\right) \cdot \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{B}\\ \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= x -1e-123)
                                               (/ (fma -1.0 x (* 0.3333333333333333 (* (pow B 2.0) x))) B)
                                               (if (<= x 4.6e-154)
                                                 (* (* (pow (fma F F 2.0) -0.5) F) (/ 1.0 B))
                                                 (- (/ x B)))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (x <= -1e-123) {
                                            		tmp = fma(-1.0, x, (0.3333333333333333 * (pow(B, 2.0) * x))) / B;
                                            	} else if (x <= 4.6e-154) {
                                            		tmp = (pow(fma(F, F, 2.0), -0.5) * F) * (1.0 / B);
                                            	} else {
                                            		tmp = -(x / B);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (x <= -1e-123)
                                            		tmp = Float64(fma(-1.0, x, Float64(0.3333333333333333 * Float64((B ^ 2.0) * x))) / B);
                                            	elseif (x <= 4.6e-154)
                                            		tmp = Float64(Float64((fma(F, F, 2.0) ^ -0.5) * F) * Float64(1.0 / B));
                                            	else
                                            		tmp = Float64(-Float64(x / B));
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[x, -1e-123], N[(N[(-1.0 * x + N[(0.3333333333333333 * N[(N[Power[B, 2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[x, 4.6e-154], N[(N[(N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision], (-N[(x / B), $MachinePrecision])]]
                                            
                                            \begin{array}{l}
                                            \mathbf{if}\;x \leq -1 \cdot 10^{-123}:\\
                                            \;\;\;\;\frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B}\\
                                            
                                            \mathbf{elif}\;x \leq 4.6 \cdot 10^{-154}:\\
                                            \;\;\;\;\left({\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot F\right) \cdot \frac{1}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;-\frac{x}{B}\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if x < -1.0000000000000001e-123

                                              1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                  \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                                5. lower-sin.f6455.4

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

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

                                                \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                              6. Taylor expanded in B around 0

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

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

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

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, \frac{1}{3} \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                                4. lower-*.f64N/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, \frac{1}{3} \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                                5. lower-pow.f6429.3

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                              8. Applied rewrites29.3%

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

                                              if -1.0000000000000001e-123 < x < 4.5999999999999999e-154

                                              1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{\sin B} \]
                                                10. lower-sin.f6430.3

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B} \]
                                              6. Applied rewrites30.3%

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                4. lower-*.f64N/A

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                9. metadata-eval16.2

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{B} \]
                                              9. Applied rewrites16.2%

                                                \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\color{blue}{B}} \]
                                              10. Step-by-step derivation
                                                1. lift-/.f64N/A

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{B} \]
                                                2. mult-flipN/A

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

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

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

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

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

                                                  \[\leadsto \left({\left({F}^{2} + 2\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \frac{1}{B} \]
                                                8. lift-pow.f64N/A

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

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

                                                  \[\leadsto \left({\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \frac{1}{B} \]
                                                11. lower-*.f64N/A

                                                  \[\leadsto \left({\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \frac{1}{B} \]
                                                12. lower-/.f6416.2

                                                  \[\leadsto \left({\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot F\right) \cdot \frac{1}{B} \]
                                              11. Applied rewrites16.2%

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

                                              if 4.5999999999999999e-154 < x

                                              1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                  \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                                5. lower-sin.f6455.4

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

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

                                                \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                                              6. Step-by-step derivation
                                                1. lower-/.f6429.4

                                                  \[\leadsto -1 \cdot \frac{x}{B} \]
                                              7. Applied rewrites29.4%

                                                \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                                              8. Step-by-step derivation
                                                1. lift-*.f64N/A

                                                  \[\leadsto -1 \cdot \color{blue}{\frac{x}{B}} \]
                                                2. mul-1-negN/A

                                                  \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
                                                3. lower-neg.f6429.4

                                                  \[\leadsto -\frac{x}{B} \]
                                              9. Applied rewrites29.4%

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

                                            Alternative 20: 36.3% accurate, 3.2× speedup?

                                            \[\begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{-123}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B}\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{-154}:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B} \cdot F\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{B}\\ \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= x -1e-123)
                                               (/ (fma -1.0 x (* 0.3333333333333333 (* (pow B 2.0) x))) B)
                                               (if (<= x 4.6e-154) (* (/ (pow (fma F F 2.0) -0.5) B) F) (- (/ x B)))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (x <= -1e-123) {
                                            		tmp = fma(-1.0, x, (0.3333333333333333 * (pow(B, 2.0) * x))) / B;
                                            	} else if (x <= 4.6e-154) {
                                            		tmp = (pow(fma(F, F, 2.0), -0.5) / B) * F;
                                            	} else {
                                            		tmp = -(x / B);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (x <= -1e-123)
                                            		tmp = Float64(fma(-1.0, x, Float64(0.3333333333333333 * Float64((B ^ 2.0) * x))) / B);
                                            	elseif (x <= 4.6e-154)
                                            		tmp = Float64(Float64((fma(F, F, 2.0) ^ -0.5) / B) * F);
                                            	else
                                            		tmp = Float64(-Float64(x / B));
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[x, -1e-123], N[(N[(-1.0 * x + N[(0.3333333333333333 * N[(N[Power[B, 2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[x, 4.6e-154], N[(N[(N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] * F), $MachinePrecision], (-N[(x / B), $MachinePrecision])]]
                                            
                                            \begin{array}{l}
                                            \mathbf{if}\;x \leq -1 \cdot 10^{-123}:\\
                                            \;\;\;\;\frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B}\\
                                            
                                            \mathbf{elif}\;x \leq 4.6 \cdot 10^{-154}:\\
                                            \;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B} \cdot F\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;-\frac{x}{B}\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if x < -1.0000000000000001e-123

                                              1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                  \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                                5. lower-sin.f6455.4

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

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

                                                \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                              6. Taylor expanded in B around 0

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

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

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

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, \frac{1}{3} \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                                4. lower-*.f64N/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, \frac{1}{3} \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                                5. lower-pow.f6429.3

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                              8. Applied rewrites29.3%

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

                                              if -1.0000000000000001e-123 < x < 4.5999999999999999e-154

                                              1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{\sin B} \]
                                                10. lower-sin.f6430.3

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B} \]
                                              6. Applied rewrites30.3%

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                4. lower-*.f64N/A

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                9. metadata-eval16.2

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{B} \]
                                              9. Applied rewrites16.2%

                                                \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\color{blue}{B}} \]
                                              10. Step-by-step derivation
                                                1. lift-/.f64N/A

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{B} \]
                                                3. associate-/l*N/A

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

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

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

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

                                                  \[\leadsto \frac{{\left({F}^{2} + 2\right)}^{\frac{-1}{2}}}{B} \cdot F \]
                                                8. lift-pow.f64N/A

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

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

                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}}}{B} \cdot F \]
                                                11. lower-/.f6416.2

                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B} \cdot F \]
                                              11. Applied rewrites16.2%

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

                                              if 4.5999999999999999e-154 < x

                                              1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                  \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                                5. lower-sin.f6455.4

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

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

                                                \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                                              6. Step-by-step derivation
                                                1. lower-/.f6429.4

                                                  \[\leadsto -1 \cdot \frac{x}{B} \]
                                              7. Applied rewrites29.4%

                                                \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                                              8. Step-by-step derivation
                                                1. lift-*.f64N/A

                                                  \[\leadsto -1 \cdot \color{blue}{\frac{x}{B}} \]
                                                2. mul-1-negN/A

                                                  \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
                                                3. lower-neg.f6429.4

                                                  \[\leadsto -\frac{x}{B} \]
                                              9. Applied rewrites29.4%

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

                                            Alternative 21: 36.3% accurate, 3.2× speedup?

                                            \[\begin{array}{l} t_0 := -\frac{x}{B}\\ \mathbf{if}\;x \leq -1 \cdot 10^{-123}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{-154}:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B} \cdot F\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (let* ((t_0 (- (/ x B))))
                                               (if (<= x -1e-123)
                                                 t_0
                                                 (if (<= x 4.6e-154) (* (/ (pow (fma F F 2.0) -0.5) B) F) t_0))))
                                            double code(double F, double B, double x) {
                                            	double t_0 = -(x / B);
                                            	double tmp;
                                            	if (x <= -1e-123) {
                                            		tmp = t_0;
                                            	} else if (x <= 4.6e-154) {
                                            		tmp = (pow(fma(F, F, 2.0), -0.5) / B) * F;
                                            	} else {
                                            		tmp = t_0;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(F, B, x)
                                            	t_0 = Float64(-Float64(x / B))
                                            	tmp = 0.0
                                            	if (x <= -1e-123)
                                            		tmp = t_0;
                                            	elseif (x <= 4.6e-154)
                                            		tmp = Float64(Float64((fma(F, F, 2.0) ^ -0.5) / B) * F);
                                            	else
                                            		tmp = t_0;
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[x, -1e-123], t$95$0, If[LessEqual[x, 4.6e-154], N[(N[(N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] * F), $MachinePrecision], t$95$0]]]
                                            
                                            \begin{array}{l}
                                            t_0 := -\frac{x}{B}\\
                                            \mathbf{if}\;x \leq -1 \cdot 10^{-123}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            \mathbf{elif}\;x \leq 4.6 \cdot 10^{-154}:\\
                                            \;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B} \cdot F\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if x < -1.0000000000000001e-123 or 4.5999999999999999e-154 < x

                                              1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                  \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                                5. lower-sin.f6455.4

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

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

                                                \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                                              6. Step-by-step derivation
                                                1. lower-/.f6429.4

                                                  \[\leadsto -1 \cdot \frac{x}{B} \]
                                              7. Applied rewrites29.4%

                                                \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                                              8. Step-by-step derivation
                                                1. lift-*.f64N/A

                                                  \[\leadsto -1 \cdot \color{blue}{\frac{x}{B}} \]
                                                2. mul-1-negN/A

                                                  \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
                                                3. lower-neg.f6429.4

                                                  \[\leadsto -\frac{x}{B} \]
                                              9. Applied rewrites29.4%

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

                                              if -1.0000000000000001e-123 < x < 4.5999999999999999e-154

                                              1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{\sin B} \]
                                                10. lower-sin.f6430.3

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B} \]
                                              6. Applied rewrites30.3%

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                4. lower-*.f64N/A

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                9. metadata-eval16.2

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{B} \]
                                              9. Applied rewrites16.2%

                                                \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\color{blue}{B}} \]
                                              10. Step-by-step derivation
                                                1. lift-/.f64N/A

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{B} \]
                                                3. associate-/l*N/A

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

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

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

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

                                                  \[\leadsto \frac{{\left({F}^{2} + 2\right)}^{\frac{-1}{2}}}{B} \cdot F \]
                                                8. lift-pow.f64N/A

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

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

                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}}}{B} \cdot F \]
                                                11. lower-/.f6416.2

                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B} \cdot F \]
                                              11. Applied rewrites16.2%

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

                                            Alternative 22: 29.4% accurate, 3.9× speedup?

                                            \[\begin{array}{l} t_0 := -\frac{x}{B}\\ \mathbf{if}\;F \leq -5.2 \cdot 10^{+148}:\\ \;\;\;\;\frac{-0.16666666666666666 \cdot {B}^{2} - 1}{B}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+21}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{+132}:\\ \;\;\;\;\frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (let* ((t_0 (- (/ x B))))
                                               (if (<= F -5.2e+148)
                                                 (/ (- (* -0.16666666666666666 (pow B 2.0)) 1.0) B)
                                                 (if (<= F 2.35e+21) t_0 (if (<= F 1.1e+132) (/ 1.0 B) t_0)))))
                                            double code(double F, double B, double x) {
                                            	double t_0 = -(x / B);
                                            	double tmp;
                                            	if (F <= -5.2e+148) {
                                            		tmp = ((-0.16666666666666666 * pow(B, 2.0)) - 1.0) / B;
                                            	} else if (F <= 2.35e+21) {
                                            		tmp = t_0;
                                            	} else if (F <= 1.1e+132) {
                                            		tmp = 1.0 / B;
                                            	} else {
                                            		tmp = t_0;
                                            	}
                                            	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) :: t_0
                                                real(8) :: tmp
                                                t_0 = -(x / b)
                                                if (f <= (-5.2d+148)) then
                                                    tmp = (((-0.16666666666666666d0) * (b ** 2.0d0)) - 1.0d0) / b
                                                else if (f <= 2.35d+21) then
                                                    tmp = t_0
                                                else if (f <= 1.1d+132) then
                                                    tmp = 1.0d0 / b
                                                else
                                                    tmp = t_0
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	double t_0 = -(x / B);
                                            	double tmp;
                                            	if (F <= -5.2e+148) {
                                            		tmp = ((-0.16666666666666666 * Math.pow(B, 2.0)) - 1.0) / B;
                                            	} else if (F <= 2.35e+21) {
                                            		tmp = t_0;
                                            	} else if (F <= 1.1e+132) {
                                            		tmp = 1.0 / B;
                                            	} else {
                                            		tmp = t_0;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(F, B, x):
                                            	t_0 = -(x / B)
                                            	tmp = 0
                                            	if F <= -5.2e+148:
                                            		tmp = ((-0.16666666666666666 * math.pow(B, 2.0)) - 1.0) / B
                                            	elif F <= 2.35e+21:
                                            		tmp = t_0
                                            	elif F <= 1.1e+132:
                                            		tmp = 1.0 / B
                                            	else:
                                            		tmp = t_0
                                            	return tmp
                                            
                                            function code(F, B, x)
                                            	t_0 = Float64(-Float64(x / B))
                                            	tmp = 0.0
                                            	if (F <= -5.2e+148)
                                            		tmp = Float64(Float64(Float64(-0.16666666666666666 * (B ^ 2.0)) - 1.0) / B);
                                            	elseif (F <= 2.35e+21)
                                            		tmp = t_0;
                                            	elseif (F <= 1.1e+132)
                                            		tmp = Float64(1.0 / B);
                                            	else
                                            		tmp = t_0;
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(F, B, x)
                                            	t_0 = -(x / B);
                                            	tmp = 0.0;
                                            	if (F <= -5.2e+148)
                                            		tmp = ((-0.16666666666666666 * (B ^ 2.0)) - 1.0) / B;
                                            	elseif (F <= 2.35e+21)
                                            		tmp = t_0;
                                            	elseif (F <= 1.1e+132)
                                            		tmp = 1.0 / B;
                                            	else
                                            		tmp = t_0;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -5.2e+148], N[(N[(N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.35e+21], t$95$0, If[LessEqual[F, 1.1e+132], N[(1.0 / B), $MachinePrecision], t$95$0]]]]
                                            
                                            \begin{array}{l}
                                            t_0 := -\frac{x}{B}\\
                                            \mathbf{if}\;F \leq -5.2 \cdot 10^{+148}:\\
                                            \;\;\;\;\frac{-0.16666666666666666 \cdot {B}^{2} - 1}{B}\\
                                            
                                            \mathbf{elif}\;F \leq 2.35 \cdot 10^{+21}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            \mathbf{elif}\;F \leq 1.1 \cdot 10^{+132}:\\
                                            \;\;\;\;\frac{1}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if F < -5.2e148

                                              1. Initial program 75.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. Taylor expanded in F around -inf

                                                \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                2. lower-sin.f6417.2

                                                  \[\leadsto \frac{-1}{\sin B} \]
                                              4. Applied rewrites17.2%

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

                                                \[\leadsto \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{\color{blue}{B}} \]
                                              6. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{B} \]
                                                2. lower--.f64N/A

                                                  \[\leadsto \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{B} \]
                                                3. lower-*.f64N/A

                                                  \[\leadsto \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{B} \]
                                                4. lower-pow.f649.7

                                                  \[\leadsto \frac{-0.16666666666666666 \cdot {B}^{2} - 1}{B} \]
                                              7. Applied rewrites9.7%

                                                \[\leadsto \frac{-0.16666666666666666 \cdot {B}^{2} - 1}{\color{blue}{B}} \]

                                              if -5.2e148 < F < 2.35e21 or 1.09999999999999994e132 < F

                                              1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                  \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                                5. lower-sin.f6455.4

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

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

                                                \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                                              6. Step-by-step derivation
                                                1. lower-/.f6429.4

                                                  \[\leadsto -1 \cdot \frac{x}{B} \]
                                              7. Applied rewrites29.4%

                                                \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                                              8. Step-by-step derivation
                                                1. lift-*.f64N/A

                                                  \[\leadsto -1 \cdot \color{blue}{\frac{x}{B}} \]
                                                2. mul-1-negN/A

                                                  \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
                                                3. lower-neg.f6429.4

                                                  \[\leadsto -\frac{x}{B} \]
                                              9. Applied rewrites29.4%

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

                                              if 2.35e21 < F < 1.09999999999999994e132

                                              1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{\sin B} \]
                                                10. lower-sin.f6430.3

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B} \]
                                              6. Applied rewrites30.3%

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                4. lower-*.f64N/A

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

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

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

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

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                9. metadata-eval16.2

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{B} \]
                                              9. Applied rewrites16.2%

                                                \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\color{blue}{B}} \]
                                              10. Taylor expanded in F around inf

                                                \[\leadsto \frac{1}{B} \]
                                              11. Step-by-step derivation
                                                1. lower-/.f6410.3

                                                  \[\leadsto \frac{1}{B} \]
                                              12. Applied rewrites10.3%

                                                \[\leadsto \frac{1}{B} \]
                                            3. Recombined 3 regimes into one program.
                                            4. Add Preprocessing

                                            Alternative 23: 29.4% accurate, 6.9× speedup?

                                            \[\begin{array}{l} t_0 := -\frac{x}{B}\\ \mathbf{if}\;F \leq -5.2 \cdot 10^{+148}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+21}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{+132}:\\ \;\;\;\;\frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (let* ((t_0 (- (/ x B))))
                                               (if (<= F -5.2e+148)
                                                 (/ -1.0 B)
                                                 (if (<= F 2.35e+21) t_0 (if (<= F 1.1e+132) (/ 1.0 B) t_0)))))
                                            double code(double F, double B, double x) {
                                            	double t_0 = -(x / B);
                                            	double tmp;
                                            	if (F <= -5.2e+148) {
                                            		tmp = -1.0 / B;
                                            	} else if (F <= 2.35e+21) {
                                            		tmp = t_0;
                                            	} else if (F <= 1.1e+132) {
                                            		tmp = 1.0 / B;
                                            	} else {
                                            		tmp = t_0;
                                            	}
                                            	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) :: t_0
                                                real(8) :: tmp
                                                t_0 = -(x / b)
                                                if (f <= (-5.2d+148)) then
                                                    tmp = (-1.0d0) / b
                                                else if (f <= 2.35d+21) then
                                                    tmp = t_0
                                                else if (f <= 1.1d+132) then
                                                    tmp = 1.0d0 / b
                                                else
                                                    tmp = t_0
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	double t_0 = -(x / B);
                                            	double tmp;
                                            	if (F <= -5.2e+148) {
                                            		tmp = -1.0 / B;
                                            	} else if (F <= 2.35e+21) {
                                            		tmp = t_0;
                                            	} else if (F <= 1.1e+132) {
                                            		tmp = 1.0 / B;
                                            	} else {
                                            		tmp = t_0;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(F, B, x):
                                            	t_0 = -(x / B)
                                            	tmp = 0
                                            	if F <= -5.2e+148:
                                            		tmp = -1.0 / B
                                            	elif F <= 2.35e+21:
                                            		tmp = t_0
                                            	elif F <= 1.1e+132:
                                            		tmp = 1.0 / B
                                            	else:
                                            		tmp = t_0
                                            	return tmp
                                            
                                            function code(F, B, x)
                                            	t_0 = Float64(-Float64(x / B))
                                            	tmp = 0.0
                                            	if (F <= -5.2e+148)
                                            		tmp = Float64(-1.0 / B);
                                            	elseif (F <= 2.35e+21)
                                            		tmp = t_0;
                                            	elseif (F <= 1.1e+132)
                                            		tmp = Float64(1.0 / B);
                                            	else
                                            		tmp = t_0;
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(F, B, x)
                                            	t_0 = -(x / B);
                                            	tmp = 0.0;
                                            	if (F <= -5.2e+148)
                                            		tmp = -1.0 / B;
                                            	elseif (F <= 2.35e+21)
                                            		tmp = t_0;
                                            	elseif (F <= 1.1e+132)
                                            		tmp = 1.0 / B;
                                            	else
                                            		tmp = t_0;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -5.2e+148], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 2.35e+21], t$95$0, If[LessEqual[F, 1.1e+132], N[(1.0 / B), $MachinePrecision], t$95$0]]]]
                                            
                                            \begin{array}{l}
                                            t_0 := -\frac{x}{B}\\
                                            \mathbf{if}\;F \leq -5.2 \cdot 10^{+148}:\\
                                            \;\;\;\;\frac{-1}{B}\\
                                            
                                            \mathbf{elif}\;F \leq 2.35 \cdot 10^{+21}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            \mathbf{elif}\;F \leq 1.1 \cdot 10^{+132}:\\
                                            \;\;\;\;\frac{1}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if F < -5.2e148

                                              1. Initial program 75.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. Taylor expanded in F around -inf

                                                \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                2. lower-sin.f6417.2

                                                  \[\leadsto \frac{-1}{\sin B} \]
                                              4. Applied rewrites17.2%

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

                                                \[\leadsto \frac{-1}{B} \]
                                              6. Step-by-step derivation
                                                1. Applied rewrites10.0%

                                                  \[\leadsto \frac{-1}{B} \]

                                                if -5.2e148 < F < 2.35e21 or 1.09999999999999994e132 < F

                                                1. Initial program 75.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. Taylor expanded in F around 0

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

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

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

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

                                                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                                  5. lower-sin.f6455.4

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

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

                                                  \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                                                6. Step-by-step derivation
                                                  1. lower-/.f6429.4

                                                    \[\leadsto -1 \cdot \frac{x}{B} \]
                                                7. Applied rewrites29.4%

                                                  \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                                                8. Step-by-step derivation
                                                  1. lift-*.f64N/A

                                                    \[\leadsto -1 \cdot \color{blue}{\frac{x}{B}} \]
                                                  2. mul-1-negN/A

                                                    \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
                                                  3. lower-neg.f6429.4

                                                    \[\leadsto -\frac{x}{B} \]
                                                9. Applied rewrites29.4%

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

                                                if 2.35e21 < F < 1.09999999999999994e132

                                                1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{\sin B} \]
                                                  10. lower-sin.f6430.3

                                                    \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B} \]
                                                6. Applied rewrites30.3%

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

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

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

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

                                                    \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                  4. lower-*.f64N/A

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

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

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

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

                                                    \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                  9. metadata-eval16.2

                                                    \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{B} \]
                                                9. Applied rewrites16.2%

                                                  \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\color{blue}{B}} \]
                                                10. Taylor expanded in F around inf

                                                  \[\leadsto \frac{1}{B} \]
                                                11. Step-by-step derivation
                                                  1. lower-/.f6410.3

                                                    \[\leadsto \frac{1}{B} \]
                                                12. Applied rewrites10.3%

                                                  \[\leadsto \frac{1}{B} \]
                                              7. Recombined 3 regimes into one program.
                                              8. Add Preprocessing

                                              Alternative 24: 17.5% accurate, 14.2× speedup?

                                              \[\begin{array}{l} \mathbf{if}\;F \leq 4.8 \cdot 10^{-93}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
                                              (FPCore (F B x) :precision binary64 (if (<= F 4.8e-93) (/ -1.0 B) (/ 1.0 B)))
                                              double code(double F, double B, double x) {
                                              	double tmp;
                                              	if (F <= 4.8e-93) {
                                              		tmp = -1.0 / B;
                                              	} else {
                                              		tmp = 1.0 / 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.8d-93) then
                                                      tmp = (-1.0d0) / b
                                                  else
                                                      tmp = 1.0d0 / b
                                                  end if
                                                  code = tmp
                                              end function
                                              
                                              public static double code(double F, double B, double x) {
                                              	double tmp;
                                              	if (F <= 4.8e-93) {
                                              		tmp = -1.0 / B;
                                              	} else {
                                              		tmp = 1.0 / B;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(F, B, x):
                                              	tmp = 0
                                              	if F <= 4.8e-93:
                                              		tmp = -1.0 / B
                                              	else:
                                              		tmp = 1.0 / B
                                              	return tmp
                                              
                                              function code(F, B, x)
                                              	tmp = 0.0
                                              	if (F <= 4.8e-93)
                                              		tmp = Float64(-1.0 / B);
                                              	else
                                              		tmp = Float64(1.0 / B);
                                              	end
                                              	return tmp
                                              end
                                              
                                              function tmp_2 = code(F, B, x)
                                              	tmp = 0.0;
                                              	if (F <= 4.8e-93)
                                              		tmp = -1.0 / B;
                                              	else
                                              		tmp = 1.0 / B;
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[F_, B_, x_] := If[LessEqual[F, 4.8e-93], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
                                              
                                              \begin{array}{l}
                                              \mathbf{if}\;F \leq 4.8 \cdot 10^{-93}:\\
                                              \;\;\;\;\frac{-1}{B}\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\frac{1}{B}\\
                                              
                                              
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if F < 4.8000000000000002e-93

                                                1. Initial program 75.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. Taylor expanded in F around -inf

                                                  \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                3. Step-by-step derivation
                                                  1. lower-/.f64N/A

                                                    \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                  2. lower-sin.f6417.2

                                                    \[\leadsto \frac{-1}{\sin B} \]
                                                4. Applied rewrites17.2%

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

                                                  \[\leadsto \frac{-1}{B} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites10.0%

                                                    \[\leadsto \frac{-1}{B} \]

                                                  if 4.8000000000000002e-93 < F

                                                  1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\frac{-1}{2}}}{\sin B} \]
                                                    10. lower-sin.f6430.3

                                                      \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B} \]
                                                  6. Applied rewrites30.3%

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

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

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

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

                                                      \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                    4. lower-*.f64N/A

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

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

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

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

                                                      \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{B} \]
                                                    9. metadata-eval16.2

                                                      \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{B} \]
                                                  9. Applied rewrites16.2%

                                                    \[\leadsto \frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\color{blue}{B}} \]
                                                  10. Taylor expanded in F around inf

                                                    \[\leadsto \frac{1}{B} \]
                                                  11. Step-by-step derivation
                                                    1. lower-/.f6410.3

                                                      \[\leadsto \frac{1}{B} \]
                                                  12. Applied rewrites10.3%

                                                    \[\leadsto \frac{1}{B} \]
                                                7. Recombined 2 regimes into one program.
                                                8. Add Preprocessing

                                                Alternative 25: 10.0% accurate, 26.5× speedup?

                                                \[\frac{-1}{B} \]
                                                (FPCore (F B x) :precision binary64 (/ -1.0 B))
                                                double code(double F, double B, double x) {
                                                	return -1.0 / 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 = (-1.0d0) / b
                                                end function
                                                
                                                public static double code(double F, double B, double x) {
                                                	return -1.0 / B;
                                                }
                                                
                                                def code(F, B, x):
                                                	return -1.0 / B
                                                
                                                function code(F, B, x)
                                                	return Float64(-1.0 / B)
                                                end
                                                
                                                function tmp = code(F, B, x)
                                                	tmp = -1.0 / B;
                                                end
                                                
                                                code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
                                                
                                                \frac{-1}{B}
                                                
                                                Derivation
                                                1. Initial program 75.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. Taylor expanded in F around -inf

                                                  \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                3. Step-by-step derivation
                                                  1. lower-/.f64N/A

                                                    \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                  2. lower-sin.f6417.2

                                                    \[\leadsto \frac{-1}{\sin B} \]
                                                4. Applied rewrites17.2%

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

                                                  \[\leadsto \frac{-1}{B} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites10.0%

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

                                                  Reproduce

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