Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 15.6s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

Alternative 2: 99.8% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\\ \left|\mathsf{fma}\left(\cos t \cdot ew, \frac{1}{\cosh t\_1}, \left(\tanh t\_1 \cdot eh\right) \cdot \sin t\right)\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (asinh (* (/ (tan t) ew) eh))))
   (fabs
    (fma (* (cos t) ew) (/ 1.0 (cosh t_1)) (* (* (tanh t_1) eh) (sin t))))))
double code(double eh, double ew, double t) {
	double t_1 = asinh(((tan(t) / ew) * eh));
	return fabs(fma((cos(t) * ew), (1.0 / cosh(t_1)), ((tanh(t_1) * eh) * sin(t))));
}
function code(eh, ew, t)
	t_1 = asinh(Float64(Float64(tan(t) / ew) * eh))
	return abs(fma(Float64(cos(t) * ew), Float64(1.0 / cosh(t_1)), Float64(Float64(tanh(t_1) * eh) * sin(t))))
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] * N[(1.0 / N[Cosh[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Tanh[t$95$1], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\\
\left|\mathsf{fma}\left(\cos t \cdot ew, \frac{1}{\cosh t\_1}, \left(\tanh t\_1 \cdot eh\right) \cdot \sin t\right)\right|
\end{array}
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

    \[\leadsto \left|\mathsf{fma}\left(\left(\sin t \cdot eh\right) \cdot \tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right), \color{blue}{\frac{1}{ew} \cdot ew}, \frac{\cos t \cdot ew}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right)\right| \]
  7. Applied rewrites99.8%

    \[\leadsto \left|\mathsf{fma}\left(\cos t \cdot ew, \color{blue}{\frac{1}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}}, \left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot eh\right) \cdot \sin t\right)\right| \]
  8. Add Preprocessing

Alternative 3: 92.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \cos t\\ t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ t_3 := \cos t \cdot ew\\ t_4 := eh \cdot \sin t\\ t_5 := t\_1 \cdot \cos t\_2 - t\_4 \cdot \sin t\_2\\ t_6 := \tan^{-1} \left(\frac{-1 \cdot \left(eh \cdot t\right)}{ew}\right)\\ t_7 := \frac{\tan t}{ew}\\ t_8 := t\_7 \cdot eh\\ t_9 := \sinh^{-1} \left(t\_7 \cdot \left(-eh\right)\right)\\ \mathbf{if}\;t\_5 \leq -1 \cdot 10^{+164}:\\ \;\;\;\;\left|t\_1 \cdot \cos t\_6 - t\_4 \cdot \sin t\_6\right|\\ \mathbf{elif}\;t\_5 \leq -1 \cdot 10^{-279}:\\ \;\;\;\;\frac{\left|\left({t\_8}^{2} - -1\right) \cdot t\_3\right|}{\cosh \sinh^{-1} t\_8}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_3}{\cosh t\_9} - \tanh t\_9 \cdot \left(\sin t \cdot eh\right)\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* ew (cos t)))
        (t_2 (atan (/ (* (- eh) (tan t)) ew)))
        (t_3 (* (cos t) ew))
        (t_4 (* eh (sin t)))
        (t_5 (- (* t_1 (cos t_2)) (* t_4 (sin t_2))))
        (t_6 (atan (/ (* -1.0 (* eh t)) ew)))
        (t_7 (/ (tan t) ew))
        (t_8 (* t_7 eh))
        (t_9 (asinh (* t_7 (- eh)))))
   (if (<= t_5 -1e+164)
     (fabs (- (* t_1 (cos t_6)) (* t_4 (sin t_6))))
     (if (<= t_5 -1e-279)
       (/ (fabs (* (- (pow t_8 2.0) -1.0) t_3)) (cosh (asinh t_8)))
       (- (/ t_3 (cosh t_9)) (* (tanh t_9) (* (sin t) eh)))))))
double code(double eh, double ew, double t) {
	double t_1 = ew * cos(t);
	double t_2 = atan(((-eh * tan(t)) / ew));
	double t_3 = cos(t) * ew;
	double t_4 = eh * sin(t);
	double t_5 = (t_1 * cos(t_2)) - (t_4 * sin(t_2));
	double t_6 = atan(((-1.0 * (eh * t)) / ew));
	double t_7 = tan(t) / ew;
	double t_8 = t_7 * eh;
	double t_9 = asinh((t_7 * -eh));
	double tmp;
	if (t_5 <= -1e+164) {
		tmp = fabs(((t_1 * cos(t_6)) - (t_4 * sin(t_6))));
	} else if (t_5 <= -1e-279) {
		tmp = fabs(((pow(t_8, 2.0) - -1.0) * t_3)) / cosh(asinh(t_8));
	} else {
		tmp = (t_3 / cosh(t_9)) - (tanh(t_9) * (sin(t) * eh));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = ew * math.cos(t)
	t_2 = math.atan(((-eh * math.tan(t)) / ew))
	t_3 = math.cos(t) * ew
	t_4 = eh * math.sin(t)
	t_5 = (t_1 * math.cos(t_2)) - (t_4 * math.sin(t_2))
	t_6 = math.atan(((-1.0 * (eh * t)) / ew))
	t_7 = math.tan(t) / ew
	t_8 = t_7 * eh
	t_9 = math.asinh((t_7 * -eh))
	tmp = 0
	if t_5 <= -1e+164:
		tmp = math.fabs(((t_1 * math.cos(t_6)) - (t_4 * math.sin(t_6))))
	elif t_5 <= -1e-279:
		tmp = math.fabs(((math.pow(t_8, 2.0) - -1.0) * t_3)) / math.cosh(math.asinh(t_8))
	else:
		tmp = (t_3 / math.cosh(t_9)) - (math.tanh(t_9) * (math.sin(t) * eh))
	return tmp
function code(eh, ew, t)
	t_1 = Float64(ew * cos(t))
	t_2 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
	t_3 = Float64(cos(t) * ew)
	t_4 = Float64(eh * sin(t))
	t_5 = Float64(Float64(t_1 * cos(t_2)) - Float64(t_4 * sin(t_2)))
	t_6 = atan(Float64(Float64(-1.0 * Float64(eh * t)) / ew))
	t_7 = Float64(tan(t) / ew)
	t_8 = Float64(t_7 * eh)
	t_9 = asinh(Float64(t_7 * Float64(-eh)))
	tmp = 0.0
	if (t_5 <= -1e+164)
		tmp = abs(Float64(Float64(t_1 * cos(t_6)) - Float64(t_4 * sin(t_6))));
	elseif (t_5 <= -1e-279)
		tmp = Float64(abs(Float64(Float64((t_8 ^ 2.0) - -1.0) * t_3)) / cosh(asinh(t_8)));
	else
		tmp = Float64(Float64(t_3 / cosh(t_9)) - Float64(tanh(t_9) * Float64(sin(t) * eh)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = ew * cos(t);
	t_2 = atan(((-eh * tan(t)) / ew));
	t_3 = cos(t) * ew;
	t_4 = eh * sin(t);
	t_5 = (t_1 * cos(t_2)) - (t_4 * sin(t_2));
	t_6 = atan(((-1.0 * (eh * t)) / ew));
	t_7 = tan(t) / ew;
	t_8 = t_7 * eh;
	t_9 = asinh((t_7 * -eh));
	tmp = 0.0;
	if (t_5 <= -1e+164)
		tmp = abs(((t_1 * cos(t_6)) - (t_4 * sin(t_6))));
	elseif (t_5 <= -1e-279)
		tmp = abs((((t_8 ^ 2.0) - -1.0) * t_3)) / cosh(asinh(t_8));
	else
		tmp = (t_3 / cosh(t_9)) - (tanh(t_9) * (sin(t) * eh));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$4 = N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(t$95$4 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[ArcTan[N[(N[(-1.0 * N[(eh * t), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$7 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$7 * eh), $MachinePrecision]}, Block[{t$95$9 = N[ArcSinh[N[(t$95$7 * (-eh)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$5, -1e+164], N[Abs[N[(N[(t$95$1 * N[Cos[t$95$6], $MachinePrecision]), $MachinePrecision] - N[(t$95$4 * N[Sin[t$95$6], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$5, -1e-279], N[(N[Abs[N[(N[(N[Power[t$95$8, 2.0], $MachinePrecision] - -1.0), $MachinePrecision] * t$95$3), $MachinePrecision]], $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$8], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 / N[Cosh[t$95$9], $MachinePrecision]), $MachinePrecision] - N[(N[Tanh[t$95$9], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
t_3 := \cos t \cdot ew\\
t_4 := eh \cdot \sin t\\
t_5 := t\_1 \cdot \cos t\_2 - t\_4 \cdot \sin t\_2\\
t_6 := \tan^{-1} \left(\frac{-1 \cdot \left(eh \cdot t\right)}{ew}\right)\\
t_7 := \frac{\tan t}{ew}\\
t_8 := t\_7 \cdot eh\\
t_9 := \sinh^{-1} \left(t\_7 \cdot \left(-eh\right)\right)\\
\mathbf{if}\;t\_5 \leq -1 \cdot 10^{+164}:\\
\;\;\;\;\left|t\_1 \cdot \cos t\_6 - t\_4 \cdot \sin t\_6\right|\\

\mathbf{elif}\;t\_5 \leq -1 \cdot 10^{-279}:\\
\;\;\;\;\frac{\left|\left({t\_8}^{2} - -1\right) \cdot t\_3\right|}{\cosh \sinh^{-1} t\_8}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_3}{\cosh t\_9} - \tanh t\_9 \cdot \left(\sin t \cdot eh\right)\\


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    if -1e164 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -1.00000000000000006e-279

    1. Initial program 99.8%

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

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

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

    if -1.00000000000000006e-279 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}} \]
      4. rem-square-sqrt50.5

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

      \[\leadsto \color{blue}{\frac{\cos t \cdot ew}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right)} - \tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \left(\sin t \cdot eh\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 91.8% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ t_2 := t \cdot \frac{eh}{ew}\\ \mathbf{if}\;ew \leq 2.1 \cdot 10^{-204}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{\cos t}{\sqrt{\mathsf{fma}\left(t\_2 \cdot t, \frac{eh}{ew}, 1\right)}}, ew, \left(\tanh \sinh^{-1} t\_2 \cdot t\_1\right) \cdot 1\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot \tan t\right) \cdot t\_1}{ew} + \frac{\cos t}{1}\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* (sin t) eh)) (t_2 (* t (/ eh ew))))
   (if (<= ew 2.1e-204)
     (fabs
      (fma
       (/ (cos t) (sqrt (fma (* t_2 t) (/ eh ew) 1.0)))
       ew
       (* (* (tanh (asinh t_2)) t_1) 1.0)))
     (fabs
      (*
       ew
       (+
        (/ (* (tanh (asinh (* (/ eh ew) (tan t)))) t_1) ew)
        (/ (cos t) 1.0)))))))
double code(double eh, double ew, double t) {
	double t_1 = sin(t) * eh;
	double t_2 = t * (eh / ew);
	double tmp;
	if (ew <= 2.1e-204) {
		tmp = fabs(fma((cos(t) / sqrt(fma((t_2 * t), (eh / ew), 1.0))), ew, ((tanh(asinh(t_2)) * t_1) * 1.0)));
	} else {
		tmp = fabs((ew * (((tanh(asinh(((eh / ew) * tan(t)))) * t_1) / ew) + (cos(t) / 1.0))));
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(sin(t) * eh)
	t_2 = Float64(t * Float64(eh / ew))
	tmp = 0.0
	if (ew <= 2.1e-204)
		tmp = abs(fma(Float64(cos(t) / sqrt(fma(Float64(t_2 * t), Float64(eh / ew), 1.0))), ew, Float64(Float64(tanh(asinh(t_2)) * t_1) * 1.0)));
	else
		tmp = abs(Float64(ew * Float64(Float64(Float64(tanh(asinh(Float64(Float64(eh / ew) * tan(t)))) * t_1) / ew) + Float64(cos(t) / 1.0))));
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[ew, 2.1e-204], N[Abs[N[(N[(N[Cos[t], $MachinePrecision] / N[Sqrt[N[(N[(t$95$2 * t), $MachinePrecision] * N[(eh / ew), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Tanh[N[ArcSinh[t$95$2], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[(N[(N[(N[Tanh[N[ArcSinh[N[(N[(eh / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] / ew), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
t_2 := t \cdot \frac{eh}{ew}\\
\mathbf{if}\;ew \leq 2.1 \cdot 10^{-204}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{\cos t}{\sqrt{\mathsf{fma}\left(t\_2 \cdot t, \frac{eh}{ew}, 1\right)}}, ew, \left(\tanh \sinh^{-1} t\_2 \cdot t\_1\right) \cdot 1\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot \tan t\right) \cdot t\_1}{ew} + \frac{\cos t}{1}\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < 2.10000000000000009e-204

    1. Initial program 99.8%

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot \tan t\right)}\right)\right| \]
    7. Step-by-step derivation
      1. Applied rewrites91.5%

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

        \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
      3. Step-by-step derivation
        1. Applied rewrites82.0%

          \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
        2. Step-by-step derivation
          1. lift-*.f64N/A

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

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

            \[\leadsto \left|ew \cdot \left(\frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)} + \color{blue}{\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew}}\right)\right| \]
          4. distribute-rgt-inN/A

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

          \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\frac{\cos t}{\sqrt{\mathsf{fma}\left(\left(t \cdot \frac{eh}{ew}\right) \cdot t, \frac{eh}{ew}, 1\right)}}, ew, \left(\tanh \sinh^{-1} \left(t \cdot \frac{eh}{ew}\right) \cdot \left(\sin t \cdot eh\right)\right) \cdot 1\right)}\right| \]

        if 2.10000000000000009e-204 < ew

        1. Initial program 99.8%

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

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

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

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

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

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

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

            \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot \tan t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{1}\right)\right| \]
        8. Recombined 2 regimes into one program.
        9. Add Preprocessing

        Alternative 5: 89.9% accurate, 0.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \cos t\\ t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ t_3 := t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2\\ t_4 := t \cdot \frac{eh}{ew}\\ \mathbf{if}\;t\_3 \leq -5 \cdot 10^{+50}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{\cos t}{\sqrt{\mathsf{fma}\left(t\_4 \cdot t, \frac{eh}{ew}, 1\right)}}, ew, \left(\tanh \sinh^{-1} t\_4 \cdot \left(\sin t \cdot eh\right)\right) \cdot 1\right)\right|\\ \mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-279}:\\ \;\;\;\;\left|t\_1\right|\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, \frac{\cos t \cdot ew}{1}\right)\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (let* ((t_1 (* ew (cos t)))
                (t_2 (atan (/ (* (- eh) (tan t)) ew)))
                (t_3 (- (* t_1 (cos t_2)) (* (* eh (sin t)) (sin t_2))))
                (t_4 (* t (/ eh ew))))
           (if (<= t_3 -5e+50)
             (fabs
              (fma
               (/ (cos t) (sqrt (fma (* t_4 t) (/ eh ew) 1.0)))
               ew
               (* (* (tanh (asinh t_4)) (* (sin t) eh)) 1.0)))
             (if (<= t_3 -1e-279)
               (fabs t_1)
               (fma
                eh
                (- (* (tanh (asinh (* (/ (tan t) ew) (- eh)))) (sin t)))
                (/ (* (cos t) ew) 1.0))))))
        double code(double eh, double ew, double t) {
        	double t_1 = ew * cos(t);
        	double t_2 = atan(((-eh * tan(t)) / ew));
        	double t_3 = (t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2));
        	double t_4 = t * (eh / ew);
        	double tmp;
        	if (t_3 <= -5e+50) {
        		tmp = fabs(fma((cos(t) / sqrt(fma((t_4 * t), (eh / ew), 1.0))), ew, ((tanh(asinh(t_4)) * (sin(t) * eh)) * 1.0)));
        	} else if (t_3 <= -1e-279) {
        		tmp = fabs(t_1);
        	} else {
        		tmp = fma(eh, -(tanh(asinh(((tan(t) / ew) * -eh))) * sin(t)), ((cos(t) * ew) / 1.0));
        	}
        	return tmp;
        }
        
        function code(eh, ew, t)
        	t_1 = Float64(ew * cos(t))
        	t_2 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
        	t_3 = Float64(Float64(t_1 * cos(t_2)) - Float64(Float64(eh * sin(t)) * sin(t_2)))
        	t_4 = Float64(t * Float64(eh / ew))
        	tmp = 0.0
        	if (t_3 <= -5e+50)
        		tmp = abs(fma(Float64(cos(t) / sqrt(fma(Float64(t_4 * t), Float64(eh / ew), 1.0))), ew, Float64(Float64(tanh(asinh(t_4)) * Float64(sin(t) * eh)) * 1.0)));
        	elseif (t_3 <= -1e-279)
        		tmp = abs(t_1);
        	else
        		tmp = fma(eh, Float64(-Float64(tanh(asinh(Float64(Float64(tan(t) / ew) * Float64(-eh)))) * sin(t))), Float64(Float64(cos(t) * ew) / 1.0));
        	end
        	return tmp
        end
        
        code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+50], N[Abs[N[(N[(N[Cos[t], $MachinePrecision] / N[Sqrt[N[(N[(t$95$4 * t), $MachinePrecision] * N[(eh / ew), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Tanh[N[ArcSinh[t$95$4], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, -1e-279], N[Abs[t$95$1], $MachinePrecision], N[(eh * (-N[(N[Tanh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]) + N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := ew \cdot \cos t\\
        t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
        t_3 := t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2\\
        t_4 := t \cdot \frac{eh}{ew}\\
        \mathbf{if}\;t\_3 \leq -5 \cdot 10^{+50}:\\
        \;\;\;\;\left|\mathsf{fma}\left(\frac{\cos t}{\sqrt{\mathsf{fma}\left(t\_4 \cdot t, \frac{eh}{ew}, 1\right)}}, ew, \left(\tanh \sinh^{-1} t\_4 \cdot \left(\sin t \cdot eh\right)\right) \cdot 1\right)\right|\\
        
        \mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-279}:\\
        \;\;\;\;\left|t\_1\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, \frac{\cos t \cdot ew}{1}\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -5e50

          1. Initial program 99.8%

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

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

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

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

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

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

            \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot \tan t\right)}\right)\right| \]
          7. Step-by-step derivation
            1. Applied rewrites91.5%

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

              \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
            3. Step-by-step derivation
              1. Applied rewrites82.0%

                \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
              2. Step-by-step derivation
                1. lift-*.f64N/A

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

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

                  \[\leadsto \left|ew \cdot \left(\frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)} + \color{blue}{\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew}}\right)\right| \]
                4. distribute-rgt-inN/A

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

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\frac{\cos t}{\sqrt{\mathsf{fma}\left(\left(t \cdot \frac{eh}{ew}\right) \cdot t, \frac{eh}{ew}, 1\right)}}, ew, \left(\tanh \sinh^{-1} \left(t \cdot \frac{eh}{ew}\right) \cdot \left(\sin t \cdot eh\right)\right) \cdot 1\right)}\right| \]

              if -5e50 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -1.00000000000000006e-279

              1. Initial program 99.8%

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

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

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

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

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

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

                \[\leadsto \left|ew \cdot \cos t\right| \]
              7. Step-by-step derivation
                1. lower-cos.f6462.7

                  \[\leadsto \left|ew \cdot \cos t\right| \]
              8. Applied rewrites62.7%

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

              if -1.00000000000000006e-279 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

              1. Initial program 99.8%

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

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

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

                  \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}} \]
                4. rem-square-sqrt50.5

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

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

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

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

                \[\leadsto \mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, \frac{\cos t \cdot ew}{\color{blue}{1}}\right) \]
              5. Step-by-step derivation
                1. Applied rewrites49.9%

                  \[\leadsto \mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, \frac{\cos t \cdot ew}{\color{blue}{1}}\right) \]
              6. Recombined 3 regimes into one program.
              7. Add Preprocessing

              Alternative 6: 88.3% accurate, 1.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{eh}{ew}\\ \mathbf{if}\;ew \leq 5 \cdot 10^{+68}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{\cos t}{\sqrt{\mathsf{fma}\left(t\_1 \cdot t, \frac{eh}{ew}, 1\right)}}, ew, \left(\tanh \sinh^{-1} t\_1 \cdot \left(\sin t \cdot eh\right)\right) \cdot 1\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \end{array} \]
              (FPCore (eh ew t)
               :precision binary64
               (let* ((t_1 (* t (/ eh ew))))
                 (if (<= ew 5e+68)
                   (fabs
                    (fma
                     (/ (cos t) (sqrt (fma (* t_1 t) (/ eh ew) 1.0)))
                     ew
                     (* (* (tanh (asinh t_1)) (* (sin t) eh)) 1.0)))
                   (fabs (* ew (cos t))))))
              double code(double eh, double ew, double t) {
              	double t_1 = t * (eh / ew);
              	double tmp;
              	if (ew <= 5e+68) {
              		tmp = fabs(fma((cos(t) / sqrt(fma((t_1 * t), (eh / ew), 1.0))), ew, ((tanh(asinh(t_1)) * (sin(t) * eh)) * 1.0)));
              	} else {
              		tmp = fabs((ew * cos(t)));
              	}
              	return tmp;
              }
              
              function code(eh, ew, t)
              	t_1 = Float64(t * Float64(eh / ew))
              	tmp = 0.0
              	if (ew <= 5e+68)
              		tmp = abs(fma(Float64(cos(t) / sqrt(fma(Float64(t_1 * t), Float64(eh / ew), 1.0))), ew, Float64(Float64(tanh(asinh(t_1)) * Float64(sin(t) * eh)) * 1.0)));
              	else
              		tmp = abs(Float64(ew * cos(t)));
              	end
              	return tmp
              end
              
              code[eh_, ew_, t_] := Block[{t$95$1 = N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[ew, 5e+68], N[Abs[N[(N[(N[Cos[t], $MachinePrecision] / N[Sqrt[N[(N[(t$95$1 * t), $MachinePrecision] * N[(eh / ew), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := t \cdot \frac{eh}{ew}\\
              \mathbf{if}\;ew \leq 5 \cdot 10^{+68}:\\
              \;\;\;\;\left|\mathsf{fma}\left(\frac{\cos t}{\sqrt{\mathsf{fma}\left(t\_1 \cdot t, \frac{eh}{ew}, 1\right)}}, ew, \left(\tanh \sinh^{-1} t\_1 \cdot \left(\sin t \cdot eh\right)\right) \cdot 1\right)\right|\\
              
              \mathbf{else}:\\
              \;\;\;\;\left|ew \cdot \cos t\right|\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if ew < 5.0000000000000004e68

                1. Initial program 99.8%

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

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

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

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

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

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

                  \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot \tan t\right)}\right)\right| \]
                7. Step-by-step derivation
                  1. Applied rewrites91.5%

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

                    \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
                  3. Step-by-step derivation
                    1. Applied rewrites82.0%

                      \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
                    2. Step-by-step derivation
                      1. lift-*.f64N/A

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

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

                        \[\leadsto \left|ew \cdot \left(\frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)} + \color{blue}{\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew}}\right)\right| \]
                      4. distribute-rgt-inN/A

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

                      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\frac{\cos t}{\sqrt{\mathsf{fma}\left(\left(t \cdot \frac{eh}{ew}\right) \cdot t, \frac{eh}{ew}, 1\right)}}, ew, \left(\tanh \sinh^{-1} \left(t \cdot \frac{eh}{ew}\right) \cdot \left(\sin t \cdot eh\right)\right) \cdot 1\right)}\right| \]

                    if 5.0000000000000004e68 < ew

                    1. Initial program 99.8%

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

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

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

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

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

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

                      \[\leadsto \left|ew \cdot \cos t\right| \]
                    7. Step-by-step derivation
                      1. lower-cos.f6462.7

                        \[\leadsto \left|ew \cdot \cos t\right| \]
                    8. Applied rewrites62.7%

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

                  Alternative 7: 69.3% accurate, 1.9× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 0.8:\\ \;\;\;\;\mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, ew + {t}^{2} \cdot \left(-0.5 \cdot ew\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \end{array} \]
                  (FPCore (eh ew t)
                   :precision binary64
                   (if (<= t 0.8)
                     (fma
                      eh
                      (- (* (tanh (asinh (* (/ (tan t) ew) (- eh)))) (sin t)))
                      (+ ew (* (pow t 2.0) (* -0.5 ew))))
                     (fabs (* ew (cos t)))))
                  double code(double eh, double ew, double t) {
                  	double tmp;
                  	if (t <= 0.8) {
                  		tmp = fma(eh, -(tanh(asinh(((tan(t) / ew) * -eh))) * sin(t)), (ew + (pow(t, 2.0) * (-0.5 * ew))));
                  	} else {
                  		tmp = fabs((ew * cos(t)));
                  	}
                  	return tmp;
                  }
                  
                  function code(eh, ew, t)
                  	tmp = 0.0
                  	if (t <= 0.8)
                  		tmp = fma(eh, Float64(-Float64(tanh(asinh(Float64(Float64(tan(t) / ew) * Float64(-eh)))) * sin(t))), Float64(ew + Float64((t ^ 2.0) * Float64(-0.5 * ew))));
                  	else
                  		tmp = abs(Float64(ew * cos(t)));
                  	end
                  	return tmp
                  end
                  
                  code[eh_, ew_, t_] := If[LessEqual[t, 0.8], N[(eh * (-N[(N[Tanh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]) + N[(ew + N[(N[Power[t, 2.0], $MachinePrecision] * N[(-0.5 * ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;t \leq 0.8:\\
                  \;\;\;\;\mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, ew + {t}^{2} \cdot \left(-0.5 \cdot ew\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left|ew \cdot \cos t\right|\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if t < 0.80000000000000004

                    1. Initial program 99.8%

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

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

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

                        \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}} \]
                      4. rem-square-sqrt50.5

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, \color{blue}{ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)}\right) \]
                    5. Step-by-step derivation
                      1. lower-+.f64N/A

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

                        \[\leadsto \mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, ew + {t}^{2} \cdot \color{blue}{\left(\frac{-1}{2} \cdot ew - \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)}\right) \]
                      3. lower-pow.f64N/A

                        \[\leadsto \mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, ew + {t}^{2} \cdot \left(\color{blue}{\frac{-1}{2} \cdot ew} - \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) \]
                      4. lower--.f64N/A

                        \[\leadsto \mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{1}{2} \cdot \frac{{eh}^{2}}{ew}}\right)\right) \]
                      5. lower-*.f64N/A

                        \[\leadsto \mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{1}{2}} \cdot \frac{{eh}^{2}}{ew}\right)\right) \]
                      6. lower-*.f64N/A

                        \[\leadsto \mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \frac{1}{2} \cdot \color{blue}{\frac{{eh}^{2}}{ew}}\right)\right) \]
                      7. lower-/.f64N/A

                        \[\leadsto \mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \frac{1}{2} \cdot \frac{{eh}^{2}}{\color{blue}{ew}}\right)\right) \]
                      8. lower-pow.f6418.0

                        \[\leadsto \mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, ew + {t}^{2} \cdot \left(-0.5 \cdot ew - 0.5 \cdot \frac{{eh}^{2}}{ew}\right)\right) \]
                    6. Applied rewrites18.0%

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

                      \[\leadsto \mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot \color{blue}{ew}\right)\right) \]
                    8. Step-by-step derivation
                      1. lower-*.f6430.0

                        \[\leadsto \mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, ew + {t}^{2} \cdot \left(-0.5 \cdot ew\right)\right) \]
                    9. Applied rewrites30.0%

                      \[\leadsto \mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, ew + {t}^{2} \cdot \left(-0.5 \cdot \color{blue}{ew}\right)\right) \]

                    if 0.80000000000000004 < t

                    1. Initial program 99.8%

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

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

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

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

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

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

                      \[\leadsto \left|ew \cdot \cos t\right| \]
                    7. Step-by-step derivation
                      1. lower-cos.f6462.7

                        \[\leadsto \left|ew \cdot \cos t\right| \]
                    8. Applied rewrites62.7%

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

                  Alternative 8: 65.7% accurate, 2.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)\\ \mathbf{if}\;t \leq 0.8:\\ \;\;\;\;\left|ew \cdot \left(\frac{\tanh t\_1 \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{1 + -0.5 \cdot {t}^{2}}{\cosh t\_1}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \end{array} \]
                  (FPCore (eh ew t)
                   :precision binary64
                   (let* ((t_1 (asinh (* (/ eh ew) t))))
                     (if (<= t 0.8)
                       (fabs
                        (*
                         ew
                         (+
                          (/ (* (tanh t_1) (* (sin t) eh)) ew)
                          (/ (+ 1.0 (* -0.5 (pow t 2.0))) (cosh t_1)))))
                       (fabs (* ew (cos t))))))
                  double code(double eh, double ew, double t) {
                  	double t_1 = asinh(((eh / ew) * t));
                  	double tmp;
                  	if (t <= 0.8) {
                  		tmp = fabs((ew * (((tanh(t_1) * (sin(t) * eh)) / ew) + ((1.0 + (-0.5 * pow(t, 2.0))) / cosh(t_1)))));
                  	} else {
                  		tmp = fabs((ew * cos(t)));
                  	}
                  	return tmp;
                  }
                  
                  def code(eh, ew, t):
                  	t_1 = math.asinh(((eh / ew) * t))
                  	tmp = 0
                  	if t <= 0.8:
                  		tmp = math.fabs((ew * (((math.tanh(t_1) * (math.sin(t) * eh)) / ew) + ((1.0 + (-0.5 * math.pow(t, 2.0))) / math.cosh(t_1)))))
                  	else:
                  		tmp = math.fabs((ew * math.cos(t)))
                  	return tmp
                  
                  function code(eh, ew, t)
                  	t_1 = asinh(Float64(Float64(eh / ew) * t))
                  	tmp = 0.0
                  	if (t <= 0.8)
                  		tmp = abs(Float64(ew * Float64(Float64(Float64(tanh(t_1) * Float64(sin(t) * eh)) / ew) + Float64(Float64(1.0 + Float64(-0.5 * (t ^ 2.0))) / cosh(t_1)))));
                  	else
                  		tmp = abs(Float64(ew * cos(t)));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(eh, ew, t)
                  	t_1 = asinh(((eh / ew) * t));
                  	tmp = 0.0;
                  	if (t <= 0.8)
                  		tmp = abs((ew * (((tanh(t_1) * (sin(t) * eh)) / ew) + ((1.0 + (-0.5 * (t ^ 2.0))) / cosh(t_1)))));
                  	else
                  		tmp = abs((ew * cos(t)));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcSinh[N[(N[(eh / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 0.8], N[Abs[N[(ew * N[(N[(N[(N[Tanh[t$95$1], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] + N[(N[(1.0 + N[(-0.5 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cosh[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)\\
                  \mathbf{if}\;t \leq 0.8:\\
                  \;\;\;\;\left|ew \cdot \left(\frac{\tanh t\_1 \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{1 + -0.5 \cdot {t}^{2}}{\cosh t\_1}\right)\right|\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left|ew \cdot \cos t\right|\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if t < 0.80000000000000004

                    1. Initial program 99.8%

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

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

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

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

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

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

                      \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot \tan t\right)}\right)\right| \]
                    7. Step-by-step derivation
                      1. Applied rewrites91.5%

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

                        \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
                      3. Step-by-step derivation
                        1. Applied rewrites82.0%

                          \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
                        2. Taylor expanded in t around 0

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

                            \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{1 + \frac{-1}{2} \cdot {t}^{2}}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
                          2. lower-*.f64N/A

                            \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{1 + \frac{-1}{2} \cdot {t}^{2}}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
                          3. lower-pow.f6457.5

                            \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{1 + -0.5 \cdot {t}^{2}}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
                        4. Applied rewrites57.5%

                          \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{1 + -0.5 \cdot {t}^{2}}{\cosh \color{blue}{\sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}}\right)\right| \]

                        if 0.80000000000000004 < t

                        1. Initial program 99.8%

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

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

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

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

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

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

                          \[\leadsto \left|ew \cdot \cos t\right| \]
                        7. Step-by-step derivation
                          1. lower-cos.f6462.7

                            \[\leadsto \left|ew \cdot \cos t\right| \]
                        8. Applied rewrites62.7%

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

                      Alternative 9: 62.7% accurate, 2.3× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)\\ \mathbf{if}\;t \leq 3.2 \cdot 10^{+14}:\\ \;\;\;\;\left|ew \cdot \left(\frac{\tanh t\_1 \cdot \left(t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh t\_1}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \end{array} \]
                      (FPCore (eh ew t)
                       :precision binary64
                       (let* ((t_1 (asinh (* (/ eh ew) t))))
                         (if (<= t 3.2e+14)
                           (fabs (* ew (+ (/ (* (tanh t_1) (* t eh)) ew) (/ (cos t) (cosh t_1)))))
                           (fabs (* ew (cos t))))))
                      double code(double eh, double ew, double t) {
                      	double t_1 = asinh(((eh / ew) * t));
                      	double tmp;
                      	if (t <= 3.2e+14) {
                      		tmp = fabs((ew * (((tanh(t_1) * (t * eh)) / ew) + (cos(t) / cosh(t_1)))));
                      	} else {
                      		tmp = fabs((ew * cos(t)));
                      	}
                      	return tmp;
                      }
                      
                      def code(eh, ew, t):
                      	t_1 = math.asinh(((eh / ew) * t))
                      	tmp = 0
                      	if t <= 3.2e+14:
                      		tmp = math.fabs((ew * (((math.tanh(t_1) * (t * eh)) / ew) + (math.cos(t) / math.cosh(t_1)))))
                      	else:
                      		tmp = math.fabs((ew * math.cos(t)))
                      	return tmp
                      
                      function code(eh, ew, t)
                      	t_1 = asinh(Float64(Float64(eh / ew) * t))
                      	tmp = 0.0
                      	if (t <= 3.2e+14)
                      		tmp = abs(Float64(ew * Float64(Float64(Float64(tanh(t_1) * Float64(t * eh)) / ew) + Float64(cos(t) / cosh(t_1)))));
                      	else
                      		tmp = abs(Float64(ew * cos(t)));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(eh, ew, t)
                      	t_1 = asinh(((eh / ew) * t));
                      	tmp = 0.0;
                      	if (t <= 3.2e+14)
                      		tmp = abs((ew * (((tanh(t_1) * (t * eh)) / ew) + (cos(t) / cosh(t_1)))));
                      	else
                      		tmp = abs((ew * cos(t)));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcSinh[N[(N[(eh / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 3.2e+14], N[Abs[N[(ew * N[(N[(N[(N[Tanh[t$95$1], $MachinePrecision] * N[(t * eh), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] / N[Cosh[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)\\
                      \mathbf{if}\;t \leq 3.2 \cdot 10^{+14}:\\
                      \;\;\;\;\left|ew \cdot \left(\frac{\tanh t\_1 \cdot \left(t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh t\_1}\right)\right|\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\left|ew \cdot \cos t\right|\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if t < 3.2e14

                        1. Initial program 99.8%

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

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

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

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

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

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

                          \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot \tan t\right)}\right)\right| \]
                        7. Step-by-step derivation
                          1. Applied rewrites91.5%

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

                            \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
                          3. Step-by-step derivation
                            1. Applied rewrites82.0%

                              \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
                            2. Taylor expanded in t around 0

                              \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]
                            3. Step-by-step derivation
                              1. Applied rewrites64.5%

                                \[\leadsto \left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right) \cdot \left(t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)}\right)\right| \]

                              if 3.2e14 < t

                              1. Initial program 99.8%

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

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

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

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

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

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

                                \[\leadsto \left|ew \cdot \cos t\right| \]
                              7. Step-by-step derivation
                                1. lower-cos.f6462.7

                                  \[\leadsto \left|ew \cdot \cos t\right| \]
                              8. Applied rewrites62.7%

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

                            Alternative 10: 52.6% accurate, 2.9× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t}{ew} \cdot \left(-eh\right)\\ \mathbf{if}\;t \leq 1.6:\\ \;\;\;\;\frac{\cos t \cdot ew - t\_1 \cdot \left(eh \cdot t\right)}{\cosh \sinh^{-1} t\_1}\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \end{array} \]
                            (FPCore (eh ew t)
                             :precision binary64
                             (let* ((t_1 (* (/ t ew) (- eh))))
                               (if (<= t 1.6)
                                 (/ (- (* (cos t) ew) (* t_1 (* eh t))) (cosh (asinh t_1)))
                                 (fabs (* ew (cos t))))))
                            double code(double eh, double ew, double t) {
                            	double t_1 = (t / ew) * -eh;
                            	double tmp;
                            	if (t <= 1.6) {
                            		tmp = ((cos(t) * ew) - (t_1 * (eh * t))) / cosh(asinh(t_1));
                            	} else {
                            		tmp = fabs((ew * cos(t)));
                            	}
                            	return tmp;
                            }
                            
                            def code(eh, ew, t):
                            	t_1 = (t / ew) * -eh
                            	tmp = 0
                            	if t <= 1.6:
                            		tmp = ((math.cos(t) * ew) - (t_1 * (eh * t))) / math.cosh(math.asinh(t_1))
                            	else:
                            		tmp = math.fabs((ew * math.cos(t)))
                            	return tmp
                            
                            function code(eh, ew, t)
                            	t_1 = Float64(Float64(t / ew) * Float64(-eh))
                            	tmp = 0.0
                            	if (t <= 1.6)
                            		tmp = Float64(Float64(Float64(cos(t) * ew) - Float64(t_1 * Float64(eh * t))) / cosh(asinh(t_1)));
                            	else
                            		tmp = abs(Float64(ew * cos(t)));
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(eh, ew, t)
                            	t_1 = (t / ew) * -eh;
                            	tmp = 0.0;
                            	if (t <= 1.6)
                            		tmp = ((cos(t) * ew) - (t_1 * (eh * t))) / cosh(asinh(t_1));
                            	else
                            		tmp = abs((ew * cos(t)));
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(t / ew), $MachinePrecision] * (-eh)), $MachinePrecision]}, If[LessEqual[t, 1.6], N[(N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] - N[(t$95$1 * N[(eh * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_1 := \frac{t}{ew} \cdot \left(-eh\right)\\
                            \mathbf{if}\;t \leq 1.6:\\
                            \;\;\;\;\frac{\cos t \cdot ew - t\_1 \cdot \left(eh \cdot t\right)}{\cosh \sinh^{-1} t\_1}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\left|ew \cdot \cos t\right|\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if t < 1.6000000000000001

                              1. Initial program 99.8%

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

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

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

                                  \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}} \]
                                4. rem-square-sqrt50.5

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

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

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

                                \[\leadsto \frac{\cos t \cdot ew - \left(\color{blue}{\frac{t}{ew}} \cdot \left(-eh\right)\right) \cdot \left(\sin t \cdot eh\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right)} \]
                              5. Step-by-step derivation
                                1. lower-/.f6433.1

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

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

                                \[\leadsto \frac{\cos t \cdot ew - \left(\frac{t}{ew} \cdot \left(-eh\right)\right) \cdot \left(\sin t \cdot eh\right)}{\cosh \sinh^{-1} \left(\color{blue}{\frac{t}{ew}} \cdot \left(-eh\right)\right)} \]
                              8. Step-by-step derivation
                                1. lower-/.f6432.9

                                  \[\leadsto \frac{\cos t \cdot ew - \left(\frac{t}{ew} \cdot \left(-eh\right)\right) \cdot \left(\sin t \cdot eh\right)}{\cosh \sinh^{-1} \left(\frac{t}{\color{blue}{ew}} \cdot \left(-eh\right)\right)} \]
                              9. Applied rewrites32.9%

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

                                \[\leadsto \frac{\cos t \cdot ew - \left(\frac{t}{ew} \cdot \left(-eh\right)\right) \cdot \color{blue}{\left(eh \cdot t\right)}}{\cosh \sinh^{-1} \left(\frac{t}{ew} \cdot \left(-eh\right)\right)} \]
                              11. Step-by-step derivation
                                1. lower-*.f6431.1

                                  \[\leadsto \frac{\cos t \cdot ew - \left(\frac{t}{ew} \cdot \left(-eh\right)\right) \cdot \left(eh \cdot \color{blue}{t}\right)}{\cosh \sinh^{-1} \left(\frac{t}{ew} \cdot \left(-eh\right)\right)} \]
                              12. Applied rewrites31.1%

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

                              if 1.6000000000000001 < t

                              1. Initial program 99.8%

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

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

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

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

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

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

                                \[\leadsto \left|ew \cdot \cos t\right| \]
                              7. Step-by-step derivation
                                1. lower-cos.f6462.7

                                  \[\leadsto \left|ew \cdot \cos t\right| \]
                              8. Applied rewrites62.7%

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

                            Alternative 11: 42.9% accurate, 6.7× speedup?

                            \[\begin{array}{l} \\ \left|ew \cdot \cos t\right| \end{array} \]
                            (FPCore (eh ew t) :precision binary64 (fabs (* ew (cos t))))
                            double code(double eh, double ew, double t) {
                            	return fabs((ew * cos(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 * cos(t)))
                            end function
                            
                            public static double code(double eh, double ew, double t) {
                            	return Math.abs((ew * Math.cos(t)));
                            }
                            
                            def code(eh, ew, t):
                            	return math.fabs((ew * math.cos(t)))
                            
                            function code(eh, ew, t)
                            	return abs(Float64(ew * cos(t)))
                            end
                            
                            function tmp = code(eh, ew, t)
                            	tmp = abs((ew * cos(t)));
                            end
                            
                            code[eh_, ew_, t_] := N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \left|ew \cdot \cos t\right|
                            \end{array}
                            
                            Derivation
                            1. Initial program 99.8%

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

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

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

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

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

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

                              \[\leadsto \left|ew \cdot \cos t\right| \]
                            7. Step-by-step derivation
                              1. lower-cos.f6462.7

                                \[\leadsto \left|ew \cdot \cos t\right| \]
                            8. Applied rewrites62.7%

                              \[\leadsto \left|ew \cdot \cos t\right| \]
                            9. Add Preprocessing

                            Alternative 12: 42.8% accurate, 0.9× speedup?

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

                              1. Initial program 99.8%

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

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

                                \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
                              4. Step-by-step derivation
                                1. lower-/.f6442.8

                                  \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{ew}}\right|} \]
                              5. Applied rewrites42.8%

                                \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
                              6. Step-by-step derivation
                                1. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{1}{\left|\frac{1}{ew}\right|}} \]
                                2. rgt-mult-inverseN/A

                                  \[\leadsto \frac{\color{blue}{ew \cdot \frac{1}{ew}}}{\left|\frac{1}{ew}\right|} \]
                                3. lift-/.f64N/A

                                  \[\leadsto \frac{ew \cdot \color{blue}{\frac{1}{ew}}}{\left|\frac{1}{ew}\right|} \]
                                4. associate-/l*N/A

                                  \[\leadsto \color{blue}{ew \cdot \frac{\frac{1}{ew}}{\left|\frac{1}{ew}\right|}} \]
                                5. lower-*.f64N/A

                                  \[\leadsto \color{blue}{ew \cdot \frac{\frac{1}{ew}}{\left|\frac{1}{ew}\right|}} \]
                                6. lower-/.f6442.9

                                  \[\leadsto ew \cdot \color{blue}{\frac{\frac{1}{ew}}{\left|\frac{1}{ew}\right|}} \]
                              7. Applied rewrites42.9%

                                \[\leadsto \color{blue}{ew \cdot \frac{\frac{1}{ew}}{\left|\frac{1}{ew}\right|}} \]

                              if 1e-224 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

                              1. Initial program 99.8%

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

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

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

                                  \[\leadsto \color{blue}{\sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}} \]
                                4. rem-square-sqrt50.5

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

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

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

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

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

                                  \[\leadsto ew \cdot \cos t \]
                              6. Applied rewrites32.3%

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

                            Alternative 13: 42.8% accurate, 16.2× speedup?

                            \[\begin{array}{l} \\ ew \cdot \frac{\frac{1}{ew}}{\left|\frac{1}{ew}\right|} \end{array} \]
                            (FPCore (eh ew t) :precision binary64 (* ew (/ (/ 1.0 ew) (fabs (/ 1.0 ew)))))
                            double code(double eh, double ew, double t) {
                            	return ew * ((1.0 / ew) / fabs((1.0 / ew)));
                            }
                            
                            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 * ((1.0d0 / ew) / abs((1.0d0 / ew)))
                            end function
                            
                            public static double code(double eh, double ew, double t) {
                            	return ew * ((1.0 / ew) / Math.abs((1.0 / ew)));
                            }
                            
                            def code(eh, ew, t):
                            	return ew * ((1.0 / ew) / math.fabs((1.0 / ew)))
                            
                            function code(eh, ew, t)
                            	return Float64(ew * Float64(Float64(1.0 / ew) / abs(Float64(1.0 / ew))))
                            end
                            
                            function tmp = code(eh, ew, t)
                            	tmp = ew * ((1.0 / ew) / abs((1.0 / ew)));
                            end
                            
                            code[eh_, ew_, t_] := N[(ew * N[(N[(1.0 / ew), $MachinePrecision] / N[Abs[N[(1.0 / ew), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            ew \cdot \frac{\frac{1}{ew}}{\left|\frac{1}{ew}\right|}
                            \end{array}
                            
                            Derivation
                            1. Initial program 99.8%

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

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

                              \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
                            4. Step-by-step derivation
                              1. lower-/.f6442.8

                                \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{ew}}\right|} \]
                            5. Applied rewrites42.8%

                              \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
                            6. Step-by-step derivation
                              1. lift-/.f64N/A

                                \[\leadsto \color{blue}{\frac{1}{\left|\frac{1}{ew}\right|}} \]
                              2. rgt-mult-inverseN/A

                                \[\leadsto \frac{\color{blue}{ew \cdot \frac{1}{ew}}}{\left|\frac{1}{ew}\right|} \]
                              3. lift-/.f64N/A

                                \[\leadsto \frac{ew \cdot \color{blue}{\frac{1}{ew}}}{\left|\frac{1}{ew}\right|} \]
                              4. associate-/l*N/A

                                \[\leadsto \color{blue}{ew \cdot \frac{\frac{1}{ew}}{\left|\frac{1}{ew}\right|}} \]
                              5. lower-*.f64N/A

                                \[\leadsto \color{blue}{ew \cdot \frac{\frac{1}{ew}}{\left|\frac{1}{ew}\right|}} \]
                              6. lower-/.f6442.9

                                \[\leadsto ew \cdot \color{blue}{\frac{\frac{1}{ew}}{\left|\frac{1}{ew}\right|}} \]
                            7. Applied rewrites42.9%

                              \[\leadsto \color{blue}{ew \cdot \frac{\frac{1}{ew}}{\left|\frac{1}{ew}\right|}} \]
                            8. Add Preprocessing

                            Alternative 14: 40.7% accurate, 20.8× speedup?

                            \[\begin{array}{l} \\ \frac{ew}{ew \cdot \left|\frac{1}{ew}\right|} \end{array} \]
                            (FPCore (eh ew t) :precision binary64 (/ ew (* ew (fabs (/ 1.0 ew)))))
                            double code(double eh, double ew, double t) {
                            	return ew / (ew * fabs((1.0 / ew)));
                            }
                            
                            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 / (ew * abs((1.0d0 / ew)))
                            end function
                            
                            public static double code(double eh, double ew, double t) {
                            	return ew / (ew * Math.abs((1.0 / ew)));
                            }
                            
                            def code(eh, ew, t):
                            	return ew / (ew * math.fabs((1.0 / ew)))
                            
                            function code(eh, ew, t)
                            	return Float64(ew / Float64(ew * abs(Float64(1.0 / ew))))
                            end
                            
                            function tmp = code(eh, ew, t)
                            	tmp = ew / (ew * abs((1.0 / ew)));
                            end
                            
                            code[eh_, ew_, t_] := N[(ew / N[(ew * N[Abs[N[(1.0 / ew), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \frac{ew}{ew \cdot \left|\frac{1}{ew}\right|}
                            \end{array}
                            
                            Derivation
                            1. Initial program 99.8%

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

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

                              \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
                            4. Step-by-step derivation
                              1. lower-/.f6442.8

                                \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{ew}}\right|} \]
                            5. Applied rewrites42.8%

                              \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
                            6. Step-by-step derivation
                              1. lift-/.f64N/A

                                \[\leadsto \color{blue}{\frac{1}{\left|\frac{1}{ew}\right|}} \]
                              2. rgt-mult-inverseN/A

                                \[\leadsto \frac{\color{blue}{ew \cdot \frac{1}{ew}}}{\left|\frac{1}{ew}\right|} \]
                              3. mult-flip-revN/A

                                \[\leadsto \frac{\color{blue}{\frac{ew}{ew}}}{\left|\frac{1}{ew}\right|} \]
                              4. associate-/l/N/A

                                \[\leadsto \color{blue}{\frac{ew}{ew \cdot \left|\frac{1}{ew}\right|}} \]
                              5. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{ew}{ew \cdot \left|\frac{1}{ew}\right|}} \]
                              6. lower-*.f6442.8

                                \[\leadsto \frac{ew}{\color{blue}{ew \cdot \left|\frac{1}{ew}\right|}} \]
                            7. Applied rewrites42.8%

                              \[\leadsto \color{blue}{\frac{ew}{ew \cdot \left|\frac{1}{ew}\right|}} \]
                            8. Add Preprocessing

                            Alternative 15: 40.1% accurate, 27.7× speedup?

                            \[\begin{array}{l} \\ \frac{1}{\left|\frac{1}{ew}\right|} \end{array} \]
                            (FPCore (eh ew t) :precision binary64 (/ 1.0 (fabs (/ 1.0 ew))))
                            double code(double eh, double ew, double t) {
                            	return 1.0 / fabs((1.0 / ew));
                            }
                            
                            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 = 1.0d0 / abs((1.0d0 / ew))
                            end function
                            
                            public static double code(double eh, double ew, double t) {
                            	return 1.0 / Math.abs((1.0 / ew));
                            }
                            
                            def code(eh, ew, t):
                            	return 1.0 / math.fabs((1.0 / ew))
                            
                            function code(eh, ew, t)
                            	return Float64(1.0 / abs(Float64(1.0 / ew)))
                            end
                            
                            function tmp = code(eh, ew, t)
                            	tmp = 1.0 / abs((1.0 / ew));
                            end
                            
                            code[eh_, ew_, t_] := N[(1.0 / N[Abs[N[(1.0 / ew), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \frac{1}{\left|\frac{1}{ew}\right|}
                            \end{array}
                            
                            Derivation
                            1. Initial program 99.8%

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

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

                              \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
                            4. Step-by-step derivation
                              1. lower-/.f6442.8

                                \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{ew}}\right|} \]
                            5. Applied rewrites42.8%

                              \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
                            6. Add Preprocessing

                            Reproduce

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