Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 17.3s
Alternatives: 16
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (/ eh ew) (tan t)))))
   (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((eh / ew) / tan(t)));
	return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
}
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(eh, ew, t)
use fmin_fmax_functions
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    t_1 = atan(((eh / ew) / tan(t)))
    code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
	return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t):
	t_1 = math.atan(((eh / ew) / math.tan(t)))
	return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(eh / ew) / tan(t)))
	return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1))))
end
function tmp = code(eh, ew, t)
	t_1 = atan(((eh / ew) / tan(t)));
	tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 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: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (/ eh ew) (tan t)))))
   (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((eh / ew) / tan(t)));
	return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
}
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(eh, ew, t)
use fmin_fmax_functions
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    t_1 = atan(((eh / ew) / tan(t)))
    code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
	return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t):
	t_1 = math.atan(((eh / ew) / math.tan(t)))
	return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(eh / ew) / tan(t)))
	return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1))))
end
function tmp = code(eh, ew, t)
	t_1 = atan(((eh / ew) / tan(t)));
	tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}

Alternative 1: 99.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -\cos t\\ t_2 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \left|\left(ew \cdot \sin t\right) \cdot \cos t\_2 + \left(eh \cdot \frac{t\_1 \cdot \cos t}{t\_1}\right) \cdot \sin t\_2\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (- (cos t))) (t_2 (atan (/ (/ eh ew) (tan t)))))
   (fabs
    (+
     (* (* ew (sin t)) (cos t_2))
     (* (* eh (/ (* t_1 (cos t)) t_1)) (sin t_2))))))
double code(double eh, double ew, double t) {
	double t_1 = -cos(t);
	double t_2 = atan(((eh / ew) / tan(t)));
	return fabs((((ew * sin(t)) * cos(t_2)) + ((eh * ((t_1 * cos(t)) / t_1)) * sin(t_2))));
}
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(eh, ew, t)
use fmin_fmax_functions
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    t_1 = -cos(t)
    t_2 = atan(((eh / ew) / tan(t)))
    code = abs((((ew * sin(t)) * cos(t_2)) + ((eh * ((t_1 * cos(t)) / t_1)) * sin(t_2))))
end function
public static double code(double eh, double ew, double t) {
	double t_1 = -Math.cos(t);
	double t_2 = Math.atan(((eh / ew) / Math.tan(t)));
	return Math.abs((((ew * Math.sin(t)) * Math.cos(t_2)) + ((eh * ((t_1 * Math.cos(t)) / t_1)) * Math.sin(t_2))));
}
def code(eh, ew, t):
	t_1 = -math.cos(t)
	t_2 = math.atan(((eh / ew) / math.tan(t)))
	return math.fabs((((ew * math.sin(t)) * math.cos(t_2)) + ((eh * ((t_1 * math.cos(t)) / t_1)) * math.sin(t_2))))
function code(eh, ew, t)
	t_1 = Float64(-cos(t))
	t_2 = atan(Float64(Float64(eh / ew) / tan(t)))
	return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_2)) + Float64(Float64(eh * Float64(Float64(t_1 * cos(t)) / t_1)) * sin(t_2))))
end
function tmp = code(eh, ew, t)
	t_1 = -cos(t);
	t_2 = atan(((eh / ew) / tan(t)));
	tmp = abs((((ew * sin(t)) * cos(t_2)) + ((eh * ((t_1 * cos(t)) / t_1)) * sin(t_2))));
end
code[eh_, ew_, t_] := Block[{t$95$1 = (-N[Cos[t], $MachinePrecision])}, Block[{t$95$2 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[(N[(t$95$1 * N[Cos[t], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -\cos t\\
t_2 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_2 + \left(eh \cdot \frac{t\_1 \cdot \cos t}{t\_1}\right) \cdot \sin t\_2\right|
\end{array}
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-cos.f64N/A

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \color{blue}{\cos t}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. sin-+PI/2-revN/A

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \color{blue}{\sin \left(t + \frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    3. sin-sumN/A

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \color{blue}{\left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right) + \cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. flip-+N/A

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \color{blue}{\frac{\left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) - \left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)}{\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right) - \cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    5. lower-/.f64N/A

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \color{blue}{\frac{\left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) - \left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)}{\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right) - \cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  4. Applied rewrites99.8%

    \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \color{blue}{\frac{\left(0 \cdot \sin t\right) \cdot \left(0 \cdot \sin t\right) - \left(1 \cdot \cos t\right) \cdot \left(1 \cdot \cos t\right)}{0 \cdot \sin t - 1 \cdot \cos t}}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  5. Final simplification99.8%

    \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \frac{\left(-\cos t\right) \cdot \cos t}{-\cos t}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  6. Add Preprocessing

Alternative 2: 50.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := eh \cdot \cos t\\ t_2 := ew \cdot \sin t\\ t_3 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ t_4 := t\_2 \cdot \cos t\_3 + t\_1 \cdot \sin t\_3\\ \mathbf{if}\;t\_4 \leq -5 \cdot 10^{+254}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, {ew}^{-1}\right) \cdot \frac{eh + 0.16666666666666666 \cdot \left(eh \cdot \left(t \cdot t\right)\right)}{t}\right) \cdot eh\right|\\ \mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-287}:\\ \;\;\;\;\left(-\sin t\right) \cdot ew\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \sin \tan^{-1} \left(\frac{t\_1}{t\_2}\right)\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* eh (cos t)))
        (t_2 (* ew (sin t)))
        (t_3 (atan (/ (/ eh ew) (tan t))))
        (t_4 (+ (* t_2 (cos t_3)) (* t_1 (sin t_3)))))
   (if (<= t_4 -5e+254)
     (fabs
      (*
       (sin
        (atan
         (*
          (fma
           (* t t)
           (- (* 0.041666666666666664 (/ (* t t) ew)) (/ 0.5 ew))
           (pow ew -1.0))
          (/ (+ eh (* 0.16666666666666666 (* eh (* t t)))) t))))
       eh))
     (if (<= t_4 -5e-287)
       (* (- (sin t)) ew)
       (* t_1 (sin (atan (/ t_1 t_2))))))))
double code(double eh, double ew, double t) {
	double t_1 = eh * cos(t);
	double t_2 = ew * sin(t);
	double t_3 = atan(((eh / ew) / tan(t)));
	double t_4 = (t_2 * cos(t_3)) + (t_1 * sin(t_3));
	double tmp;
	if (t_4 <= -5e+254) {
		tmp = fabs((sin(atan((fma((t * t), ((0.041666666666666664 * ((t * t) / ew)) - (0.5 / ew)), pow(ew, -1.0)) * ((eh + (0.16666666666666666 * (eh * (t * t)))) / t)))) * eh));
	} else if (t_4 <= -5e-287) {
		tmp = -sin(t) * ew;
	} else {
		tmp = t_1 * sin(atan((t_1 / t_2)));
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(eh * cos(t))
	t_2 = Float64(ew * sin(t))
	t_3 = atan(Float64(Float64(eh / ew) / tan(t)))
	t_4 = Float64(Float64(t_2 * cos(t_3)) + Float64(t_1 * sin(t_3)))
	tmp = 0.0
	if (t_4 <= -5e+254)
		tmp = abs(Float64(sin(atan(Float64(fma(Float64(t * t), Float64(Float64(0.041666666666666664 * Float64(Float64(t * t) / ew)) - Float64(0.5 / ew)), (ew ^ -1.0)) * Float64(Float64(eh + Float64(0.16666666666666666 * Float64(eh * Float64(t * t)))) / t)))) * eh));
	elseif (t_4 <= -5e-287)
		tmp = Float64(Float64(-sin(t)) * ew);
	else
		tmp = Float64(t_1 * sin(atan(Float64(t_1 / t_2))));
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$2 * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -5e+254], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(t * t), $MachinePrecision] * N[(N[(0.041666666666666664 * N[(N[(t * t), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] - N[(0.5 / ew), $MachinePrecision]), $MachinePrecision] + N[Power[ew, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(eh + N[(0.16666666666666666 * N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, -5e-287], N[((-N[Sin[t], $MachinePrecision]) * ew), $MachinePrecision], N[(t$95$1 * N[Sin[N[ArcTan[N[(t$95$1 / t$95$2), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := eh \cdot \cos t\\
t_2 := ew \cdot \sin t\\
t_3 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
t_4 := t\_2 \cdot \cos t\_3 + t\_1 \cdot \sin t\_3\\
\mathbf{if}\;t\_4 \leq -5 \cdot 10^{+254}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, {ew}^{-1}\right) \cdot \frac{eh + 0.16666666666666666 \cdot \left(eh \cdot \left(t \cdot t\right)\right)}{t}\right) \cdot eh\right|\\

\mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-287}:\\
\;\;\;\;\left(-\sin t\right) \cdot ew\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \tan^{-1} \left(\frac{t\_1}{t\_2}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < -4.99999999999999994e254

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \left|\color{blue}{eh \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
      2. lower-*.f64N/A

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
      3. lower-sin.f64N/A

        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
      4. lower-atan.f64N/A

        \[\leadsto \left|\sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
      5. *-commutativeN/A

        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
      6. times-fracN/A

        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
      7. lower-*.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
      8. lower-/.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
      9. lower-cos.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
      10. lower-/.f64N/A

        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \color{blue}{\frac{eh}{\sin t}}\right) \cdot eh\right| \]
      11. lower-sin.f6446.1

        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\color{blue}{\sin t}}\right) \cdot eh\right| \]
    5. Applied rewrites46.1%

      \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh}\right| \]
    6. Taylor expanded in t around 0

      \[\leadsto \left|\sin \tan^{-1} \left(\left({t}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{t}^{2}}{ew} - \frac{1}{2} \cdot \frac{1}{ew}\right) + \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
    7. Step-by-step derivation
      1. Applied rewrites46.2%

        \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
      2. Taylor expanded in t around 0

        \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, \frac{1}{24} \cdot \frac{t \cdot t}{ew} - \frac{\frac{1}{2}}{ew}, \frac{1}{ew}\right) \cdot \frac{eh + \frac{1}{6} \cdot \left(eh \cdot {t}^{2}\right)}{t}\right) \cdot eh\right| \]
      3. Step-by-step derivation
        1. Applied rewrites46.2%

          \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, \frac{1}{ew}\right) \cdot \frac{eh + 0.16666666666666666 \cdot \left(eh \cdot \left(t \cdot t\right)\right)}{t}\right) \cdot eh\right| \]

        if -4.99999999999999994e254 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < -5.00000000000000025e-287

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
        2. Add Preprocessing
        3. Applied rewrites1.3%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
        4. Taylor expanded in eh around 0

          \[\leadsto \color{blue}{ew \cdot \sin t} \]
        5. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \color{blue}{ew \cdot \sin t} \]
          2. lower-sin.f642.0

            \[\leadsto ew \cdot \color{blue}{\sin t} \]
        6. Applied rewrites2.0%

          \[\leadsto \color{blue}{ew \cdot \sin t} \]
        7. Step-by-step derivation
          1. Applied rewrites20.2%

            \[\leadsto ew \cdot \sin \left(\sqrt{-t} \cdot \sqrt{-t}\right) \]
          2. Step-by-step derivation
            1. Applied rewrites46.6%

              \[\leadsto \left(-\sin t\right) \cdot \color{blue}{ew} \]

            if -5.00000000000000025e-287 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))

            1. Initial program 99.8%

              \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            2. Add Preprocessing
            3. Taylor expanded in t around 0

              \[\leadsto \left|\color{blue}{eh \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
              2. lower-*.f64N/A

                \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
              3. lower-sin.f64N/A

                \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
              4. lower-atan.f64N/A

                \[\leadsto \left|\sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
              5. *-commutativeN/A

                \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
              6. times-fracN/A

                \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
              7. lower-*.f64N/A

                \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
              8. lower-/.f64N/A

                \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
              9. lower-cos.f64N/A

                \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
              10. lower-/.f64N/A

                \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \color{blue}{\frac{eh}{\sin t}}\right) \cdot eh\right| \]
              11. lower-sin.f6437.6

                \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\color{blue}{\sin t}}\right) \cdot eh\right| \]
            5. Applied rewrites37.6%

              \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh}\right| \]
            6. Step-by-step derivation
              1. lift-fabs.f64N/A

                \[\leadsto \color{blue}{\left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right|} \]
              2. rem-sqrt-square-revN/A

                \[\leadsto \color{blue}{\sqrt{\left(\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right) \cdot \left(\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right)}} \]
              3. sqrt-prodN/A

                \[\leadsto \color{blue}{\sqrt{\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh} \cdot \sqrt{\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh}} \]
              4. pow2N/A

                \[\leadsto \color{blue}{{\left(\sqrt{\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh}\right)}^{2}} \]
            7. Applied rewrites35.2%

              \[\leadsto \color{blue}{{\left(\sqrt{\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot eh}\right)}^{2}} \]
            8. Taylor expanded in eh around inf

              \[\leadsto \color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)} \]
            9. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto \color{blue}{\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \]
              2. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \]
              3. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(eh \cdot \cos t\right)} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \]
              4. lower-cos.f64N/A

                \[\leadsto \left(eh \cdot \color{blue}{\cos t}\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \]
              5. lower-sin.f64N/A

                \[\leadsto \left(eh \cdot \cos t\right) \cdot \color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \]
              6. lower-atan.f64N/A

                \[\leadsto \left(eh \cdot \cos t\right) \cdot \sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \]
              7. lower-/.f64N/A

                \[\leadsto \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \]
              8. lower-*.f64N/A

                \[\leadsto \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{eh \cdot \cos t}}{ew \cdot \sin t}\right) \]
              9. lower-cos.f64N/A

                \[\leadsto \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \color{blue}{\cos t}}{ew \cdot \sin t}\right) \]
              10. lower-*.f64N/A

                \[\leadsto \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{\color{blue}{ew \cdot \sin t}}\right) \]
              11. lower-sin.f6458.2

                \[\leadsto \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \color{blue}{\sin t}}\right) \]
            10. Applied rewrites58.2%

              \[\leadsto \color{blue}{\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \]
          3. Recombined 3 regimes into one program.
          4. Final simplification52.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \leq -5 \cdot 10^{+254}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, {ew}^{-1}\right) \cdot \frac{eh + 0.16666666666666666 \cdot \left(eh \cdot \left(t \cdot t\right)\right)}{t}\right) \cdot eh\right|\\ \mathbf{elif}\;\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \leq -5 \cdot 10^{-287}:\\ \;\;\;\;\left(-\sin t\right) \cdot ew\\ \mathbf{else}:\\ \;\;\;\;\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 3: 41.9% accurate, 0.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \sin t\\ t_2 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \mathbf{if}\;t\_1 \cdot \cos t\_2 + \left(eh \cdot \cos t\right) \cdot \sin t\_2 \leq -2 \cdot 10^{-216}:\\ \;\;\;\;\left(-\sin t\right) \cdot ew\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (eh ew t)
           :precision binary64
           (let* ((t_1 (* ew (sin t))) (t_2 (atan (/ (/ eh ew) (tan t)))))
             (if (<= (+ (* t_1 (cos t_2)) (* (* eh (cos t)) (sin t_2))) -2e-216)
               (* (- (sin t)) ew)
               t_1)))
          double code(double eh, double ew, double t) {
          	double t_1 = ew * sin(t);
          	double t_2 = atan(((eh / ew) / tan(t)));
          	double tmp;
          	if (((t_1 * cos(t_2)) + ((eh * cos(t)) * sin(t_2))) <= -2e-216) {
          		tmp = -sin(t) * ew;
          	} else {
          		tmp = t_1;
          	}
          	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(eh, ew, t)
          use fmin_fmax_functions
              real(8), intent (in) :: eh
              real(8), intent (in) :: ew
              real(8), intent (in) :: t
              real(8) :: t_1
              real(8) :: t_2
              real(8) :: tmp
              t_1 = ew * sin(t)
              t_2 = atan(((eh / ew) / tan(t)))
              if (((t_1 * cos(t_2)) + ((eh * cos(t)) * sin(t_2))) <= (-2d-216)) then
                  tmp = -sin(t) * ew
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double eh, double ew, double t) {
          	double t_1 = ew * Math.sin(t);
          	double t_2 = Math.atan(((eh / ew) / Math.tan(t)));
          	double tmp;
          	if (((t_1 * Math.cos(t_2)) + ((eh * Math.cos(t)) * Math.sin(t_2))) <= -2e-216) {
          		tmp = -Math.sin(t) * ew;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(eh, ew, t):
          	t_1 = ew * math.sin(t)
          	t_2 = math.atan(((eh / ew) / math.tan(t)))
          	tmp = 0
          	if ((t_1 * math.cos(t_2)) + ((eh * math.cos(t)) * math.sin(t_2))) <= -2e-216:
          		tmp = -math.sin(t) * ew
          	else:
          		tmp = t_1
          	return tmp
          
          function code(eh, ew, t)
          	t_1 = Float64(ew * sin(t))
          	t_2 = atan(Float64(Float64(eh / ew) / tan(t)))
          	tmp = 0.0
          	if (Float64(Float64(t_1 * cos(t_2)) + Float64(Float64(eh * cos(t)) * sin(t_2))) <= -2e-216)
          		tmp = Float64(Float64(-sin(t)) * ew);
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(eh, ew, t)
          	t_1 = ew * sin(t);
          	t_2 = atan(((eh / ew) / tan(t)));
          	tmp = 0.0;
          	if (((t_1 * cos(t_2)) + ((eh * cos(t)) * sin(t_2))) <= -2e-216)
          		tmp = -sin(t) * ew;
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-216], N[((-N[Sin[t], $MachinePrecision]) * ew), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := ew \cdot \sin t\\
          t_2 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
          \mathbf{if}\;t\_1 \cdot \cos t\_2 + \left(eh \cdot \cos t\right) \cdot \sin t\_2 \leq -2 \cdot 10^{-216}:\\
          \;\;\;\;\left(-\sin t\right) \cdot ew\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < -2.0000000000000001e-216

            1. Initial program 99.8%

              \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            2. Add Preprocessing
            3. Applied rewrites1.0%

              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
            4. Taylor expanded in eh around 0

              \[\leadsto \color{blue}{ew \cdot \sin t} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \color{blue}{ew \cdot \sin t} \]
              2. lower-sin.f641.7

                \[\leadsto ew \cdot \color{blue}{\sin t} \]
            6. Applied rewrites1.7%

              \[\leadsto \color{blue}{ew \cdot \sin t} \]
            7. Step-by-step derivation
              1. Applied rewrites18.9%

                \[\leadsto ew \cdot \sin \left(\sqrt{-t} \cdot \sqrt{-t}\right) \]
              2. Step-by-step derivation
                1. Applied rewrites42.9%

                  \[\leadsto \left(-\sin t\right) \cdot \color{blue}{ew} \]

                if -2.0000000000000001e-216 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))

                1. Initial program 99.8%

                  \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                2. Add Preprocessing
                3. Applied rewrites66.1%

                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                4. Taylor expanded in eh around 0

                  \[\leadsto \color{blue}{ew \cdot \sin t} \]
                5. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \color{blue}{ew \cdot \sin t} \]
                  2. lower-sin.f6444.3

                    \[\leadsto ew \cdot \color{blue}{\sin t} \]
                6. Applied rewrites44.3%

                  \[\leadsto \color{blue}{ew \cdot \sin t} \]
              3. Recombined 2 regimes into one program.
              4. Add Preprocessing

              Alternative 4: 32.2% accurate, 0.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \sin t\\ t_2 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \mathbf{if}\;t\_1 \cdot \cos t\_2 + \left(eh \cdot \cos t\right) \cdot \sin t\_2 \leq -2 \cdot 10^{-216}:\\ \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (eh ew t)
               :precision binary64
               (let* ((t_1 (* ew (sin t))) (t_2 (atan (/ (/ eh ew) (tan t)))))
                 (if (<= (+ (* t_1 (cos t_2)) (* (* eh (cos t)) (sin t_2))) -2e-216)
                   (* ew (sin (fabs t)))
                   t_1)))
              double code(double eh, double ew, double t) {
              	double t_1 = ew * sin(t);
              	double t_2 = atan(((eh / ew) / tan(t)));
              	double tmp;
              	if (((t_1 * cos(t_2)) + ((eh * cos(t)) * sin(t_2))) <= -2e-216) {
              		tmp = ew * sin(fabs(t));
              	} else {
              		tmp = t_1;
              	}
              	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(eh, ew, t)
              use fmin_fmax_functions
                  real(8), intent (in) :: eh
                  real(8), intent (in) :: ew
                  real(8), intent (in) :: t
                  real(8) :: t_1
                  real(8) :: t_2
                  real(8) :: tmp
                  t_1 = ew * sin(t)
                  t_2 = atan(((eh / ew) / tan(t)))
                  if (((t_1 * cos(t_2)) + ((eh * cos(t)) * sin(t_2))) <= (-2d-216)) then
                      tmp = ew * sin(abs(t))
                  else
                      tmp = t_1
                  end if
                  code = tmp
              end function
              
              public static double code(double eh, double ew, double t) {
              	double t_1 = ew * Math.sin(t);
              	double t_2 = Math.atan(((eh / ew) / Math.tan(t)));
              	double tmp;
              	if (((t_1 * Math.cos(t_2)) + ((eh * Math.cos(t)) * Math.sin(t_2))) <= -2e-216) {
              		tmp = ew * Math.sin(Math.abs(t));
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              def code(eh, ew, t):
              	t_1 = ew * math.sin(t)
              	t_2 = math.atan(((eh / ew) / math.tan(t)))
              	tmp = 0
              	if ((t_1 * math.cos(t_2)) + ((eh * math.cos(t)) * math.sin(t_2))) <= -2e-216:
              		tmp = ew * math.sin(math.fabs(t))
              	else:
              		tmp = t_1
              	return tmp
              
              function code(eh, ew, t)
              	t_1 = Float64(ew * sin(t))
              	t_2 = atan(Float64(Float64(eh / ew) / tan(t)))
              	tmp = 0.0
              	if (Float64(Float64(t_1 * cos(t_2)) + Float64(Float64(eh * cos(t)) * sin(t_2))) <= -2e-216)
              		tmp = Float64(ew * sin(abs(t)));
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              function tmp_2 = code(eh, ew, t)
              	t_1 = ew * sin(t);
              	t_2 = atan(((eh / ew) / tan(t)));
              	tmp = 0.0;
              	if (((t_1 * cos(t_2)) + ((eh * cos(t)) * sin(t_2))) <= -2e-216)
              		tmp = ew * sin(abs(t));
              	else
              		tmp = t_1;
              	end
              	tmp_2 = tmp;
              end
              
              code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-216], N[(ew * N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := ew \cdot \sin t\\
              t_2 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
              \mathbf{if}\;t\_1 \cdot \cos t\_2 + \left(eh \cdot \cos t\right) \cdot \sin t\_2 \leq -2 \cdot 10^{-216}:\\
              \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < -2.0000000000000001e-216

                1. Initial program 99.8%

                  \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                2. Add Preprocessing
                3. Applied rewrites1.0%

                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                4. Taylor expanded in eh around 0

                  \[\leadsto \color{blue}{ew \cdot \sin t} \]
                5. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \color{blue}{ew \cdot \sin t} \]
                  2. lower-sin.f641.7

                    \[\leadsto ew \cdot \color{blue}{\sin t} \]
                6. Applied rewrites1.7%

                  \[\leadsto \color{blue}{ew \cdot \sin t} \]
                7. Step-by-step derivation
                  1. Applied rewrites21.4%

                    \[\leadsto ew \cdot \sin \left(\left|t\right|\right) \]

                  if -2.0000000000000001e-216 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))

                  1. Initial program 99.8%

                    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                  2. Add Preprocessing
                  3. Applied rewrites66.1%

                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                  4. Taylor expanded in eh around 0

                    \[\leadsto \color{blue}{ew \cdot \sin t} \]
                  5. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto \color{blue}{ew \cdot \sin t} \]
                    2. lower-sin.f6444.3

                      \[\leadsto ew \cdot \color{blue}{\sin t} \]
                  6. Applied rewrites44.3%

                    \[\leadsto \color{blue}{ew \cdot \sin t} \]
                8. Recombined 2 regimes into one program.
                9. Add Preprocessing

                Alternative 5: 27.2% accurate, 0.9× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \sin t\\ t_2 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \mathbf{if}\;t\_1 \cdot \cos t\_2 + \left(eh \cdot \cos t\right) \cdot \sin t\_2 \leq -5 \cdot 10^{-211}:\\ \;\;\;\;\left|ew\right| \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                (FPCore (eh ew t)
                 :precision binary64
                 (let* ((t_1 (* ew (sin t))) (t_2 (atan (/ (/ eh ew) (tan t)))))
                   (if (<= (+ (* t_1 (cos t_2)) (* (* eh (cos t)) (sin t_2))) -5e-211)
                     (* (fabs ew) t)
                     t_1)))
                double code(double eh, double ew, double t) {
                	double t_1 = ew * sin(t);
                	double t_2 = atan(((eh / ew) / tan(t)));
                	double tmp;
                	if (((t_1 * cos(t_2)) + ((eh * cos(t)) * sin(t_2))) <= -5e-211) {
                		tmp = fabs(ew) * t;
                	} else {
                		tmp = t_1;
                	}
                	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(eh, ew, t)
                use fmin_fmax_functions
                    real(8), intent (in) :: eh
                    real(8), intent (in) :: ew
                    real(8), intent (in) :: t
                    real(8) :: t_1
                    real(8) :: t_2
                    real(8) :: tmp
                    t_1 = ew * sin(t)
                    t_2 = atan(((eh / ew) / tan(t)))
                    if (((t_1 * cos(t_2)) + ((eh * cos(t)) * sin(t_2))) <= (-5d-211)) then
                        tmp = abs(ew) * t
                    else
                        tmp = t_1
                    end if
                    code = tmp
                end function
                
                public static double code(double eh, double ew, double t) {
                	double t_1 = ew * Math.sin(t);
                	double t_2 = Math.atan(((eh / ew) / Math.tan(t)));
                	double tmp;
                	if (((t_1 * Math.cos(t_2)) + ((eh * Math.cos(t)) * Math.sin(t_2))) <= -5e-211) {
                		tmp = Math.abs(ew) * t;
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                def code(eh, ew, t):
                	t_1 = ew * math.sin(t)
                	t_2 = math.atan(((eh / ew) / math.tan(t)))
                	tmp = 0
                	if ((t_1 * math.cos(t_2)) + ((eh * math.cos(t)) * math.sin(t_2))) <= -5e-211:
                		tmp = math.fabs(ew) * t
                	else:
                		tmp = t_1
                	return tmp
                
                function code(eh, ew, t)
                	t_1 = Float64(ew * sin(t))
                	t_2 = atan(Float64(Float64(eh / ew) / tan(t)))
                	tmp = 0.0
                	if (Float64(Float64(t_1 * cos(t_2)) + Float64(Float64(eh * cos(t)) * sin(t_2))) <= -5e-211)
                		tmp = Float64(abs(ew) * t);
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                function tmp_2 = code(eh, ew, t)
                	t_1 = ew * sin(t);
                	t_2 = atan(((eh / ew) / tan(t)));
                	tmp = 0.0;
                	if (((t_1 * cos(t_2)) + ((eh * cos(t)) * sin(t_2))) <= -5e-211)
                		tmp = abs(ew) * t;
                	else
                		tmp = t_1;
                	end
                	tmp_2 = tmp;
                end
                
                code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-211], N[(N[Abs[ew], $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := ew \cdot \sin t\\
                t_2 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
                \mathbf{if}\;t\_1 \cdot \cos t\_2 + \left(eh \cdot \cos t\right) \cdot \sin t\_2 \leq -5 \cdot 10^{-211}:\\
                \;\;\;\;\left|ew\right| \cdot t\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < -5.0000000000000002e-211

                  1. Initial program 99.8%

                    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                  2. Add Preprocessing
                  3. Applied rewrites1.0%

                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                  4. Taylor expanded in eh around 0

                    \[\leadsto \color{blue}{ew \cdot \sin t} \]
                  5. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto \color{blue}{ew \cdot \sin t} \]
                    2. lower-sin.f641.7

                      \[\leadsto ew \cdot \color{blue}{\sin t} \]
                  6. Applied rewrites1.7%

                    \[\leadsto \color{blue}{ew \cdot \sin t} \]
                  7. Taylor expanded in t around 0

                    \[\leadsto ew \cdot \color{blue}{t} \]
                  8. Step-by-step derivation
                    1. Applied rewrites2.4%

                      \[\leadsto ew \cdot \color{blue}{t} \]
                    2. Step-by-step derivation
                      1. Applied rewrites8.2%

                        \[\leadsto \left|ew\right| \cdot t \]

                      if -5.0000000000000002e-211 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))

                      1. Initial program 99.8%

                        \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                      2. Add Preprocessing
                      3. Applied rewrites65.6%

                        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                      4. Taylor expanded in eh around 0

                        \[\leadsto \color{blue}{ew \cdot \sin t} \]
                      5. Step-by-step derivation
                        1. lower-*.f64N/A

                          \[\leadsto \color{blue}{ew \cdot \sin t} \]
                        2. lower-sin.f6444.0

                          \[\leadsto ew \cdot \color{blue}{\sin t} \]
                      6. Applied rewrites44.0%

                        \[\leadsto \color{blue}{ew \cdot \sin t} \]
                    3. Recombined 2 regimes into one program.
                    4. Add Preprocessing

                    Alternative 6: 99.8% accurate, 1.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
                    (FPCore (eh ew t)
                     :precision binary64
                     (let* ((t_1 (atan (/ (/ eh ew) (tan t)))))
                       (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
                    double code(double eh, double ew, double t) {
                    	double t_1 = atan(((eh / ew) / tan(t)));
                    	return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
                    }
                    
                    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(eh, ew, t)
                    use fmin_fmax_functions
                        real(8), intent (in) :: eh
                        real(8), intent (in) :: ew
                        real(8), intent (in) :: t
                        real(8) :: t_1
                        t_1 = atan(((eh / ew) / tan(t)))
                        code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
                    end function
                    
                    public static double code(double eh, double ew, double t) {
                    	double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
                    	return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
                    }
                    
                    def code(eh, ew, t):
                    	t_1 = math.atan(((eh / ew) / math.tan(t)))
                    	return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
                    
                    function code(eh, ew, t)
                    	t_1 = atan(Float64(Float64(eh / ew) / tan(t)))
                    	return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1))))
                    end
                    
                    function tmp = code(eh, ew, t)
                    	t_1 = atan(((eh / ew) / tan(t)));
                    	tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
                    end
                    
                    code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
                    \left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Initial program 99.8%

                      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                    2. Add Preprocessing
                    3. Add Preprocessing

                    Alternative 7: 99.1% accurate, 1.1× speedup?

                    \[\begin{array}{l} \\ \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \end{array} \]
                    (FPCore (eh ew t)
                     :precision binary64
                     (fabs
                      (+
                       (* (* ew (sin t)) (cos (atan (/ (/ eh ew) t))))
                       (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
                    double code(double eh, double ew, double t) {
                    	return fabs((((ew * sin(t)) * cos(atan(((eh / ew) / t)))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))));
                    }
                    
                    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(eh, ew, t)
                    use fmin_fmax_functions
                        real(8), intent (in) :: eh
                        real(8), intent (in) :: ew
                        real(8), intent (in) :: t
                        code = abs((((ew * sin(t)) * cos(atan(((eh / ew) / t)))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))))
                    end function
                    
                    public static double code(double eh, double ew, double t) {
                    	return Math.abs((((ew * Math.sin(t)) * Math.cos(Math.atan(((eh / ew) / t)))) + ((eh * Math.cos(t)) * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))))));
                    }
                    
                    def code(eh, ew, t):
                    	return math.fabs((((ew * math.sin(t)) * math.cos(math.atan(((eh / ew) / t)))) + ((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t)))))))
                    
                    function code(eh, ew, t)
                    	return abs(Float64(Float64(Float64(ew * sin(t)) * cos(atan(Float64(Float64(eh / ew) / t)))) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t)))))))
                    end
                    
                    function tmp = code(eh, ew, t)
                    	tmp = abs((((ew * sin(t)) * cos(atan(((eh / ew) / t)))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))));
                    end
                    
                    code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
                    \end{array}
                    
                    Derivation
                    1. Initial program 99.8%

                      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                    2. Add Preprocessing
                    3. Taylor expanded in t around 0

                      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                    4. Step-by-step derivation
                      1. associate-/r*N/A

                        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{\frac{eh}{ew}}{t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                      2. lower-/.f64N/A

                        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{\frac{eh}{ew}}{t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                      3. lower-/.f6499.3

                        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{\frac{eh}{ew}}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                    5. Applied rewrites99.3%

                      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{\frac{eh}{ew}}{t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                    6. Add Preprocessing

                    Alternative 8: 88.8% accurate, 1.3× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\frac{eh}{\tan t}}{ew}\\ \mathbf{if}\;eh \leq -4.3 \cdot 10^{+23} \lor \neg \left(eh \leq 3.8 \cdot 10^{+57}\right):\\ \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\cos t \cdot t\_1, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} t\_1}\right|\\ \end{array} \end{array} \]
                    (FPCore (eh ew t)
                     :precision binary64
                     (let* ((t_1 (/ (/ eh (tan t)) ew)))
                       (if (or (<= eh -4.3e+23) (not (<= eh 3.8e+57)))
                         (fabs (* eh (* (cos t) (sin (atan (/ (* eh (cos t)) (* ew (sin t))))))))
                         (fabs (/ (fma (* (cos t) t_1) eh (* (sin t) ew)) (cosh (asinh t_1)))))))
                    double code(double eh, double ew, double t) {
                    	double t_1 = (eh / tan(t)) / ew;
                    	double tmp;
                    	if ((eh <= -4.3e+23) || !(eh <= 3.8e+57)) {
                    		tmp = fabs((eh * (cos(t) * sin(atan(((eh * cos(t)) / (ew * sin(t))))))));
                    	} else {
                    		tmp = fabs((fma((cos(t) * t_1), eh, (sin(t) * ew)) / cosh(asinh(t_1))));
                    	}
                    	return tmp;
                    }
                    
                    function code(eh, ew, t)
                    	t_1 = Float64(Float64(eh / tan(t)) / ew)
                    	tmp = 0.0
                    	if ((eh <= -4.3e+23) || !(eh <= 3.8e+57))
                    		tmp = abs(Float64(eh * Float64(cos(t) * sin(atan(Float64(Float64(eh * cos(t)) / Float64(ew * sin(t))))))));
                    	else
                    		tmp = abs(Float64(fma(Float64(cos(t) * t_1), eh, Float64(sin(t) * ew)) / cosh(asinh(t_1))));
                    	end
                    	return tmp
                    end
                    
                    code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]}, If[Or[LessEqual[eh, -4.3e+23], N[Not[LessEqual[eh, 3.8e+57]], $MachinePrecision]], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(N[Cos[t], $MachinePrecision] * t$95$1), $MachinePrecision] * eh + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \frac{\frac{eh}{\tan t}}{ew}\\
                    \mathbf{if}\;eh \leq -4.3 \cdot 10^{+23} \lor \neg \left(eh \leq 3.8 \cdot 10^{+57}\right):\\
                    \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)\right|\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left|\frac{\mathsf{fma}\left(\cos t \cdot t\_1, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} t\_1}\right|\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if eh < -4.2999999999999999e23 or 3.7999999999999999e57 < eh

                      1. Initial program 99.8%

                        \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                      2. Add Preprocessing
                      3. Taylor expanded in t around 0

                        \[\leadsto \left|\color{blue}{eh \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                        2. lower-*.f64N/A

                          \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                        3. lower-sin.f64N/A

                          \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                        4. lower-atan.f64N/A

                          \[\leadsto \left|\sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                        5. *-commutativeN/A

                          \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
                        6. times-fracN/A

                          \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                        7. lower-*.f64N/A

                          \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                        8. lower-/.f64N/A

                          \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                        9. lower-cos.f64N/A

                          \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                        10. lower-/.f64N/A

                          \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \color{blue}{\frac{eh}{\sin t}}\right) \cdot eh\right| \]
                        11. lower-sin.f6452.0

                          \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\color{blue}{\sin t}}\right) \cdot eh\right| \]
                      5. Applied rewrites52.0%

                        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh}\right| \]
                      6. Taylor expanded in t around 0

                        \[\leadsto \left|\sin \tan^{-1} \left(\left({t}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{t}^{2}}{ew} - \frac{1}{2} \cdot \frac{1}{ew}\right) + \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                      7. Step-by-step derivation
                        1. Applied rewrites52.1%

                          \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                        2. Taylor expanded in eh around inf

                          \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]
                        3. Step-by-step derivation
                          1. lower-*.f64N/A

                            \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]
                          2. lower-*.f64N/A

                            \[\leadsto \left|eh \cdot \color{blue}{\left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]
                          3. lower-cos.f64N/A

                            \[\leadsto \left|eh \cdot \left(\color{blue}{\cos t} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)\right| \]
                          4. lower-sin.f64N/A

                            \[\leadsto \left|eh \cdot \left(\cos t \cdot \color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right)\right| \]
                          5. lower-atan.f64N/A

                            \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right)\right| \]
                          6. lower-/.f64N/A

                            \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right)\right| \]
                          7. lower-*.f64N/A

                            \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\color{blue}{eh \cdot \cos t}}{ew \cdot \sin t}\right)\right)\right| \]
                          8. lower-cos.f64N/A

                            \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \color{blue}{\cos t}}{ew \cdot \sin t}\right)\right)\right| \]
                          9. lower-*.f64N/A

                            \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{\color{blue}{ew \cdot \sin t}}\right)\right)\right| \]
                          10. lower-sin.f6485.1

                            \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \color{blue}{\sin t}}\right)\right)\right| \]
                        4. Applied rewrites85.1%

                          \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]

                        if -4.2999999999999999e23 < eh < 3.7999999999999999e57

                        1. Initial program 99.9%

                          \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                        2. Add Preprocessing
                        3. Applied rewrites92.1%

                          \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}\right|} \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification89.0%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -4.3 \cdot 10^{+23} \lor \neg \left(eh \leq 3.8 \cdot 10^{+57}\right):\\ \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}\right|\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 9: 71.6% accurate, 1.6× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := eh \cdot \cos t\\ \mathbf{if}\;eh \leq -2.3 \cdot 10^{-219} \lor \neg \left(eh \leq 1.2 \cdot 10^{-10}\right):\\ \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{t\_1}{ew \cdot \sin t}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(ew \cdot \cos \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\sin t}\right)\right) \cdot \sin t\right|\\ \end{array} \end{array} \]
                      (FPCore (eh ew t)
                       :precision binary64
                       (let* ((t_1 (* eh (cos t))))
                         (if (or (<= eh -2.3e-219) (not (<= eh 1.2e-10)))
                           (fabs (* eh (* (cos t) (sin (atan (/ t_1 (* ew (sin t))))))))
                           (fabs (* (* ew (cos (atan (/ (/ t_1 ew) (sin t))))) (sin t))))))
                      double code(double eh, double ew, double t) {
                      	double t_1 = eh * cos(t);
                      	double tmp;
                      	if ((eh <= -2.3e-219) || !(eh <= 1.2e-10)) {
                      		tmp = fabs((eh * (cos(t) * sin(atan((t_1 / (ew * sin(t))))))));
                      	} else {
                      		tmp = fabs(((ew * cos(atan(((t_1 / ew) / sin(t))))) * sin(t)));
                      	}
                      	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(eh, ew, t)
                      use fmin_fmax_functions
                          real(8), intent (in) :: eh
                          real(8), intent (in) :: ew
                          real(8), intent (in) :: t
                          real(8) :: t_1
                          real(8) :: tmp
                          t_1 = eh * cos(t)
                          if ((eh <= (-2.3d-219)) .or. (.not. (eh <= 1.2d-10))) then
                              tmp = abs((eh * (cos(t) * sin(atan((t_1 / (ew * sin(t))))))))
                          else
                              tmp = abs(((ew * cos(atan(((t_1 / ew) / sin(t))))) * sin(t)))
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double eh, double ew, double t) {
                      	double t_1 = eh * Math.cos(t);
                      	double tmp;
                      	if ((eh <= -2.3e-219) || !(eh <= 1.2e-10)) {
                      		tmp = Math.abs((eh * (Math.cos(t) * Math.sin(Math.atan((t_1 / (ew * Math.sin(t))))))));
                      	} else {
                      		tmp = Math.abs(((ew * Math.cos(Math.atan(((t_1 / ew) / Math.sin(t))))) * Math.sin(t)));
                      	}
                      	return tmp;
                      }
                      
                      def code(eh, ew, t):
                      	t_1 = eh * math.cos(t)
                      	tmp = 0
                      	if (eh <= -2.3e-219) or not (eh <= 1.2e-10):
                      		tmp = math.fabs((eh * (math.cos(t) * math.sin(math.atan((t_1 / (ew * math.sin(t))))))))
                      	else:
                      		tmp = math.fabs(((ew * math.cos(math.atan(((t_1 / ew) / math.sin(t))))) * math.sin(t)))
                      	return tmp
                      
                      function code(eh, ew, t)
                      	t_1 = Float64(eh * cos(t))
                      	tmp = 0.0
                      	if ((eh <= -2.3e-219) || !(eh <= 1.2e-10))
                      		tmp = abs(Float64(eh * Float64(cos(t) * sin(atan(Float64(t_1 / Float64(ew * sin(t))))))));
                      	else
                      		tmp = abs(Float64(Float64(ew * cos(atan(Float64(Float64(t_1 / ew) / sin(t))))) * sin(t)));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(eh, ew, t)
                      	t_1 = eh * cos(t);
                      	tmp = 0.0;
                      	if ((eh <= -2.3e-219) || ~((eh <= 1.2e-10)))
                      		tmp = abs((eh * (cos(t) * sin(atan((t_1 / (ew * sin(t))))))));
                      	else
                      		tmp = abs(((ew * cos(atan(((t_1 / ew) / sin(t))))) * sin(t)));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[eh, -2.3e-219], N[Not[LessEqual[eh, 1.2e-10]], $MachinePrecision]], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(t$95$1 / N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Cos[N[ArcTan[N[(N[(t$95$1 / ew), $MachinePrecision] / N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := eh \cdot \cos t\\
                      \mathbf{if}\;eh \leq -2.3 \cdot 10^{-219} \lor \neg \left(eh \leq 1.2 \cdot 10^{-10}\right):\\
                      \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{t\_1}{ew \cdot \sin t}\right)\right)\right|\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\left|\left(ew \cdot \cos \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\sin t}\right)\right) \cdot \sin t\right|\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if eh < -2.29999999999999988e-219 or 1.2e-10 < eh

                        1. Initial program 99.8%

                          \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                        2. Add Preprocessing
                        3. Taylor expanded in t around 0

                          \[\leadsto \left|\color{blue}{eh \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                          2. lower-*.f64N/A

                            \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                          3. lower-sin.f64N/A

                            \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                          4. lower-atan.f64N/A

                            \[\leadsto \left|\sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                          5. *-commutativeN/A

                            \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
                          6. times-fracN/A

                            \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                          7. lower-*.f64N/A

                            \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                          8. lower-/.f64N/A

                            \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                          9. lower-cos.f64N/A

                            \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                          10. lower-/.f64N/A

                            \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \color{blue}{\frac{eh}{\sin t}}\right) \cdot eh\right| \]
                          11. lower-sin.f6448.3

                            \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\color{blue}{\sin t}}\right) \cdot eh\right| \]
                        5. Applied rewrites48.3%

                          \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh}\right| \]
                        6. Taylor expanded in t around 0

                          \[\leadsto \left|\sin \tan^{-1} \left(\left({t}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{t}^{2}}{ew} - \frac{1}{2} \cdot \frac{1}{ew}\right) + \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                        7. Step-by-step derivation
                          1. Applied rewrites48.5%

                            \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                          2. Taylor expanded in eh around inf

                            \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]
                          3. Step-by-step derivation
                            1. lower-*.f64N/A

                              \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]
                            2. lower-*.f64N/A

                              \[\leadsto \left|eh \cdot \color{blue}{\left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]
                            3. lower-cos.f64N/A

                              \[\leadsto \left|eh \cdot \left(\color{blue}{\cos t} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)\right| \]
                            4. lower-sin.f64N/A

                              \[\leadsto \left|eh \cdot \left(\cos t \cdot \color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right)\right| \]
                            5. lower-atan.f64N/A

                              \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right)\right| \]
                            6. lower-/.f64N/A

                              \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right)\right| \]
                            7. lower-*.f64N/A

                              \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\color{blue}{eh \cdot \cos t}}{ew \cdot \sin t}\right)\right)\right| \]
                            8. lower-cos.f64N/A

                              \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \color{blue}{\cos t}}{ew \cdot \sin t}\right)\right)\right| \]
                            9. lower-*.f64N/A

                              \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{\color{blue}{ew \cdot \sin t}}\right)\right)\right| \]
                            10. lower-sin.f6477.5

                              \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \color{blue}{\sin t}}\right)\right)\right| \]
                          4. Applied rewrites77.5%

                            \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]

                          if -2.29999999999999988e-219 < eh < 1.2e-10

                          1. Initial program 99.8%

                            \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                          2. Add Preprocessing
                          3. Step-by-step derivation
                            1. lift-cos.f64N/A

                              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \color{blue}{\cos t}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                            2. sin-+PI/2-revN/A

                              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \color{blue}{\sin \left(t + \frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                            3. sin-sumN/A

                              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \color{blue}{\left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right) + \cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                            4. flip-+N/A

                              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \color{blue}{\frac{\left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) - \left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)}{\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right) - \cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                            5. lower-/.f64N/A

                              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \color{blue}{\frac{\left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) - \left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)}{\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right) - \cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                          4. Applied rewrites99.8%

                            \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \color{blue}{\frac{\left(0 \cdot \sin t\right) \cdot \left(0 \cdot \sin t\right) - \left(1 \cdot \cos t\right) \cdot \left(1 \cdot \cos t\right)}{0 \cdot \sin t - 1 \cdot \cos t}}\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                          5. Taylor expanded in eh around 0

                            \[\leadsto \left|\color{blue}{ew \cdot \left(\cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \sin t\right)}\right| \]
                          6. Step-by-step derivation
                            1. associate-*r*N/A

                              \[\leadsto \left|\color{blue}{\left(ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right) \cdot \sin t}\right| \]
                            2. lower-*.f64N/A

                              \[\leadsto \left|\color{blue}{\left(ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right) \cdot \sin t}\right| \]
                            3. lower-*.f64N/A

                              \[\leadsto \left|\color{blue}{\left(ew \cdot \cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)} \cdot \sin t\right| \]
                            4. lower-cos.f64N/A

                              \[\leadsto \left|\left(ew \cdot \color{blue}{\cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right) \cdot \sin t\right| \]
                            5. lower-atan.f64N/A

                              \[\leadsto \left|\left(ew \cdot \cos \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right) \cdot \sin t\right| \]
                            6. associate-/r*N/A

                              \[\leadsto \left|\left(ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{\frac{eh \cdot \cos t}{ew}}{\sin t}\right)}\right) \cdot \sin t\right| \]
                            7. lower-/.f64N/A

                              \[\leadsto \left|\left(ew \cdot \cos \tan^{-1} \color{blue}{\left(\frac{\frac{eh \cdot \cos t}{ew}}{\sin t}\right)}\right) \cdot \sin t\right| \]
                            8. lower-/.f64N/A

                              \[\leadsto \left|\left(ew \cdot \cos \tan^{-1} \left(\frac{\color{blue}{\frac{eh \cdot \cos t}{ew}}}{\sin t}\right)\right) \cdot \sin t\right| \]
                            9. lower-*.f64N/A

                              \[\leadsto \left|\left(ew \cdot \cos \tan^{-1} \left(\frac{\frac{\color{blue}{eh \cdot \cos t}}{ew}}{\sin t}\right)\right) \cdot \sin t\right| \]
                            10. lower-cos.f64N/A

                              \[\leadsto \left|\left(ew \cdot \cos \tan^{-1} \left(\frac{\frac{eh \cdot \color{blue}{\cos t}}{ew}}{\sin t}\right)\right) \cdot \sin t\right| \]
                            11. lower-sin.f64N/A

                              \[\leadsto \left|\left(ew \cdot \cos \tan^{-1} \left(\frac{\frac{eh \cdot \cos t}{ew}}{\color{blue}{\sin t}}\right)\right) \cdot \sin t\right| \]
                            12. lower-sin.f6478.7

                              \[\leadsto \left|\left(ew \cdot \cos \tan^{-1} \left(\frac{\frac{eh \cdot \cos t}{ew}}{\sin t}\right)\right) \cdot \color{blue}{\sin t}\right| \]
                          7. Applied rewrites78.7%

                            \[\leadsto \left|\color{blue}{\left(ew \cdot \cos \tan^{-1} \left(\frac{\frac{eh \cdot \cos t}{ew}}{\sin t}\right)\right) \cdot \sin t}\right| \]
                        8. Recombined 2 regimes into one program.
                        9. Final simplification77.9%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -2.3 \cdot 10^{-219} \lor \neg \left(eh \leq 1.2 \cdot 10^{-10}\right):\\ \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(ew \cdot \cos \tan^{-1} \left(\frac{\frac{eh \cdot \cos t}{ew}}{\sin t}\right)\right) \cdot \sin t\right|\\ \end{array} \]
                        10. Add Preprocessing

                        Alternative 10: 71.6% accurate, 1.6× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq -2.3 \cdot 10^{-219} \lor \neg \left(eh \leq 1.2 \cdot 10^{-10}\right):\\ \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot \left(\sin t \cdot ew\right)\right|\\ \end{array} \end{array} \]
                        (FPCore (eh ew t)
                         :precision binary64
                         (if (or (<= eh -2.3e-219) (not (<= eh 1.2e-10)))
                           (fabs (* eh (* (cos t) (sin (atan (/ (* eh (cos t)) (* ew (sin t))))))))
                           (fabs (* (cos (atan (* (/ (cos t) ew) (/ eh (sin t))))) (* (sin t) ew)))))
                        double code(double eh, double ew, double t) {
                        	double tmp;
                        	if ((eh <= -2.3e-219) || !(eh <= 1.2e-10)) {
                        		tmp = fabs((eh * (cos(t) * sin(atan(((eh * cos(t)) / (ew * sin(t))))))));
                        	} else {
                        		tmp = fabs((cos(atan(((cos(t) / ew) * (eh / sin(t))))) * (sin(t) * ew)));
                        	}
                        	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(eh, ew, t)
                        use fmin_fmax_functions
                            real(8), intent (in) :: eh
                            real(8), intent (in) :: ew
                            real(8), intent (in) :: t
                            real(8) :: tmp
                            if ((eh <= (-2.3d-219)) .or. (.not. (eh <= 1.2d-10))) then
                                tmp = abs((eh * (cos(t) * sin(atan(((eh * cos(t)) / (ew * sin(t))))))))
                            else
                                tmp = abs((cos(atan(((cos(t) / ew) * (eh / sin(t))))) * (sin(t) * ew)))
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double eh, double ew, double t) {
                        	double tmp;
                        	if ((eh <= -2.3e-219) || !(eh <= 1.2e-10)) {
                        		tmp = Math.abs((eh * (Math.cos(t) * Math.sin(Math.atan(((eh * Math.cos(t)) / (ew * Math.sin(t))))))));
                        	} else {
                        		tmp = Math.abs((Math.cos(Math.atan(((Math.cos(t) / ew) * (eh / Math.sin(t))))) * (Math.sin(t) * ew)));
                        	}
                        	return tmp;
                        }
                        
                        def code(eh, ew, t):
                        	tmp = 0
                        	if (eh <= -2.3e-219) or not (eh <= 1.2e-10):
                        		tmp = math.fabs((eh * (math.cos(t) * math.sin(math.atan(((eh * math.cos(t)) / (ew * math.sin(t))))))))
                        	else:
                        		tmp = math.fabs((math.cos(math.atan(((math.cos(t) / ew) * (eh / math.sin(t))))) * (math.sin(t) * ew)))
                        	return tmp
                        
                        function code(eh, ew, t)
                        	tmp = 0.0
                        	if ((eh <= -2.3e-219) || !(eh <= 1.2e-10))
                        		tmp = abs(Float64(eh * Float64(cos(t) * sin(atan(Float64(Float64(eh * cos(t)) / Float64(ew * sin(t))))))));
                        	else
                        		tmp = abs(Float64(cos(atan(Float64(Float64(cos(t) / ew) * Float64(eh / sin(t))))) * Float64(sin(t) * ew)));
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(eh, ew, t)
                        	tmp = 0.0;
                        	if ((eh <= -2.3e-219) || ~((eh <= 1.2e-10)))
                        		tmp = abs((eh * (cos(t) * sin(atan(((eh * cos(t)) / (ew * sin(t))))))));
                        	else
                        		tmp = abs((cos(atan(((cos(t) / ew) * (eh / sin(t))))) * (sin(t) * ew)));
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[eh_, ew_, t_] := If[Or[LessEqual[eh, -2.3e-219], N[Not[LessEqual[eh, 1.2e-10]], $MachinePrecision]], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Cos[N[ArcTan[N[(N[(N[Cos[t], $MachinePrecision] / ew), $MachinePrecision] * N[(eh / N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;eh \leq -2.3 \cdot 10^{-219} \lor \neg \left(eh \leq 1.2 \cdot 10^{-10}\right):\\
                        \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)\right|\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot \left(\sin t \cdot ew\right)\right|\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if eh < -2.29999999999999988e-219 or 1.2e-10 < eh

                          1. Initial program 99.8%

                            \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                          2. Add Preprocessing
                          3. Taylor expanded in t around 0

                            \[\leadsto \left|\color{blue}{eh \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
                          4. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                            2. lower-*.f64N/A

                              \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                            3. lower-sin.f64N/A

                              \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                            4. lower-atan.f64N/A

                              \[\leadsto \left|\sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                            5. *-commutativeN/A

                              \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
                            6. times-fracN/A

                              \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                            7. lower-*.f64N/A

                              \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                            8. lower-/.f64N/A

                              \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                            9. lower-cos.f64N/A

                              \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                            10. lower-/.f64N/A

                              \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \color{blue}{\frac{eh}{\sin t}}\right) \cdot eh\right| \]
                            11. lower-sin.f6448.3

                              \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\color{blue}{\sin t}}\right) \cdot eh\right| \]
                          5. Applied rewrites48.3%

                            \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh}\right| \]
                          6. Taylor expanded in t around 0

                            \[\leadsto \left|\sin \tan^{-1} \left(\left({t}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{t}^{2}}{ew} - \frac{1}{2} \cdot \frac{1}{ew}\right) + \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                          7. Step-by-step derivation
                            1. Applied rewrites48.5%

                              \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                            2. Taylor expanded in eh around inf

                              \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]
                            3. Step-by-step derivation
                              1. lower-*.f64N/A

                                \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]
                              2. lower-*.f64N/A

                                \[\leadsto \left|eh \cdot \color{blue}{\left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]
                              3. lower-cos.f64N/A

                                \[\leadsto \left|eh \cdot \left(\color{blue}{\cos t} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)\right| \]
                              4. lower-sin.f64N/A

                                \[\leadsto \left|eh \cdot \left(\cos t \cdot \color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right)\right| \]
                              5. lower-atan.f64N/A

                                \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right)\right| \]
                              6. lower-/.f64N/A

                                \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right)\right| \]
                              7. lower-*.f64N/A

                                \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\color{blue}{eh \cdot \cos t}}{ew \cdot \sin t}\right)\right)\right| \]
                              8. lower-cos.f64N/A

                                \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \color{blue}{\cos t}}{ew \cdot \sin t}\right)\right)\right| \]
                              9. lower-*.f64N/A

                                \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{\color{blue}{ew \cdot \sin t}}\right)\right)\right| \]
                              10. lower-sin.f6477.5

                                \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \color{blue}{\sin t}}\right)\right)\right| \]
                            4. Applied rewrites77.5%

                              \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]

                            if -2.29999999999999988e-219 < eh < 1.2e-10

                            1. Initial program 99.8%

                              \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                            2. Add Preprocessing
                            3. Taylor expanded in eh around 0

                              \[\leadsto \left|\color{blue}{ew \cdot \left(\cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \sin t\right)}\right| \]
                            4. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \left|\color{blue}{\left(\cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \sin t\right) \cdot ew}\right| \]
                              2. associate-*l*N/A

                                \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \left(\sin t \cdot ew\right)}\right| \]
                              3. *-commutativeN/A

                                \[\leadsto \left|\cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \color{blue}{\left(ew \cdot \sin t\right)}\right| \]
                              4. lower-*.f64N/A

                                \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \left(ew \cdot \sin t\right)}\right| \]
                              5. lower-cos.f64N/A

                                \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot \left(ew \cdot \sin t\right)\right| \]
                              6. lower-atan.f64N/A

                                \[\leadsto \left|\cos \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot \left(ew \cdot \sin t\right)\right| \]
                              7. *-commutativeN/A

                                \[\leadsto \left|\cos \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot \left(ew \cdot \sin t\right)\right| \]
                              8. times-fracN/A

                                \[\leadsto \left|\cos \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot \left(ew \cdot \sin t\right)\right| \]
                              9. lower-*.f64N/A

                                \[\leadsto \left|\cos \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot \left(ew \cdot \sin t\right)\right| \]
                              10. lower-/.f64N/A

                                \[\leadsto \left|\cos \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot \left(ew \cdot \sin t\right)\right| \]
                              11. lower-cos.f64N/A

                                \[\leadsto \left|\cos \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot \left(ew \cdot \sin t\right)\right| \]
                              12. lower-/.f64N/A

                                \[\leadsto \left|\cos \tan^{-1} \left(\frac{\cos t}{ew} \cdot \color{blue}{\frac{eh}{\sin t}}\right) \cdot \left(ew \cdot \sin t\right)\right| \]
                              13. lower-sin.f64N/A

                                \[\leadsto \left|\cos \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\color{blue}{\sin t}}\right) \cdot \left(ew \cdot \sin t\right)\right| \]
                              14. *-commutativeN/A

                                \[\leadsto \left|\cos \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot \color{blue}{\left(\sin t \cdot ew\right)}\right| \]
                              15. lower-*.f64N/A

                                \[\leadsto \left|\cos \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot \color{blue}{\left(\sin t \cdot ew\right)}\right| \]
                              16. lower-sin.f6478.7

                                \[\leadsto \left|\cos \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot \left(\color{blue}{\sin t} \cdot ew\right)\right| \]
                            5. Applied rewrites78.7%

                              \[\leadsto \left|\color{blue}{\cos \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot \left(\sin t \cdot ew\right)}\right| \]
                          8. Recombined 2 regimes into one program.
                          9. Final simplification77.9%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -2.3 \cdot 10^{-219} \lor \neg \left(eh \leq 1.2 \cdot 10^{-10}\right):\\ \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot \left(\sin t \cdot ew\right)\right|\\ \end{array} \]
                          10. Add Preprocessing

                          Alternative 11: 66.1% accurate, 1.6× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \sin t\\ \mathbf{if}\;ew \leq -2.2 \cdot 10^{+140}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq 3.1 \cdot 10^{+163}:\\ \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{t\_1}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\ \end{array} \end{array} \]
                          (FPCore (eh ew t)
                           :precision binary64
                           (let* ((t_1 (* ew (sin t))))
                             (if (<= ew -2.2e+140)
                               t_1
                               (if (<= ew 3.1e+163)
                                 (fabs (* eh (* (cos t) (sin (atan (/ (* eh (cos t)) t_1))))))
                                 (* ew (sin (fabs t)))))))
                          double code(double eh, double ew, double t) {
                          	double t_1 = ew * sin(t);
                          	double tmp;
                          	if (ew <= -2.2e+140) {
                          		tmp = t_1;
                          	} else if (ew <= 3.1e+163) {
                          		tmp = fabs((eh * (cos(t) * sin(atan(((eh * cos(t)) / t_1))))));
                          	} else {
                          		tmp = ew * sin(fabs(t));
                          	}
                          	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(eh, ew, t)
                          use fmin_fmax_functions
                              real(8), intent (in) :: eh
                              real(8), intent (in) :: ew
                              real(8), intent (in) :: t
                              real(8) :: t_1
                              real(8) :: tmp
                              t_1 = ew * sin(t)
                              if (ew <= (-2.2d+140)) then
                                  tmp = t_1
                              else if (ew <= 3.1d+163) then
                                  tmp = abs((eh * (cos(t) * sin(atan(((eh * cos(t)) / t_1))))))
                              else
                                  tmp = ew * sin(abs(t))
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double eh, double ew, double t) {
                          	double t_1 = ew * Math.sin(t);
                          	double tmp;
                          	if (ew <= -2.2e+140) {
                          		tmp = t_1;
                          	} else if (ew <= 3.1e+163) {
                          		tmp = Math.abs((eh * (Math.cos(t) * Math.sin(Math.atan(((eh * Math.cos(t)) / t_1))))));
                          	} else {
                          		tmp = ew * Math.sin(Math.abs(t));
                          	}
                          	return tmp;
                          }
                          
                          def code(eh, ew, t):
                          	t_1 = ew * math.sin(t)
                          	tmp = 0
                          	if ew <= -2.2e+140:
                          		tmp = t_1
                          	elif ew <= 3.1e+163:
                          		tmp = math.fabs((eh * (math.cos(t) * math.sin(math.atan(((eh * math.cos(t)) / t_1))))))
                          	else:
                          		tmp = ew * math.sin(math.fabs(t))
                          	return tmp
                          
                          function code(eh, ew, t)
                          	t_1 = Float64(ew * sin(t))
                          	tmp = 0.0
                          	if (ew <= -2.2e+140)
                          		tmp = t_1;
                          	elseif (ew <= 3.1e+163)
                          		tmp = abs(Float64(eh * Float64(cos(t) * sin(atan(Float64(Float64(eh * cos(t)) / t_1))))));
                          	else
                          		tmp = Float64(ew * sin(abs(t)));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(eh, ew, t)
                          	t_1 = ew * sin(t);
                          	tmp = 0.0;
                          	if (ew <= -2.2e+140)
                          		tmp = t_1;
                          	elseif (ew <= 3.1e+163)
                          		tmp = abs((eh * (cos(t) * sin(atan(((eh * cos(t)) / t_1))))));
                          	else
                          		tmp = ew * sin(abs(t));
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[ew, -2.2e+140], t$95$1, If[LessEqual[ew, 3.1e+163], N[Abs[N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(ew * N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_1 := ew \cdot \sin t\\
                          \mathbf{if}\;ew \leq -2.2 \cdot 10^{+140}:\\
                          \;\;\;\;t\_1\\
                          
                          \mathbf{elif}\;ew \leq 3.1 \cdot 10^{+163}:\\
                          \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{t\_1}\right)\right)\right|\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if ew < -2.1999999999999998e140

                            1. Initial program 99.9%

                              \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                            2. Add Preprocessing
                            3. Applied rewrites55.3%

                              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                            4. Taylor expanded in eh around 0

                              \[\leadsto \color{blue}{ew \cdot \sin t} \]
                            5. Step-by-step derivation
                              1. lower-*.f64N/A

                                \[\leadsto \color{blue}{ew \cdot \sin t} \]
                              2. lower-sin.f6453.2

                                \[\leadsto ew \cdot \color{blue}{\sin t} \]
                            6. Applied rewrites53.2%

                              \[\leadsto \color{blue}{ew \cdot \sin t} \]

                            if -2.1999999999999998e140 < ew < 3.10000000000000029e163

                            1. Initial program 99.8%

                              \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                            2. Add Preprocessing
                            3. Taylor expanded in t around 0

                              \[\leadsto \left|\color{blue}{eh \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
                            4. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                              2. lower-*.f64N/A

                                \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                              3. lower-sin.f64N/A

                                \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                              4. lower-atan.f64N/A

                                \[\leadsto \left|\sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                              5. *-commutativeN/A

                                \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
                              6. times-fracN/A

                                \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                              7. lower-*.f64N/A

                                \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                              8. lower-/.f64N/A

                                \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                              9. lower-cos.f64N/A

                                \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                              10. lower-/.f64N/A

                                \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \color{blue}{\frac{eh}{\sin t}}\right) \cdot eh\right| \]
                              11. lower-sin.f6444.3

                                \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\color{blue}{\sin t}}\right) \cdot eh\right| \]
                            5. Applied rewrites44.3%

                              \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh}\right| \]
                            6. Taylor expanded in t around 0

                              \[\leadsto \left|\sin \tan^{-1} \left(\left({t}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{t}^{2}}{ew} - \frac{1}{2} \cdot \frac{1}{ew}\right) + \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                            7. Step-by-step derivation
                              1. Applied rewrites44.5%

                                \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                              2. Taylor expanded in eh around inf

                                \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]
                              3. Step-by-step derivation
                                1. lower-*.f64N/A

                                  \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]
                                2. lower-*.f64N/A

                                  \[\leadsto \left|eh \cdot \color{blue}{\left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]
                                3. lower-cos.f64N/A

                                  \[\leadsto \left|eh \cdot \left(\color{blue}{\cos t} \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)\right| \]
                                4. lower-sin.f64N/A

                                  \[\leadsto \left|eh \cdot \left(\cos t \cdot \color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right)\right| \]
                                5. lower-atan.f64N/A

                                  \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right)\right| \]
                                6. lower-/.f64N/A

                                  \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right)\right| \]
                                7. lower-*.f64N/A

                                  \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{\color{blue}{eh \cdot \cos t}}{ew \cdot \sin t}\right)\right)\right| \]
                                8. lower-cos.f64N/A

                                  \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \color{blue}{\cos t}}{ew \cdot \sin t}\right)\right)\right| \]
                                9. lower-*.f64N/A

                                  \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{\color{blue}{ew \cdot \sin t}}\right)\right)\right| \]
                                10. lower-sin.f6472.6

                                  \[\leadsto \left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \color{blue}{\sin t}}\right)\right)\right| \]
                              4. Applied rewrites72.6%

                                \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]

                              if 3.10000000000000029e163 < ew

                              1. Initial program 99.8%

                                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                              2. Add Preprocessing
                              3. Applied rewrites41.3%

                                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                              4. Taylor expanded in eh around 0

                                \[\leadsto \color{blue}{ew \cdot \sin t} \]
                              5. Step-by-step derivation
                                1. lower-*.f64N/A

                                  \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                2. lower-sin.f6436.4

                                  \[\leadsto ew \cdot \color{blue}{\sin t} \]
                              6. Applied rewrites36.4%

                                \[\leadsto \color{blue}{ew \cdot \sin t} \]
                              7. Step-by-step derivation
                                1. Applied rewrites62.9%

                                  \[\leadsto ew \cdot \sin \left(\left|t\right|\right) \]
                              8. Recombined 3 regimes into one program.
                              9. Final simplification68.6%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.2 \cdot 10^{+140}:\\ \;\;\;\;ew \cdot \sin t\\ \mathbf{elif}\;ew \leq 3.1 \cdot 10^{+163}:\\ \;\;\;\;\left|eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\ \end{array} \]
                              10. Add Preprocessing

                              Alternative 12: 48.6% accurate, 1.7× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{+229}:\\ \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\ \mathbf{elif}\;t \leq -4.2 \cdot 10^{-25}:\\ \;\;\;\;ew \cdot \sin t\\ \mathbf{elif}\;t \leq 10^{-12}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, \left(t \cdot t\right) \cdot \mathsf{fma}\left(-0.001388888888888889, \frac{t \cdot t}{ew}, \frac{0.041666666666666664}{ew}\right) - \frac{0.5}{ew}, {ew}^{-1}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left(-\sin t\right) \cdot ew\\ \end{array} \end{array} \]
                              (FPCore (eh ew t)
                               :precision binary64
                               (if (<= t -4.3e+229)
                                 (* ew (sin (fabs t)))
                                 (if (<= t -4.2e-25)
                                   (* ew (sin t))
                                   (if (<= t 1e-12)
                                     (fabs
                                      (*
                                       (sin
                                        (atan
                                         (*
                                          (fma
                                           (* t t)
                                           (-
                                            (*
                                             (* t t)
                                             (fma
                                              -0.001388888888888889
                                              (/ (* t t) ew)
                                              (/ 0.041666666666666664 ew)))
                                            (/ 0.5 ew))
                                           (pow ew -1.0))
                                          (/ eh (sin t)))))
                                       eh))
                                     (* (- (sin t)) ew)))))
                              double code(double eh, double ew, double t) {
                              	double tmp;
                              	if (t <= -4.3e+229) {
                              		tmp = ew * sin(fabs(t));
                              	} else if (t <= -4.2e-25) {
                              		tmp = ew * sin(t);
                              	} else if (t <= 1e-12) {
                              		tmp = fabs((sin(atan((fma((t * t), (((t * t) * fma(-0.001388888888888889, ((t * t) / ew), (0.041666666666666664 / ew))) - (0.5 / ew)), pow(ew, -1.0)) * (eh / sin(t))))) * eh));
                              	} else {
                              		tmp = -sin(t) * ew;
                              	}
                              	return tmp;
                              }
                              
                              function code(eh, ew, t)
                              	tmp = 0.0
                              	if (t <= -4.3e+229)
                              		tmp = Float64(ew * sin(abs(t)));
                              	elseif (t <= -4.2e-25)
                              		tmp = Float64(ew * sin(t));
                              	elseif (t <= 1e-12)
                              		tmp = abs(Float64(sin(atan(Float64(fma(Float64(t * t), Float64(Float64(Float64(t * t) * fma(-0.001388888888888889, Float64(Float64(t * t) / ew), Float64(0.041666666666666664 / ew))) - Float64(0.5 / ew)), (ew ^ -1.0)) * Float64(eh / sin(t))))) * eh));
                              	else
                              		tmp = Float64(Float64(-sin(t)) * ew);
                              	end
                              	return tmp
                              end
                              
                              code[eh_, ew_, t_] := If[LessEqual[t, -4.3e+229], N[(ew * N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.2e-25], N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-12], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(t * t), $MachinePrecision] * N[(N[(N[(t * t), $MachinePrecision] * N[(-0.001388888888888889 * N[(N[(t * t), $MachinePrecision] / ew), $MachinePrecision] + N[(0.041666666666666664 / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.5 / ew), $MachinePrecision]), $MachinePrecision] + N[Power[ew, -1.0], $MachinePrecision]), $MachinePrecision] * N[(eh / N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[((-N[Sin[t], $MachinePrecision]) * ew), $MachinePrecision]]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;t \leq -4.3 \cdot 10^{+229}:\\
                              \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\
                              
                              \mathbf{elif}\;t \leq -4.2 \cdot 10^{-25}:\\
                              \;\;\;\;ew \cdot \sin t\\
                              
                              \mathbf{elif}\;t \leq 10^{-12}:\\
                              \;\;\;\;\left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, \left(t \cdot t\right) \cdot \mathsf{fma}\left(-0.001388888888888889, \frac{t \cdot t}{ew}, \frac{0.041666666666666664}{ew}\right) - \frac{0.5}{ew}, {ew}^{-1}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right|\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\left(-\sin t\right) \cdot ew\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 4 regimes
                              2. if t < -4.29999999999999991e229

                                1. Initial program 99.6%

                                  \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                2. Add Preprocessing
                                3. Applied rewrites24.9%

                                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                                4. Taylor expanded in eh around 0

                                  \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                5. Step-by-step derivation
                                  1. lower-*.f64N/A

                                    \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                  2. lower-sin.f644.8

                                    \[\leadsto ew \cdot \color{blue}{\sin t} \]
                                6. Applied rewrites4.8%

                                  \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites42.9%

                                    \[\leadsto ew \cdot \sin \left(\left|t\right|\right) \]

                                  if -4.29999999999999991e229 < t < -4.20000000000000005e-25

                                  1. Initial program 99.6%

                                    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                  2. Add Preprocessing
                                  3. Applied rewrites57.3%

                                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                                  4. Taylor expanded in eh around 0

                                    \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                  5. Step-by-step derivation
                                    1. lower-*.f64N/A

                                      \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                    2. lower-sin.f6440.3

                                      \[\leadsto ew \cdot \color{blue}{\sin t} \]
                                  6. Applied rewrites40.3%

                                    \[\leadsto \color{blue}{ew \cdot \sin t} \]

                                  if -4.20000000000000005e-25 < t < 9.9999999999999998e-13

                                  1. Initial program 100.0%

                                    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in t around 0

                                    \[\leadsto \left|\color{blue}{eh \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
                                  4. Step-by-step derivation
                                    1. *-commutativeN/A

                                      \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                                    2. lower-*.f64N/A

                                      \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                                    3. lower-sin.f64N/A

                                      \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                                    4. lower-atan.f64N/A

                                      \[\leadsto \left|\sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                                    5. *-commutativeN/A

                                      \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
                                    6. times-fracN/A

                                      \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                                    7. lower-*.f64N/A

                                      \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                                    8. lower-/.f64N/A

                                      \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                                    9. lower-cos.f64N/A

                                      \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                                    10. lower-/.f64N/A

                                      \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \color{blue}{\frac{eh}{\sin t}}\right) \cdot eh\right| \]
                                    11. lower-sin.f6470.6

                                      \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\color{blue}{\sin t}}\right) \cdot eh\right| \]
                                  5. Applied rewrites70.6%

                                    \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh}\right| \]
                                  6. Taylor expanded in t around 0

                                    \[\leadsto \left|\sin \tan^{-1} \left(\left({t}^{2} \cdot \left({t}^{2} \cdot \left(\frac{-1}{720} \cdot \frac{{t}^{2}}{ew} + \frac{1}{24} \cdot \frac{1}{ew}\right) - \frac{1}{2} \cdot \frac{1}{ew}\right) + \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites70.6%

                                      \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, \left(t \cdot t\right) \cdot \mathsf{fma}\left(-0.001388888888888889, \frac{t \cdot t}{ew}, \frac{0.041666666666666664}{ew}\right) - \frac{0.5}{ew}, \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]

                                    if 9.9999999999999998e-13 < t

                                    1. Initial program 99.7%

                                      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                    2. Add Preprocessing
                                    3. Applied rewrites29.3%

                                      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                                    4. Taylor expanded in eh around 0

                                      \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                    5. Step-by-step derivation
                                      1. lower-*.f64N/A

                                        \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                      2. lower-sin.f6423.2

                                        \[\leadsto ew \cdot \color{blue}{\sin t} \]
                                    6. Applied rewrites23.2%

                                      \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites0.0%

                                        \[\leadsto ew \cdot \sin \left(\sqrt{-t} \cdot \sqrt{-t}\right) \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites29.3%

                                          \[\leadsto \left(-\sin t\right) \cdot \color{blue}{ew} \]
                                      3. Recombined 4 regimes into one program.
                                      4. Final simplification50.1%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{+229}:\\ \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\ \mathbf{elif}\;t \leq -4.2 \cdot 10^{-25}:\\ \;\;\;\;ew \cdot \sin t\\ \mathbf{elif}\;t \leq 10^{-12}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, \left(t \cdot t\right) \cdot \mathsf{fma}\left(-0.001388888888888889, \frac{t \cdot t}{ew}, \frac{0.041666666666666664}{ew}\right) - \frac{0.5}{ew}, {ew}^{-1}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left(-\sin t\right) \cdot ew\\ \end{array} \]
                                      5. Add Preprocessing

                                      Alternative 13: 48.6% accurate, 2.1× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{+229}:\\ \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\ \mathbf{elif}\;t \leq -4.2 \cdot 10^{-25}:\\ \;\;\;\;ew \cdot \sin t\\ \mathbf{elif}\;t \leq 10^{-12}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, {ew}^{-1}\right) \cdot \frac{eh}{t \cdot \left(1 + \left(t \cdot t\right) \cdot \left(0.008333333333333333 \cdot \left(t \cdot t\right) - 0.16666666666666666\right)\right)}\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left(-\sin t\right) \cdot ew\\ \end{array} \end{array} \]
                                      (FPCore (eh ew t)
                                       :precision binary64
                                       (if (<= t -4.3e+229)
                                         (* ew (sin (fabs t)))
                                         (if (<= t -4.2e-25)
                                           (* ew (sin t))
                                           (if (<= t 1e-12)
                                             (fabs
                                              (*
                                               (sin
                                                (atan
                                                 (*
                                                  (fma
                                                   (* t t)
                                                   (- (* 0.041666666666666664 (/ (* t t) ew)) (/ 0.5 ew))
                                                   (pow ew -1.0))
                                                  (/
                                                   eh
                                                   (*
                                                    t
                                                    (+
                                                     1.0
                                                     (*
                                                      (* t t)
                                                      (- (* 0.008333333333333333 (* t t)) 0.16666666666666666))))))))
                                               eh))
                                             (* (- (sin t)) ew)))))
                                      double code(double eh, double ew, double t) {
                                      	double tmp;
                                      	if (t <= -4.3e+229) {
                                      		tmp = ew * sin(fabs(t));
                                      	} else if (t <= -4.2e-25) {
                                      		tmp = ew * sin(t);
                                      	} else if (t <= 1e-12) {
                                      		tmp = fabs((sin(atan((fma((t * t), ((0.041666666666666664 * ((t * t) / ew)) - (0.5 / ew)), pow(ew, -1.0)) * (eh / (t * (1.0 + ((t * t) * ((0.008333333333333333 * (t * t)) - 0.16666666666666666)))))))) * eh));
                                      	} else {
                                      		tmp = -sin(t) * ew;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(eh, ew, t)
                                      	tmp = 0.0
                                      	if (t <= -4.3e+229)
                                      		tmp = Float64(ew * sin(abs(t)));
                                      	elseif (t <= -4.2e-25)
                                      		tmp = Float64(ew * sin(t));
                                      	elseif (t <= 1e-12)
                                      		tmp = abs(Float64(sin(atan(Float64(fma(Float64(t * t), Float64(Float64(0.041666666666666664 * Float64(Float64(t * t) / ew)) - Float64(0.5 / ew)), (ew ^ -1.0)) * Float64(eh / Float64(t * Float64(1.0 + Float64(Float64(t * t) * Float64(Float64(0.008333333333333333 * Float64(t * t)) - 0.16666666666666666)))))))) * eh));
                                      	else
                                      		tmp = Float64(Float64(-sin(t)) * ew);
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[eh_, ew_, t_] := If[LessEqual[t, -4.3e+229], N[(ew * N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.2e-25], N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-12], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(t * t), $MachinePrecision] * N[(N[(0.041666666666666664 * N[(N[(t * t), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] - N[(0.5 / ew), $MachinePrecision]), $MachinePrecision] + N[Power[ew, -1.0], $MachinePrecision]), $MachinePrecision] * N[(eh / N[(t * N[(1.0 + N[(N[(t * t), $MachinePrecision] * N[(N[(0.008333333333333333 * N[(t * t), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[((-N[Sin[t], $MachinePrecision]) * ew), $MachinePrecision]]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;t \leq -4.3 \cdot 10^{+229}:\\
                                      \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\
                                      
                                      \mathbf{elif}\;t \leq -4.2 \cdot 10^{-25}:\\
                                      \;\;\;\;ew \cdot \sin t\\
                                      
                                      \mathbf{elif}\;t \leq 10^{-12}:\\
                                      \;\;\;\;\left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, {ew}^{-1}\right) \cdot \frac{eh}{t \cdot \left(1 + \left(t \cdot t\right) \cdot \left(0.008333333333333333 \cdot \left(t \cdot t\right) - 0.16666666666666666\right)\right)}\right) \cdot eh\right|\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\left(-\sin t\right) \cdot ew\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 4 regimes
                                      2. if t < -4.29999999999999991e229

                                        1. Initial program 99.6%

                                          \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                        2. Add Preprocessing
                                        3. Applied rewrites24.9%

                                          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                                        4. Taylor expanded in eh around 0

                                          \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                        5. Step-by-step derivation
                                          1. lower-*.f64N/A

                                            \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                          2. lower-sin.f644.8

                                            \[\leadsto ew \cdot \color{blue}{\sin t} \]
                                        6. Applied rewrites4.8%

                                          \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites42.9%

                                            \[\leadsto ew \cdot \sin \left(\left|t\right|\right) \]

                                          if -4.29999999999999991e229 < t < -4.20000000000000005e-25

                                          1. Initial program 99.6%

                                            \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                          2. Add Preprocessing
                                          3. Applied rewrites57.3%

                                            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                                          4. Taylor expanded in eh around 0

                                            \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                          5. Step-by-step derivation
                                            1. lower-*.f64N/A

                                              \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                            2. lower-sin.f6440.3

                                              \[\leadsto ew \cdot \color{blue}{\sin t} \]
                                          6. Applied rewrites40.3%

                                            \[\leadsto \color{blue}{ew \cdot \sin t} \]

                                          if -4.20000000000000005e-25 < t < 9.9999999999999998e-13

                                          1. Initial program 100.0%

                                            \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                          2. Add Preprocessing
                                          3. Taylor expanded in t around 0

                                            \[\leadsto \left|\color{blue}{eh \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
                                          4. Step-by-step derivation
                                            1. *-commutativeN/A

                                              \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                                            2. lower-*.f64N/A

                                              \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                                            3. lower-sin.f64N/A

                                              \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                                            4. lower-atan.f64N/A

                                              \[\leadsto \left|\sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                                            5. *-commutativeN/A

                                              \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
                                            6. times-fracN/A

                                              \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                                            7. lower-*.f64N/A

                                              \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                                            8. lower-/.f64N/A

                                              \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                                            9. lower-cos.f64N/A

                                              \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                                            10. lower-/.f64N/A

                                              \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \color{blue}{\frac{eh}{\sin t}}\right) \cdot eh\right| \]
                                            11. lower-sin.f6470.6

                                              \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\color{blue}{\sin t}}\right) \cdot eh\right| \]
                                          5. Applied rewrites70.6%

                                            \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh}\right| \]
                                          6. Taylor expanded in t around 0

                                            \[\leadsto \left|\sin \tan^{-1} \left(\left({t}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{t}^{2}}{ew} - \frac{1}{2} \cdot \frac{1}{ew}\right) + \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites70.6%

                                              \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                                            2. Taylor expanded in t around 0

                                              \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, \frac{1}{24} \cdot \frac{t \cdot t}{ew} - \frac{\frac{1}{2}}{ew}, \frac{1}{ew}\right) \cdot \frac{eh}{t \cdot \left(1 + {t}^{2} \cdot \left(\frac{1}{120} \cdot {t}^{2} - \frac{1}{6}\right)\right)}\right) \cdot eh\right| \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites70.6%

                                                \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, \frac{1}{ew}\right) \cdot \frac{eh}{t \cdot \left(1 + \left(t \cdot t\right) \cdot \left(0.008333333333333333 \cdot \left(t \cdot t\right) - 0.16666666666666666\right)\right)}\right) \cdot eh\right| \]

                                              if 9.9999999999999998e-13 < t

                                              1. Initial program 99.7%

                                                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                              2. Add Preprocessing
                                              3. Applied rewrites29.3%

                                                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                                              4. Taylor expanded in eh around 0

                                                \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                              5. Step-by-step derivation
                                                1. lower-*.f64N/A

                                                  \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                2. lower-sin.f6423.2

                                                  \[\leadsto ew \cdot \color{blue}{\sin t} \]
                                              6. Applied rewrites23.2%

                                                \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites0.0%

                                                  \[\leadsto ew \cdot \sin \left(\sqrt{-t} \cdot \sqrt{-t}\right) \]
                                                2. Step-by-step derivation
                                                  1. Applied rewrites29.3%

                                                    \[\leadsto \left(-\sin t\right) \cdot \color{blue}{ew} \]
                                                3. Recombined 4 regimes into one program.
                                                4. Final simplification50.1%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{+229}:\\ \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\ \mathbf{elif}\;t \leq -4.2 \cdot 10^{-25}:\\ \;\;\;\;ew \cdot \sin t\\ \mathbf{elif}\;t \leq 10^{-12}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, {ew}^{-1}\right) \cdot \frac{eh}{t \cdot \left(1 + \left(t \cdot t\right) \cdot \left(0.008333333333333333 \cdot \left(t \cdot t\right) - 0.16666666666666666\right)\right)}\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left(-\sin t\right) \cdot ew\\ \end{array} \]
                                                5. Add Preprocessing

                                                Alternative 14: 48.6% accurate, 2.1× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{+229}:\\ \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\ \mathbf{elif}\;t \leq -4.2 \cdot 10^{-25}:\\ \;\;\;\;ew \cdot \sin t\\ \mathbf{elif}\;t \leq 10^{-12}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, {ew}^{-1}\right) \cdot \frac{eh + 0.16666666666666666 \cdot \left(eh \cdot \left(t \cdot t\right)\right)}{t}\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left(-\sin t\right) \cdot ew\\ \end{array} \end{array} \]
                                                (FPCore (eh ew t)
                                                 :precision binary64
                                                 (if (<= t -4.3e+229)
                                                   (* ew (sin (fabs t)))
                                                   (if (<= t -4.2e-25)
                                                     (* ew (sin t))
                                                     (if (<= t 1e-12)
                                                       (fabs
                                                        (*
                                                         (sin
                                                          (atan
                                                           (*
                                                            (fma
                                                             (* t t)
                                                             (- (* 0.041666666666666664 (/ (* t t) ew)) (/ 0.5 ew))
                                                             (pow ew -1.0))
                                                            (/ (+ eh (* 0.16666666666666666 (* eh (* t t)))) t))))
                                                         eh))
                                                       (* (- (sin t)) ew)))))
                                                double code(double eh, double ew, double t) {
                                                	double tmp;
                                                	if (t <= -4.3e+229) {
                                                		tmp = ew * sin(fabs(t));
                                                	} else if (t <= -4.2e-25) {
                                                		tmp = ew * sin(t);
                                                	} else if (t <= 1e-12) {
                                                		tmp = fabs((sin(atan((fma((t * t), ((0.041666666666666664 * ((t * t) / ew)) - (0.5 / ew)), pow(ew, -1.0)) * ((eh + (0.16666666666666666 * (eh * (t * t)))) / t)))) * eh));
                                                	} else {
                                                		tmp = -sin(t) * ew;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                function code(eh, ew, t)
                                                	tmp = 0.0
                                                	if (t <= -4.3e+229)
                                                		tmp = Float64(ew * sin(abs(t)));
                                                	elseif (t <= -4.2e-25)
                                                		tmp = Float64(ew * sin(t));
                                                	elseif (t <= 1e-12)
                                                		tmp = abs(Float64(sin(atan(Float64(fma(Float64(t * t), Float64(Float64(0.041666666666666664 * Float64(Float64(t * t) / ew)) - Float64(0.5 / ew)), (ew ^ -1.0)) * Float64(Float64(eh + Float64(0.16666666666666666 * Float64(eh * Float64(t * t)))) / t)))) * eh));
                                                	else
                                                		tmp = Float64(Float64(-sin(t)) * ew);
                                                	end
                                                	return tmp
                                                end
                                                
                                                code[eh_, ew_, t_] := If[LessEqual[t, -4.3e+229], N[(ew * N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.2e-25], N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-12], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(t * t), $MachinePrecision] * N[(N[(0.041666666666666664 * N[(N[(t * t), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] - N[(0.5 / ew), $MachinePrecision]), $MachinePrecision] + N[Power[ew, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(eh + N[(0.16666666666666666 * N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[((-N[Sin[t], $MachinePrecision]) * ew), $MachinePrecision]]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                \mathbf{if}\;t \leq -4.3 \cdot 10^{+229}:\\
                                                \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\
                                                
                                                \mathbf{elif}\;t \leq -4.2 \cdot 10^{-25}:\\
                                                \;\;\;\;ew \cdot \sin t\\
                                                
                                                \mathbf{elif}\;t \leq 10^{-12}:\\
                                                \;\;\;\;\left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, {ew}^{-1}\right) \cdot \frac{eh + 0.16666666666666666 \cdot \left(eh \cdot \left(t \cdot t\right)\right)}{t}\right) \cdot eh\right|\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\left(-\sin t\right) \cdot ew\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 4 regimes
                                                2. if t < -4.29999999999999991e229

                                                  1. Initial program 99.6%

                                                    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                                  2. Add Preprocessing
                                                  3. Applied rewrites24.9%

                                                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                                                  4. Taylor expanded in eh around 0

                                                    \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                  5. Step-by-step derivation
                                                    1. lower-*.f64N/A

                                                      \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                    2. lower-sin.f644.8

                                                      \[\leadsto ew \cdot \color{blue}{\sin t} \]
                                                  6. Applied rewrites4.8%

                                                    \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites42.9%

                                                      \[\leadsto ew \cdot \sin \left(\left|t\right|\right) \]

                                                    if -4.29999999999999991e229 < t < -4.20000000000000005e-25

                                                    1. Initial program 99.6%

                                                      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                                    2. Add Preprocessing
                                                    3. Applied rewrites57.3%

                                                      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                                                    4. Taylor expanded in eh around 0

                                                      \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                    5. Step-by-step derivation
                                                      1. lower-*.f64N/A

                                                        \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                      2. lower-sin.f6440.3

                                                        \[\leadsto ew \cdot \color{blue}{\sin t} \]
                                                    6. Applied rewrites40.3%

                                                      \[\leadsto \color{blue}{ew \cdot \sin t} \]

                                                    if -4.20000000000000005e-25 < t < 9.9999999999999998e-13

                                                    1. Initial program 100.0%

                                                      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in t around 0

                                                      \[\leadsto \left|\color{blue}{eh \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)}\right| \]
                                                    4. Step-by-step derivation
                                                      1. *-commutativeN/A

                                                        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                                                      2. lower-*.f64N/A

                                                        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot eh}\right| \]
                                                      3. lower-sin.f64N/A

                                                        \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                                                      4. lower-atan.f64N/A

                                                        \[\leadsto \left|\sin \color{blue}{\tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot eh\right| \]
                                                      5. *-commutativeN/A

                                                        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t \cdot eh}}{ew \cdot \sin t}\right) \cdot eh\right| \]
                                                      6. times-fracN/A

                                                        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                                                      7. lower-*.f64N/A

                                                        \[\leadsto \left|\sin \tan^{-1} \color{blue}{\left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right)} \cdot eh\right| \]
                                                      8. lower-/.f64N/A

                                                        \[\leadsto \left|\sin \tan^{-1} \left(\color{blue}{\frac{\cos t}{ew}} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                                                      9. lower-cos.f64N/A

                                                        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\color{blue}{\cos t}}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                                                      10. lower-/.f64N/A

                                                        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \color{blue}{\frac{eh}{\sin t}}\right) \cdot eh\right| \]
                                                      11. lower-sin.f6470.6

                                                        \[\leadsto \left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\color{blue}{\sin t}}\right) \cdot eh\right| \]
                                                    5. Applied rewrites70.6%

                                                      \[\leadsto \left|\color{blue}{\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot eh}\right| \]
                                                    6. Taylor expanded in t around 0

                                                      \[\leadsto \left|\sin \tan^{-1} \left(\left({t}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{t}^{2}}{ew} - \frac{1}{2} \cdot \frac{1}{ew}\right) + \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites70.6%

                                                        \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, \frac{1}{ew}\right) \cdot \frac{eh}{\sin t}\right) \cdot eh\right| \]
                                                      2. Taylor expanded in t around 0

                                                        \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, \frac{1}{24} \cdot \frac{t \cdot t}{ew} - \frac{\frac{1}{2}}{ew}, \frac{1}{ew}\right) \cdot \frac{eh + \frac{1}{6} \cdot \left(eh \cdot {t}^{2}\right)}{t}\right) \cdot eh\right| \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites70.6%

                                                          \[\leadsto \left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, \frac{1}{ew}\right) \cdot \frac{eh + 0.16666666666666666 \cdot \left(eh \cdot \left(t \cdot t\right)\right)}{t}\right) \cdot eh\right| \]

                                                        if 9.9999999999999998e-13 < t

                                                        1. Initial program 99.7%

                                                          \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                                        2. Add Preprocessing
                                                        3. Applied rewrites29.3%

                                                          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                                                        4. Taylor expanded in eh around 0

                                                          \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                        5. Step-by-step derivation
                                                          1. lower-*.f64N/A

                                                            \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                          2. lower-sin.f6423.2

                                                            \[\leadsto ew \cdot \color{blue}{\sin t} \]
                                                        6. Applied rewrites23.2%

                                                          \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites0.0%

                                                            \[\leadsto ew \cdot \sin \left(\sqrt{-t} \cdot \sqrt{-t}\right) \]
                                                          2. Step-by-step derivation
                                                            1. Applied rewrites29.3%

                                                              \[\leadsto \left(-\sin t\right) \cdot \color{blue}{ew} \]
                                                          3. Recombined 4 regimes into one program.
                                                          4. Final simplification50.1%

                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{+229}:\\ \;\;\;\;ew \cdot \sin \left(\left|t\right|\right)\\ \mathbf{elif}\;t \leq -4.2 \cdot 10^{-25}:\\ \;\;\;\;ew \cdot \sin t\\ \mathbf{elif}\;t \leq 10^{-12}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\mathsf{fma}\left(t \cdot t, 0.041666666666666664 \cdot \frac{t \cdot t}{ew} - \frac{0.5}{ew}, {ew}^{-1}\right) \cdot \frac{eh + 0.16666666666666666 \cdot \left(eh \cdot \left(t \cdot t\right)\right)}{t}\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left(-\sin t\right) \cdot ew\\ \end{array} \]
                                                          5. Add Preprocessing

                                                          Alternative 15: 14.7% accurate, 62.1× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.1 \cdot 10^{-282}:\\ \;\;\;\;ew \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left|ew\right| \cdot t\\ \end{array} \end{array} \]
                                                          (FPCore (eh ew t)
                                                           :precision binary64
                                                           (if (<= t -1.1e-282) (* ew t) (* (fabs ew) t)))
                                                          double code(double eh, double ew, double t) {
                                                          	double tmp;
                                                          	if (t <= -1.1e-282) {
                                                          		tmp = ew * t;
                                                          	} else {
                                                          		tmp = fabs(ew) * t;
                                                          	}
                                                          	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(eh, ew, t)
                                                          use fmin_fmax_functions
                                                              real(8), intent (in) :: eh
                                                              real(8), intent (in) :: ew
                                                              real(8), intent (in) :: t
                                                              real(8) :: tmp
                                                              if (t <= (-1.1d-282)) then
                                                                  tmp = ew * t
                                                              else
                                                                  tmp = abs(ew) * t
                                                              end if
                                                              code = tmp
                                                          end function
                                                          
                                                          public static double code(double eh, double ew, double t) {
                                                          	double tmp;
                                                          	if (t <= -1.1e-282) {
                                                          		tmp = ew * t;
                                                          	} else {
                                                          		tmp = Math.abs(ew) * t;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          def code(eh, ew, t):
                                                          	tmp = 0
                                                          	if t <= -1.1e-282:
                                                          		tmp = ew * t
                                                          	else:
                                                          		tmp = math.fabs(ew) * t
                                                          	return tmp
                                                          
                                                          function code(eh, ew, t)
                                                          	tmp = 0.0
                                                          	if (t <= -1.1e-282)
                                                          		tmp = Float64(ew * t);
                                                          	else
                                                          		tmp = Float64(abs(ew) * t);
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          function tmp_2 = code(eh, ew, t)
                                                          	tmp = 0.0;
                                                          	if (t <= -1.1e-282)
                                                          		tmp = ew * t;
                                                          	else
                                                          		tmp = abs(ew) * t;
                                                          	end
                                                          	tmp_2 = tmp;
                                                          end
                                                          
                                                          code[eh_, ew_, t_] := If[LessEqual[t, -1.1e-282], N[(ew * t), $MachinePrecision], N[(N[Abs[ew], $MachinePrecision] * t), $MachinePrecision]]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          \mathbf{if}\;t \leq -1.1 \cdot 10^{-282}:\\
                                                          \;\;\;\;ew \cdot t\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;\left|ew\right| \cdot t\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 2 regimes
                                                          2. if t < -1.09999999999999991e-282

                                                            1. Initial program 99.8%

                                                              \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                                            2. Add Preprocessing
                                                            3. Applied rewrites44.1%

                                                              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                                                            4. Taylor expanded in eh around 0

                                                              \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                            5. Step-by-step derivation
                                                              1. lower-*.f64N/A

                                                                \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                              2. lower-sin.f6430.3

                                                                \[\leadsto ew \cdot \color{blue}{\sin t} \]
                                                            6. Applied rewrites30.3%

                                                              \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                            7. Taylor expanded in t around 0

                                                              \[\leadsto ew \cdot \color{blue}{t} \]
                                                            8. Step-by-step derivation
                                                              1. Applied rewrites16.3%

                                                                \[\leadsto ew \cdot \color{blue}{t} \]

                                                              if -1.09999999999999991e-282 < t

                                                              1. Initial program 99.8%

                                                                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                                              2. Add Preprocessing
                                                              3. Applied rewrites26.2%

                                                                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                                                              4. Taylor expanded in eh around 0

                                                                \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                              5. Step-by-step derivation
                                                                1. lower-*.f64N/A

                                                                  \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                                2. lower-sin.f6417.9

                                                                  \[\leadsto ew \cdot \color{blue}{\sin t} \]
                                                              6. Applied rewrites17.9%

                                                                \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                              7. Taylor expanded in t around 0

                                                                \[\leadsto ew \cdot \color{blue}{t} \]
                                                              8. Step-by-step derivation
                                                                1. Applied rewrites5.9%

                                                                  \[\leadsto ew \cdot \color{blue}{t} \]
                                                                2. Step-by-step derivation
                                                                  1. Applied rewrites11.9%

                                                                    \[\leadsto \left|ew\right| \cdot t \]
                                                                3. Recombined 2 regimes into one program.
                                                                4. Add Preprocessing

                                                                Alternative 16: 10.3% accurate, 145.0× speedup?

                                                                \[\begin{array}{l} \\ ew \cdot t \end{array} \]
                                                                (FPCore (eh ew t) :precision binary64 (* ew t))
                                                                double code(double eh, double ew, double t) {
                                                                	return ew * t;
                                                                }
                                                                
                                                                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(eh, ew, t)
                                                                use fmin_fmax_functions
                                                                    real(8), intent (in) :: eh
                                                                    real(8), intent (in) :: ew
                                                                    real(8), intent (in) :: t
                                                                    code = ew * t
                                                                end function
                                                                
                                                                public static double code(double eh, double ew, double t) {
                                                                	return ew * t;
                                                                }
                                                                
                                                                def code(eh, ew, t):
                                                                	return ew * t
                                                                
                                                                function code(eh, ew, t)
                                                                	return Float64(ew * t)
                                                                end
                                                                
                                                                function tmp = code(eh, ew, t)
                                                                	tmp = ew * t;
                                                                end
                                                                
                                                                code[eh_, ew_, t_] := N[(ew * t), $MachinePrecision]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                ew \cdot t
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Initial program 99.8%

                                                                  \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                                                2. Add Preprocessing
                                                                3. Applied rewrites34.8%

                                                                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\cos t \cdot \frac{\frac{eh}{\tan t}}{ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}} \]
                                                                4. Taylor expanded in eh around 0

                                                                  \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                                5. Step-by-step derivation
                                                                  1. lower-*.f64N/A

                                                                    \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                                  2. lower-sin.f6423.8

                                                                    \[\leadsto ew \cdot \color{blue}{\sin t} \]
                                                                6. Applied rewrites23.8%

                                                                  \[\leadsto \color{blue}{ew \cdot \sin t} \]
                                                                7. Taylor expanded in t around 0

                                                                  \[\leadsto ew \cdot \color{blue}{t} \]
                                                                8. Step-by-step derivation
                                                                  1. Applied rewrites10.9%

                                                                    \[\leadsto ew \cdot \color{blue}{t} \]
                                                                  2. Add Preprocessing

                                                                  Reproduce

                                                                  ?
                                                                  herbie shell --seed 2024351 
                                                                  (FPCore (eh ew t)
                                                                    :name "Example from Robby"
                                                                    :precision binary64
                                                                    (fabs (+ (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))