VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.7% → 99.6%
Time: 5.9s
Alternatives: 22
Speedup: 1.3×

Specification

?
\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 77.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

Alternative 1: 99.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sin B}\\ t_1 := -x \cdot \frac{1}{\tan B}\\ \mathbf{if}\;F \leq -6 \cdot 10^{+35}:\\ \;\;\;\;-1 \cdot \frac{x \cdot \cos B}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 21000000:\\ \;\;\;\;t\_1 + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1 + t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ 1.0 (sin B))) (t_1 (- (* x (/ 1.0 (tan B))))))
   (if (<= F -6e+35)
     (- (* -1.0 (/ (* x (cos B)) (sin B))) t_0)
     (if (<= F 21000000.0)
       (+
        t_1
        (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
       (+ t_1 t_0)))))
double code(double F, double B, double x) {
	double t_0 = 1.0 / sin(B);
	double t_1 = -(x * (1.0 / tan(B)));
	double tmp;
	if (F <= -6e+35) {
		tmp = (-1.0 * ((x * cos(B)) / sin(B))) - t_0;
	} else if (F <= 21000000.0) {
		tmp = t_1 + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = t_1 + 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) :: t_1
    real(8) :: tmp
    t_0 = 1.0d0 / sin(b)
    t_1 = -(x * (1.0d0 / tan(b)))
    if (f <= (-6d+35)) then
        tmp = ((-1.0d0) * ((x * cos(b)) / sin(b))) - t_0
    else if (f <= 21000000.0d0) then
        tmp = t_1 + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
    else
        tmp = t_1 + t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = 1.0 / Math.sin(B);
	double t_1 = -(x * (1.0 / Math.tan(B)));
	double tmp;
	if (F <= -6e+35) {
		tmp = (-1.0 * ((x * Math.cos(B)) / Math.sin(B))) - t_0;
	} else if (F <= 21000000.0) {
		tmp = t_1 + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = t_1 + t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = 1.0 / math.sin(B)
	t_1 = -(x * (1.0 / math.tan(B)))
	tmp = 0
	if F <= -6e+35:
		tmp = (-1.0 * ((x * math.cos(B)) / math.sin(B))) - t_0
	elif F <= 21000000.0:
		tmp = t_1 + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
	else:
		tmp = t_1 + t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(1.0 / sin(B))
	t_1 = Float64(-Float64(x * Float64(1.0 / tan(B))))
	tmp = 0.0
	if (F <= -6e+35)
		tmp = Float64(Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B))) - t_0);
	elseif (F <= 21000000.0)
		tmp = Float64(t_1 + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))));
	else
		tmp = Float64(t_1 + t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = 1.0 / sin(B);
	t_1 = -(x * (1.0 / tan(B)));
	tmp = 0.0;
	if (F <= -6e+35)
		tmp = (-1.0 * ((x * cos(B)) / sin(B))) - t_0;
	elseif (F <= 21000000.0)
		tmp = t_1 + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
	else
		tmp = t_1 + t_0;
	end
	tmp_2 = 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[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -6e+35], N[(N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 21000000.0], N[(t$95$1 + 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], N[(t$95$1 + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 21000000:\\
\;\;\;\;t\_1 + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_1 + t\_0\\


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

    1. Initial program 77.7%

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
      8. lift-sin.f6455.8

        \[\leadsto -1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
    4. Applied rewrites55.8%

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} - \frac{1}{\sin B} \]
      8. lift-/.f6455.8

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

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

    if -5.99999999999999981e35 < F < 2.1e7

    1. Initial program 77.7%

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

    if 2.1e7 < F

    1. Initial program 77.7%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6455.8

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

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

Alternative 2: 99.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sin B}\\ t_1 := -x \cdot \frac{1}{\tan B}\\ \mathbf{if}\;F \leq -1.45:\\ \;\;\;\;-1 \cdot \frac{x \cdot \cos B}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;t\_1 + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;t\_1 + t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ 1.0 (sin B))) (t_1 (- (* x (/ 1.0 (tan B))))))
   (if (<= F -1.45)
     (- (* -1.0 (/ (* x (cos B)) (sin B))) t_0)
     (if (<= F 1.4)
       (+ t_1 (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* 2.0 x))))))
       (+ t_1 t_0)))))
double code(double F, double B, double x) {
	double t_0 = 1.0 / sin(B);
	double t_1 = -(x * (1.0 / tan(B)));
	double tmp;
	if (F <= -1.45) {
		tmp = (-1.0 * ((x * cos(B)) / sin(B))) - t_0;
	} else if (F <= 1.4) {
		tmp = t_1 + ((F / sin(B)) * sqrt((1.0 / (2.0 + (2.0 * x)))));
	} else {
		tmp = t_1 + 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) :: t_1
    real(8) :: tmp
    t_0 = 1.0d0 / sin(b)
    t_1 = -(x * (1.0d0 / tan(b)))
    if (f <= (-1.45d0)) then
        tmp = ((-1.0d0) * ((x * cos(b)) / sin(b))) - t_0
    else if (f <= 1.4d0) then
        tmp = t_1 + ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (2.0d0 * x)))))
    else
        tmp = t_1 + t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = 1.0 / Math.sin(B);
	double t_1 = -(x * (1.0 / Math.tan(B)));
	double tmp;
	if (F <= -1.45) {
		tmp = (-1.0 * ((x * Math.cos(B)) / Math.sin(B))) - t_0;
	} else if (F <= 1.4) {
		tmp = t_1 + ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (2.0 * x)))));
	} else {
		tmp = t_1 + t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = 1.0 / math.sin(B)
	t_1 = -(x * (1.0 / math.tan(B)))
	tmp = 0
	if F <= -1.45:
		tmp = (-1.0 * ((x * math.cos(B)) / math.sin(B))) - t_0
	elif F <= 1.4:
		tmp = t_1 + ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (2.0 * x)))))
	else:
		tmp = t_1 + t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(1.0 / sin(B))
	t_1 = Float64(-Float64(x * Float64(1.0 / tan(B))))
	tmp = 0.0
	if (F <= -1.45)
		tmp = Float64(Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B))) - t_0);
	elseif (F <= 1.4)
		tmp = Float64(t_1 + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(2.0 * x))))));
	else
		tmp = Float64(t_1 + t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = 1.0 / sin(B);
	t_1 = -(x * (1.0 / tan(B)));
	tmp = 0.0;
	if (F <= -1.45)
		tmp = (-1.0 * ((x * cos(B)) / sin(B))) - t_0;
	elseif (F <= 1.4)
		tmp = t_1 + ((F / sin(B)) * sqrt((1.0 / (2.0 + (2.0 * x)))));
	else
		tmp = t_1 + t_0;
	end
	tmp_2 = 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[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -1.45], N[(N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(t$95$1 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t\_1 + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}\\

\mathbf{else}:\\
\;\;\;\;t\_1 + t\_0\\


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

    1. Initial program 77.7%

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
      8. lift-sin.f6455.8

        \[\leadsto -1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
    4. Applied rewrites55.8%

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} - \frac{1}{\sin B} \]
      8. lift-/.f6455.8

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

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

    if -1.44999999999999996 < F < 1.3999999999999999

    1. Initial program 77.7%

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} \]
      4. lift-*.f6455.8

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

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

    if 1.3999999999999999 < F

    1. Initial program 77.7%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6455.8

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

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

Alternative 3: 98.9% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 77.7%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
    4. Applied rewrites55.7%

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

    if -1.44999999999999996 < F < 1.3999999999999999

    1. Initial program 77.7%

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} \]
      4. lift-*.f6455.8

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

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

    if 1.3999999999999999 < F

    1. Initial program 77.7%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6455.8

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

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

Alternative 4: 91.2% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;F \leq 190000:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}}\\

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


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

    1. Initial program 77.7%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
    4. Applied rewrites55.7%

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

    if -3.8e21 < F < 1.9e5

    1. Initial program 77.7%

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} \]
      7. lower-pow.f6462.8

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

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

    if 1.9e5 < F

    1. Initial program 77.7%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6455.8

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

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

Alternative 5: 84.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;F \leq 3.8 \cdot 10^{+52}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}}\\

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


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

    1. Initial program 77.7%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
    4. Applied rewrites55.7%

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

    if -3.8e21 < F < 3.8e52

    1. Initial program 77.7%

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} \]
      7. lower-pow.f6462.8

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

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

    if 3.8e52 < F

    1. Initial program 77.7%

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

      \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Step-by-step derivation
      1. Applied rewrites50.1%

        \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{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}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
      3. Step-by-step derivation
        1. lift-sin.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{1}{\sin B} \]
        2. lift-/.f6436.3

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

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

    Alternative 6: 78.7% accurate, 1.3× speedup?

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

      1. Initial program 77.7%

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

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

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

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

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

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

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

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

          \[\leadsto -1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
        8. lift-sin.f6455.8

          \[\leadsto -1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
      4. Applied rewrites55.8%

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

        \[\leadsto -1 \cdot \left(\frac{1}{\sin B} + \frac{x}{\sin \color{blue}{B}}\right) \]
      6. Step-by-step derivation
        1. Applied rewrites37.8%

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

        if -4e22 < F < 3.8e52

        1. Initial program 77.7%

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

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

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

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

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} \]
          7. lower-pow.f6462.8

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

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

        if 3.8e52 < F

        1. Initial program 77.7%

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

          \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        3. Step-by-step derivation
          1. Applied rewrites50.1%

            \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{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}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
          3. Step-by-step derivation
            1. lift-sin.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{1}{\sin B} \]
            2. lift-/.f6436.3

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

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

        Alternative 7: 75.6% accurate, 1.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := -1 \cdot \frac{x \cdot \cos B}{\sin B}\\ \mathbf{if}\;x \leq -0.00039:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{-84}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (F B x)
         :precision binary64
         (let* ((t_0 (* -1.0 (/ (* x (cos B)) (sin B)))))
           (if (<= x -0.00039)
             t_0
             (if (<= x 8.5e-84)
               (+
                (- (/ x B))
                (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
               t_0))))
        double code(double F, double B, double x) {
        	double t_0 = -1.0 * ((x * cos(B)) / sin(B));
        	double tmp;
        	if (x <= -0.00039) {
        		tmp = t_0;
        	} else if (x <= 8.5e-84) {
        		tmp = -(x / B) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
        	} 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 = (-1.0d0) * ((x * cos(b)) / sin(b))
            if (x <= (-0.00039d0)) then
                tmp = t_0
            else if (x <= 8.5d-84) then
                tmp = -(x / b) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
            else
                tmp = t_0
            end if
            code = tmp
        end function
        
        public static double code(double F, double B, double x) {
        	double t_0 = -1.0 * ((x * Math.cos(B)) / Math.sin(B));
        	double tmp;
        	if (x <= -0.00039) {
        		tmp = t_0;
        	} else if (x <= 8.5e-84) {
        		tmp = -(x / B) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(F, B, x):
        	t_0 = -1.0 * ((x * math.cos(B)) / math.sin(B))
        	tmp = 0
        	if x <= -0.00039:
        		tmp = t_0
        	elif x <= 8.5e-84:
        		tmp = -(x / B) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
        	else:
        		tmp = t_0
        	return tmp
        
        function code(F, B, x)
        	t_0 = Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B)))
        	tmp = 0.0
        	if (x <= -0.00039)
        		tmp = t_0;
        	elseif (x <= 8.5e-84)
        		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))));
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        function tmp_2 = code(F, B, x)
        	t_0 = -1.0 * ((x * cos(B)) / sin(B));
        	tmp = 0.0;
        	if (x <= -0.00039)
        		tmp = t_0;
        	elseif (x <= 8.5e-84)
        		tmp = -(x / B) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
        	else
        		tmp = t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.00039], t$95$0, If[LessEqual[x, 8.5e-84], N[((-N[(x / B), $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], t$95$0]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := -1 \cdot \frac{x \cdot \cos B}{\sin B}\\
        \mathbf{if}\;x \leq -0.00039:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;x \leq 8.5 \cdot 10^{-84}:\\
        \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < -3.89999999999999993e-4 or 8.4999999999999994e-84 < x

          1. Initial program 77.7%

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

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

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

          if -3.89999999999999993e-4 < x < 8.4999999999999994e-84

          1. Initial program 77.7%

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

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

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

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

        Alternative 8: 70.9% accurate, 1.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := -1 \cdot \frac{x \cdot \cos B}{\sin B}\\ \mathbf{if}\;x \leq -9.5 \cdot 10^{-60}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{-84}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (F B x)
         :precision binary64
         (let* ((t_0 (* -1.0 (/ (* x (cos B)) (sin B)))))
           (if (<= x -9.5e-60)
             t_0
             (if (<= x 8.2e-84)
               (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (pow F 2.0)))))
               t_0))))
        double code(double F, double B, double x) {
        	double t_0 = -1.0 * ((x * cos(B)) / sin(B));
        	double tmp;
        	if (x <= -9.5e-60) {
        		tmp = t_0;
        	} else if (x <= 8.2e-84) {
        		tmp = (F / sin(B)) * sqrt((1.0 / (2.0 + pow(F, 2.0))));
        	} 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 = (-1.0d0) * ((x * cos(b)) / sin(b))
            if (x <= (-9.5d-60)) then
                tmp = t_0
            else if (x <= 8.2d-84) then
                tmp = (f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (f ** 2.0d0))))
            else
                tmp = t_0
            end if
            code = tmp
        end function
        
        public static double code(double F, double B, double x) {
        	double t_0 = -1.0 * ((x * Math.cos(B)) / Math.sin(B));
        	double tmp;
        	if (x <= -9.5e-60) {
        		tmp = t_0;
        	} else if (x <= 8.2e-84) {
        		tmp = (F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + Math.pow(F, 2.0))));
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(F, B, x):
        	t_0 = -1.0 * ((x * math.cos(B)) / math.sin(B))
        	tmp = 0
        	if x <= -9.5e-60:
        		tmp = t_0
        	elif x <= 8.2e-84:
        		tmp = (F / math.sin(B)) * math.sqrt((1.0 / (2.0 + math.pow(F, 2.0))))
        	else:
        		tmp = t_0
        	return tmp
        
        function code(F, B, x)
        	t_0 = Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B)))
        	tmp = 0.0
        	if (x <= -9.5e-60)
        		tmp = t_0;
        	elseif (x <= 8.2e-84)
        		tmp = Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + (F ^ 2.0)))));
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        function tmp_2 = code(F, B, x)
        	t_0 = -1.0 * ((x * cos(B)) / sin(B));
        	tmp = 0.0;
        	if (x <= -9.5e-60)
        		tmp = t_0;
        	elseif (x <= 8.2e-84)
        		tmp = (F / sin(B)) * sqrt((1.0 / (2.0 + (F ^ 2.0))));
        	else
        		tmp = t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.5e-60], t$95$0, If[LessEqual[x, 8.2e-84], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := -1 \cdot \frac{x \cdot \cos B}{\sin B}\\
        \mathbf{if}\;x \leq -9.5 \cdot 10^{-60}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;x \leq 8.2 \cdot 10^{-84}:\\
        \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < -9.49999999999999958e-60 or 8.2000000000000001e-84 < x

          1. Initial program 77.7%

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

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

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

          if -9.49999999999999958e-60 < x < 8.2000000000000001e-84

          1. Initial program 77.7%

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

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

              \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \]
            2. lift-sin.f64N/A

              \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{\color{blue}{2 + {F}^{2}}}} \]
            3. lift-/.f64N/A

              \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\color{blue}{\frac{1}{2 + {F}^{2}}}} \]
            4. lower-sqrt.f64N/A

              \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
            5. lower-/.f64N/A

              \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
            6. lower-+.f64N/A

              \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
            7. lower-pow.f6429.4

              \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
          4. Applied rewrites29.4%

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 9: 63.9% accurate, 1.9× speedup?

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

          1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

          if 58 < B

          1. Initial program 77.7%

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

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

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

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

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

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

        Alternative 10: 57.1% accurate, 2.2× speedup?

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

          1. Initial program 77.7%

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

            \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          3. Step-by-step derivation
            1. Applied rewrites50.1%

              \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{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}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
              2. lift-sin.f6436.3

                \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{-1}{\sin B} \]
            4. Applied rewrites36.3%

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

            if -7.99999999999999956e-20 < F < 1.9e5

            1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

            if 1.9e5 < F

            1. Initial program 77.7%

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

              \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
            3. Step-by-step derivation
              1. Applied rewrites50.1%

                \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{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}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
              3. Step-by-step derivation
                1. lift-sin.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{1}{\sin B} \]
                2. lift-/.f6436.3

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

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

            Alternative 11: 56.7% accurate, 2.3× speedup?

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

              1. Initial program 77.7%

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

                \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              3. Step-by-step derivation
                1. Applied rewrites50.1%

                  \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{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}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                3. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                  2. lift-sin.f6436.3

                    \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{-1}{\sin B} \]
                4. Applied rewrites36.3%

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

                if -7.99999999999999956e-20 < F < 2.9e7

                1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                if 2.9e7 < F

                1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 12: 50.9% accurate, 2.5× speedup?

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

                  1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                    8. lift-pow.f6422.0

                      \[\leadsto \frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                  7. Applied rewrites22.0%

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

                  if -0.46999999999999997 < F < 2.9e7

                  1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                  if 2.9e7 < F

                  1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 13: 50.6% accurate, 2.8× speedup?

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

                    1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                      8. lift-pow.f6422.0

                        \[\leadsto \frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                    7. Applied rewrites22.0%

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

                    if -0.46999999999999997 < F < 1.3999999999999999

                    1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 1.3999999999999999 < F

                    1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 14: 50.6% accurate, 3.1× speedup?

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

                      1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{-1 - x}{B} \]
                      6. Step-by-step derivation
                        1. Applied rewrites29.9%

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

                        if -1.44999999999999996 < F < 1.3999999999999999

                        1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 1.3999999999999999 < F

                        1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 15: 50.6% accurate, 4.1× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.45:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                        (FPCore (F B x)
                         :precision binary64
                         (if (<= F -1.45)
                           (/ (- -1.0 x) B)
                           (if (<= F 1.4)
                             (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* 2.0 x))))) x) B)
                             (/ (- 1.0 x) B))))
                        double code(double F, double B, double x) {
                        	double tmp;
                        	if (F <= -1.45) {
                        		tmp = (-1.0 - x) / B;
                        	} else if (F <= 1.4) {
                        		tmp = ((F * sqrt((1.0 / (2.0 + (2.0 * x))))) - x) / B;
                        	} else {
                        		tmp = (1.0 - x) / B;
                        	}
                        	return tmp;
                        }
                        
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(f, b, x)
                        use fmin_fmax_functions
                            real(8), intent (in) :: f
                            real(8), intent (in) :: b
                            real(8), intent (in) :: x
                            real(8) :: tmp
                            if (f <= (-1.45d0)) then
                                tmp = ((-1.0d0) - x) / b
                            else if (f <= 1.4d0) then
                                tmp = ((f * sqrt((1.0d0 / (2.0d0 + (2.0d0 * x))))) - x) / b
                            else
                                tmp = (1.0d0 - x) / b
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double F, double B, double x) {
                        	double tmp;
                        	if (F <= -1.45) {
                        		tmp = (-1.0 - x) / B;
                        	} else if (F <= 1.4) {
                        		tmp = ((F * Math.sqrt((1.0 / (2.0 + (2.0 * x))))) - x) / B;
                        	} else {
                        		tmp = (1.0 - x) / B;
                        	}
                        	return tmp;
                        }
                        
                        def code(F, B, x):
                        	tmp = 0
                        	if F <= -1.45:
                        		tmp = (-1.0 - x) / B
                        	elif F <= 1.4:
                        		tmp = ((F * math.sqrt((1.0 / (2.0 + (2.0 * x))))) - x) / B
                        	else:
                        		tmp = (1.0 - x) / B
                        	return tmp
                        
                        function code(F, B, x)
                        	tmp = 0.0
                        	if (F <= -1.45)
                        		tmp = Float64(Float64(-1.0 - x) / B);
                        	elseif (F <= 1.4)
                        		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(2.0 * x))))) - x) / B);
                        	else
                        		tmp = Float64(Float64(1.0 - x) / B);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(F, B, x)
                        	tmp = 0.0;
                        	if (F <= -1.45)
                        		tmp = (-1.0 - x) / B;
                        	elseif (F <= 1.4)
                        		tmp = ((F * sqrt((1.0 / (2.0 + (2.0 * x))))) - x) / B;
                        	else
                        		tmp = (1.0 - x) / B;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[F_, B_, x_] := If[LessEqual[F, -1.45], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;F \leq -1.45:\\
                        \;\;\;\;\frac{-1 - x}{B}\\
                        
                        \mathbf{elif}\;F \leq 1.4:\\
                        \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{1 - x}{B}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if F < -1.44999999999999996

                          1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{-1 - x}{B} \]
                          6. Step-by-step derivation
                            1. Applied rewrites29.9%

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

                            if -1.44999999999999996 < F < 1.3999999999999999

                            1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B} \]
                            6. Step-by-step derivation
                              1. lift-*.f6430.1

                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B} \]
                            7. Applied rewrites30.1%

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

                            if 1.3999999999999999 < F

                            1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 16: 44.4% accurate, 5.6× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7 \cdot 10^{-50}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 8.8 \cdot 10^{-70}:\\ \;\;\;\;\frac{-1 \cdot x}{B}\\ \mathbf{elif}\;F \leq 0.6:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                            (FPCore (F B x)
                             :precision binary64
                             (if (<= F -7e-50)
                               (/ (- -1.0 x) B)
                               (if (<= F 8.8e-70)
                                 (/ (* -1.0 x) B)
                                 (if (<= F 0.6) (* (/ F B) (sqrt 0.5)) (/ (- 1.0 x) B)))))
                            double code(double F, double B, double x) {
                            	double tmp;
                            	if (F <= -7e-50) {
                            		tmp = (-1.0 - x) / B;
                            	} else if (F <= 8.8e-70) {
                            		tmp = (-1.0 * x) / B;
                            	} else if (F <= 0.6) {
                            		tmp = (F / B) * sqrt(0.5);
                            	} else {
                            		tmp = (1.0 - x) / B;
                            	}
                            	return tmp;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(f, b, x)
                            use fmin_fmax_functions
                                real(8), intent (in) :: f
                                real(8), intent (in) :: b
                                real(8), intent (in) :: x
                                real(8) :: tmp
                                if (f <= (-7d-50)) then
                                    tmp = ((-1.0d0) - x) / b
                                else if (f <= 8.8d-70) then
                                    tmp = ((-1.0d0) * x) / b
                                else if (f <= 0.6d0) then
                                    tmp = (f / b) * sqrt(0.5d0)
                                else
                                    tmp = (1.0d0 - x) / b
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double F, double B, double x) {
                            	double tmp;
                            	if (F <= -7e-50) {
                            		tmp = (-1.0 - x) / B;
                            	} else if (F <= 8.8e-70) {
                            		tmp = (-1.0 * x) / B;
                            	} else if (F <= 0.6) {
                            		tmp = (F / B) * Math.sqrt(0.5);
                            	} else {
                            		tmp = (1.0 - x) / B;
                            	}
                            	return tmp;
                            }
                            
                            def code(F, B, x):
                            	tmp = 0
                            	if F <= -7e-50:
                            		tmp = (-1.0 - x) / B
                            	elif F <= 8.8e-70:
                            		tmp = (-1.0 * x) / B
                            	elif F <= 0.6:
                            		tmp = (F / B) * math.sqrt(0.5)
                            	else:
                            		tmp = (1.0 - x) / B
                            	return tmp
                            
                            function code(F, B, x)
                            	tmp = 0.0
                            	if (F <= -7e-50)
                            		tmp = Float64(Float64(-1.0 - x) / B);
                            	elseif (F <= 8.8e-70)
                            		tmp = Float64(Float64(-1.0 * x) / B);
                            	elseif (F <= 0.6)
                            		tmp = Float64(Float64(F / B) * sqrt(0.5));
                            	else
                            		tmp = Float64(Float64(1.0 - x) / B);
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(F, B, x)
                            	tmp = 0.0;
                            	if (F <= -7e-50)
                            		tmp = (-1.0 - x) / B;
                            	elseif (F <= 8.8e-70)
                            		tmp = (-1.0 * x) / B;
                            	elseif (F <= 0.6)
                            		tmp = (F / B) * sqrt(0.5);
                            	else
                            		tmp = (1.0 - x) / B;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[F_, B_, x_] := If[LessEqual[F, -7e-50], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.8e-70], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.6], N[(N[(F / B), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;F \leq -7 \cdot 10^{-50}:\\
                            \;\;\;\;\frac{-1 - x}{B}\\
                            
                            \mathbf{elif}\;F \leq 8.8 \cdot 10^{-70}:\\
                            \;\;\;\;\frac{-1 \cdot x}{B}\\
                            
                            \mathbf{elif}\;F \leq 0.6:\\
                            \;\;\;\;\frac{F}{B} \cdot \sqrt{0.5}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{1 - x}{B}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 4 regimes
                            2. if F < -6.99999999999999993e-50

                              1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{-1 - x}{B} \]
                              6. Step-by-step derivation
                                1. Applied rewrites29.9%

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

                                if -6.99999999999999993e-50 < F < 8.7999999999999996e-70

                                1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                6. Step-by-step derivation
                                  1. lower-*.f6430.2

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

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

                                if 8.7999999999999996e-70 < F < 0.599999999999999978

                                1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                  2. lower-/.f64N/A

                                    \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                  3. lower-sqrt.f64N/A

                                    \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                  4. lower-/.f64N/A

                                    \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                  5. lower-+.f64N/A

                                    \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                  6. lift-pow.f6415.1

                                    \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                7. Applied rewrites15.1%

                                  \[\leadsto \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                8. Taylor expanded in F around 0

                                  \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2}} \]
                                9. Step-by-step derivation
                                  1. Applied rewrites12.5%

                                    \[\leadsto \frac{F}{B} \cdot \sqrt{0.5} \]

                                  if 0.599999999999999978 < F

                                  1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  Alternative 17: 44.4% accurate, 5.6× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7 \cdot 10^{-50}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 8.8 \cdot 10^{-70}:\\ \;\;\;\;\frac{-1 \cdot x}{B}\\ \mathbf{elif}\;F \leq 0.6:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                  (FPCore (F B x)
                                   :precision binary64
                                   (if (<= F -7e-50)
                                     (/ (- -1.0 x) B)
                                     (if (<= F 8.8e-70)
                                       (/ (* -1.0 x) B)
                                       (if (<= F 0.6) (/ (* F (sqrt 0.5)) B) (/ (- 1.0 x) B)))))
                                  double code(double F, double B, double x) {
                                  	double tmp;
                                  	if (F <= -7e-50) {
                                  		tmp = (-1.0 - x) / B;
                                  	} else if (F <= 8.8e-70) {
                                  		tmp = (-1.0 * x) / B;
                                  	} else if (F <= 0.6) {
                                  		tmp = (F * sqrt(0.5)) / B;
                                  	} else {
                                  		tmp = (1.0 - x) / B;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(f, b, x)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: f
                                      real(8), intent (in) :: b
                                      real(8), intent (in) :: x
                                      real(8) :: tmp
                                      if (f <= (-7d-50)) then
                                          tmp = ((-1.0d0) - x) / b
                                      else if (f <= 8.8d-70) then
                                          tmp = ((-1.0d0) * x) / b
                                      else if (f <= 0.6d0) then
                                          tmp = (f * sqrt(0.5d0)) / b
                                      else
                                          tmp = (1.0d0 - x) / b
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double F, double B, double x) {
                                  	double tmp;
                                  	if (F <= -7e-50) {
                                  		tmp = (-1.0 - x) / B;
                                  	} else if (F <= 8.8e-70) {
                                  		tmp = (-1.0 * x) / B;
                                  	} else if (F <= 0.6) {
                                  		tmp = (F * Math.sqrt(0.5)) / B;
                                  	} else {
                                  		tmp = (1.0 - x) / B;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(F, B, x):
                                  	tmp = 0
                                  	if F <= -7e-50:
                                  		tmp = (-1.0 - x) / B
                                  	elif F <= 8.8e-70:
                                  		tmp = (-1.0 * x) / B
                                  	elif F <= 0.6:
                                  		tmp = (F * math.sqrt(0.5)) / B
                                  	else:
                                  		tmp = (1.0 - x) / B
                                  	return tmp
                                  
                                  function code(F, B, x)
                                  	tmp = 0.0
                                  	if (F <= -7e-50)
                                  		tmp = Float64(Float64(-1.0 - x) / B);
                                  	elseif (F <= 8.8e-70)
                                  		tmp = Float64(Float64(-1.0 * x) / B);
                                  	elseif (F <= 0.6)
                                  		tmp = Float64(Float64(F * sqrt(0.5)) / B);
                                  	else
                                  		tmp = Float64(Float64(1.0 - x) / B);
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(F, B, x)
                                  	tmp = 0.0;
                                  	if (F <= -7e-50)
                                  		tmp = (-1.0 - x) / B;
                                  	elseif (F <= 8.8e-70)
                                  		tmp = (-1.0 * x) / B;
                                  	elseif (F <= 0.6)
                                  		tmp = (F * sqrt(0.5)) / B;
                                  	else
                                  		tmp = (1.0 - x) / B;
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[F_, B_, x_] := If[LessEqual[F, -7e-50], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.8e-70], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.6], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;F \leq -7 \cdot 10^{-50}:\\
                                  \;\;\;\;\frac{-1 - x}{B}\\
                                  
                                  \mathbf{elif}\;F \leq 8.8 \cdot 10^{-70}:\\
                                  \;\;\;\;\frac{-1 \cdot x}{B}\\
                                  
                                  \mathbf{elif}\;F \leq 0.6:\\
                                  \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\frac{1 - x}{B}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 4 regimes
                                  2. if F < -6.99999999999999993e-50

                                    1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{-1 - x}{B} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites29.9%

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

                                      if -6.99999999999999993e-50 < F < 8.7999999999999996e-70

                                      1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                      6. Step-by-step derivation
                                        1. lower-*.f6430.2

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

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

                                      if 8.7999999999999996e-70 < F < 0.599999999999999978

                                      1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                        2. lower-/.f64N/A

                                          \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                        3. lower-sqrt.f64N/A

                                          \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                        4. lower-/.f64N/A

                                          \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                        5. lower-+.f64N/A

                                          \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                        6. lift-pow.f6415.1

                                          \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                      7. Applied rewrites15.1%

                                        \[\leadsto \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                      8. Taylor expanded in F around 0

                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                      9. Step-by-step derivation
                                        1. metadata-evalN/A

                                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                        2. lower-/.f64N/A

                                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                        3. lower-*.f64N/A

                                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                        4. lower-sqrt.f64N/A

                                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                        5. metadata-eval12.5

                                          \[\leadsto \frac{F \cdot \sqrt{0.5}}{B} \]
                                      10. Applied rewrites12.5%

                                        \[\leadsto \frac{F \cdot \sqrt{0.5}}{B} \]

                                      if 0.599999999999999978 < F

                                      1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      Alternative 18: 43.1% accurate, 7.8× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7 \cdot 10^{-50}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-153}:\\ \;\;\;\;\frac{-1 \cdot x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                      (FPCore (F B x)
                                       :precision binary64
                                       (if (<= F -7e-50)
                                         (/ (- -1.0 x) B)
                                         (if (<= F 7e-153) (/ (* -1.0 x) B) (/ (- 1.0 x) B))))
                                      double code(double F, double B, double x) {
                                      	double tmp;
                                      	if (F <= -7e-50) {
                                      		tmp = (-1.0 - x) / B;
                                      	} else if (F <= 7e-153) {
                                      		tmp = (-1.0 * x) / B;
                                      	} else {
                                      		tmp = (1.0 - x) / B;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      module fmin_fmax_functions
                                          implicit none
                                          private
                                          public fmax
                                          public fmin
                                      
                                          interface fmax
                                              module procedure fmax88
                                              module procedure fmax44
                                              module procedure fmax84
                                              module procedure fmax48
                                          end interface
                                          interface fmin
                                              module procedure fmin88
                                              module procedure fmin44
                                              module procedure fmin84
                                              module procedure fmin48
                                          end interface
                                      contains
                                          real(8) function fmax88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmax44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmax84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmax48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmin44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmin48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                          end function
                                      end module
                                      
                                      real(8) function code(f, b, x)
                                      use fmin_fmax_functions
                                          real(8), intent (in) :: f
                                          real(8), intent (in) :: b
                                          real(8), intent (in) :: x
                                          real(8) :: tmp
                                          if (f <= (-7d-50)) then
                                              tmp = ((-1.0d0) - x) / b
                                          else if (f <= 7d-153) then
                                              tmp = ((-1.0d0) * x) / b
                                          else
                                              tmp = (1.0d0 - x) / b
                                          end if
                                          code = tmp
                                      end function
                                      
                                      public static double code(double F, double B, double x) {
                                      	double tmp;
                                      	if (F <= -7e-50) {
                                      		tmp = (-1.0 - x) / B;
                                      	} else if (F <= 7e-153) {
                                      		tmp = (-1.0 * x) / B;
                                      	} else {
                                      		tmp = (1.0 - x) / B;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(F, B, x):
                                      	tmp = 0
                                      	if F <= -7e-50:
                                      		tmp = (-1.0 - x) / B
                                      	elif F <= 7e-153:
                                      		tmp = (-1.0 * x) / B
                                      	else:
                                      		tmp = (1.0 - x) / B
                                      	return tmp
                                      
                                      function code(F, B, x)
                                      	tmp = 0.0
                                      	if (F <= -7e-50)
                                      		tmp = Float64(Float64(-1.0 - x) / B);
                                      	elseif (F <= 7e-153)
                                      		tmp = Float64(Float64(-1.0 * x) / B);
                                      	else
                                      		tmp = Float64(Float64(1.0 - x) / B);
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(F, B, x)
                                      	tmp = 0.0;
                                      	if (F <= -7e-50)
                                      		tmp = (-1.0 - x) / B;
                                      	elseif (F <= 7e-153)
                                      		tmp = (-1.0 * x) / B;
                                      	else
                                      		tmp = (1.0 - x) / B;
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      code[F_, B_, x_] := If[LessEqual[F, -7e-50], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7e-153], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;F \leq -7 \cdot 10^{-50}:\\
                                      \;\;\;\;\frac{-1 - x}{B}\\
                                      
                                      \mathbf{elif}\;F \leq 7 \cdot 10^{-153}:\\
                                      \;\;\;\;\frac{-1 \cdot x}{B}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\frac{1 - x}{B}\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if F < -6.99999999999999993e-50

                                        1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{-1 - x}{B} \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites29.9%

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

                                          if -6.99999999999999993e-50 < F < 6.99999999999999961e-153

                                          1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                          6. Step-by-step derivation
                                            1. lower-*.f6430.2

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

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

                                          if 6.99999999999999961e-153 < F

                                          1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          Alternative 19: 36.9% accurate, 10.7× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 6.4 \cdot 10^{-236}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                          (FPCore (F B x)
                                           :precision binary64
                                           (if (<= F 6.4e-236) (/ (- -1.0 x) B) (/ (- 1.0 x) B)))
                                          double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= 6.4e-236) {
                                          		tmp = (-1.0 - x) / B;
                                          	} else {
                                          		tmp = (1.0 - x) / B;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          module fmin_fmax_functions
                                              implicit none
                                              private
                                              public fmax
                                              public fmin
                                          
                                              interface fmax
                                                  module procedure fmax88
                                                  module procedure fmax44
                                                  module procedure fmax84
                                                  module procedure fmax48
                                              end interface
                                              interface fmin
                                                  module procedure fmin88
                                                  module procedure fmin44
                                                  module procedure fmin84
                                                  module procedure fmin48
                                              end interface
                                          contains
                                              real(8) function fmax88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmax44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmax84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmax48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmin44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmin48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                              end function
                                          end module
                                          
                                          real(8) function code(f, b, x)
                                          use fmin_fmax_functions
                                              real(8), intent (in) :: f
                                              real(8), intent (in) :: b
                                              real(8), intent (in) :: x
                                              real(8) :: tmp
                                              if (f <= 6.4d-236) then
                                                  tmp = ((-1.0d0) - x) / b
                                              else
                                                  tmp = (1.0d0 - x) / b
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= 6.4e-236) {
                                          		tmp = (-1.0 - x) / B;
                                          	} else {
                                          		tmp = (1.0 - x) / B;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(F, B, x):
                                          	tmp = 0
                                          	if F <= 6.4e-236:
                                          		tmp = (-1.0 - x) / B
                                          	else:
                                          		tmp = (1.0 - x) / B
                                          	return tmp
                                          
                                          function code(F, B, x)
                                          	tmp = 0.0
                                          	if (F <= 6.4e-236)
                                          		tmp = Float64(Float64(-1.0 - x) / B);
                                          	else
                                          		tmp = Float64(Float64(1.0 - x) / B);
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(F, B, x)
                                          	tmp = 0.0;
                                          	if (F <= 6.4e-236)
                                          		tmp = (-1.0 - x) / B;
                                          	else
                                          		tmp = (1.0 - x) / B;
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[F_, B_, x_] := If[LessEqual[F, 6.4e-236], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;F \leq 6.4 \cdot 10^{-236}:\\
                                          \;\;\;\;\frac{-1 - x}{B}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{1 - x}{B}\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if F < 6.3999999999999999e-236

                                            1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{-1 - x}{B} \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites29.9%

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

                                              if 6.3999999999999999e-236 < F

                                              1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              Alternative 20: 29.9% accurate, 16.6× speedup?

                                              \[\begin{array}{l} \\ \frac{-1 - x}{B} \end{array} \]
                                              (FPCore (F B x) :precision binary64 (/ (- -1.0 x) B))
                                              double code(double F, double B, double x) {
                                              	return (-1.0 - x) / B;
                                              }
                                              
                                              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) - x) / b
                                              end function
                                              
                                              public static double code(double F, double B, double x) {
                                              	return (-1.0 - x) / B;
                                              }
                                              
                                              def code(F, B, x):
                                              	return (-1.0 - x) / B
                                              
                                              function code(F, B, x)
                                              	return Float64(Float64(-1.0 - x) / B)
                                              end
                                              
                                              function tmp = code(F, B, x)
                                              	tmp = (-1.0 - x) / B;
                                              end
                                              
                                              code[F_, B_, x_] := N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \frac{-1 - x}{B}
                                              \end{array}
                                              
                                              Derivation
                                              1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{-1 - x}{B} \]
                                              6. Step-by-step derivation
                                                1. Applied rewrites29.9%

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

                                                Alternative 21: 16.7% accurate, 14.2× speedup?

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

                                                  1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                    2. lower-/.f64N/A

                                                      \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                    3. lower-sqrt.f64N/A

                                                      \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                    4. lower-/.f64N/A

                                                      \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                    5. lower-+.f64N/A

                                                      \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                    6. lift-pow.f6415.1

                                                      \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                  7. Applied rewrites15.1%

                                                    \[\leadsto \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                                  8. Taylor expanded in F around -inf

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

                                                      \[\leadsto \frac{-1}{B} \]
                                                  10. Applied rewrites10.2%

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

                                                  if 8.19999999999999925e-77 < F

                                                  1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                    2. lower-/.f64N/A

                                                      \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                    3. lower-sqrt.f64N/A

                                                      \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                    4. lower-/.f64N/A

                                                      \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                    5. lower-+.f64N/A

                                                      \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                    6. lift-pow.f6415.1

                                                      \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                  7. Applied rewrites15.1%

                                                    \[\leadsto \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                                  8. Taylor expanded in F around inf

                                                    \[\leadsto \frac{1}{B} \]
                                                  9. Step-by-step derivation
                                                    1. lift-/.f649.4

                                                      \[\leadsto \frac{1}{B} \]
                                                  10. Applied rewrites9.4%

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

                                                Alternative 22: 10.2% accurate, 26.5× speedup?

                                                \[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
                                                (FPCore (F B x) :precision binary64 (/ -1.0 B))
                                                double code(double F, double B, double x) {
                                                	return -1.0 / B;
                                                }
                                                
                                                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]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \frac{-1}{B}
                                                \end{array}
                                                
                                                Derivation
                                                1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                  2. lower-/.f64N/A

                                                    \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                  3. lower-sqrt.f64N/A

                                                    \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                  4. lower-/.f64N/A

                                                    \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                  5. lower-+.f64N/A

                                                    \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                  6. lift-pow.f6415.1

                                                    \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                                7. Applied rewrites15.1%

                                                  \[\leadsto \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                                8. Taylor expanded in F around -inf

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

                                                    \[\leadsto \frac{-1}{B} \]
                                                10. Applied rewrites10.2%

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

                                                Reproduce

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