Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 14.5s
Alternatives: 13
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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

\\
\begin{array}{l}
t_1 := \frac{\tan t}{ew}\\
\left|\mathsf{fma}\left(\tanh \sinh^{-1} \left(t\_1 \cdot \left(-eh\right)\right) \cdot \left(-\sin t\right), eh, \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(t\_1 \cdot eh\right)\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. Add Preprocessing
  3. Taylor expanded in eh around 0

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

      \[\leadsto \left|\color{blue}{-1 \cdot \left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)\right) - \left(\mathsf{neg}\left(ew\right)\right) \cdot \left(\cos t \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)}\right| \]
    2. distribute-lft-neg-outN/A

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

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

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

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

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

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

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

Alternative 2: 61.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \cos t\\ t_2 := \tan^{-1} \left(\frac{eh \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 := \frac{\tan t}{ew}\\ \mathbf{if}\;t\_3 \leq -5 \cdot 10^{-87}:\\ \;\;\;\;\left(-ew\right) \cdot \cos t\\ \mathbf{elif}\;t\_3 \leq 4 \cdot 10^{-43}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(t\_4 \cdot \left(-eh\right), \left(-eh\right) \cdot t, ew\right)}{\cosh \sinh^{-1} \left(t\_4 \cdot eh\right)}\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))))
        (t_3 (- (* t_1 (cos t_2)) (* (* eh (sin t)) (sin t_2))))
        (t_4 (/ (tan t) ew)))
   (if (<= t_3 -5e-87)
     (* (- ew) (cos t))
     (if (<= t_3 4e-43)
       (fabs
        (/ (fma (* t_4 (- eh)) (* (- eh) t) ew) (cosh (asinh (* t_4 eh)))))
       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 t_3 = (t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2));
	double t_4 = tan(t) / ew;
	double tmp;
	if (t_3 <= -5e-87) {
		tmp = -ew * cos(t);
	} else if (t_3 <= 4e-43) {
		tmp = fabs((fma((t_4 * -eh), (-eh * t), ew) / cosh(asinh((t_4 * eh)))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(ew * cos(t))
	t_2 = atan(Float64(Float64(eh * tan(t)) / Float64(-ew)))
	t_3 = Float64(Float64(t_1 * cos(t_2)) - Float64(Float64(eh * sin(t)) * sin(t_2)))
	t_4 = Float64(tan(t) / ew)
	tmp = 0.0
	if (t_3 <= -5e-87)
		tmp = Float64(Float64(-ew) * cos(t));
	elseif (t_3 <= 4e-43)
		tmp = abs(Float64(fma(Float64(t_4 * Float64(-eh)), Float64(Float64(-eh) * t), ew) / cosh(asinh(Float64(t_4 * eh)))));
	else
		tmp = t_1;
	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[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-87], N[((-ew) * N[Cos[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 4e-43], N[Abs[N[(N[(N[(t$95$4 * (-eh)), $MachinePrecision] * N[((-eh) * t), $MachinePrecision] + ew), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(t$95$4 * eh), $MachinePrecision]], $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{eh \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 := \frac{\tan t}{ew}\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-87}:\\
\;\;\;\;\left(-ew\right) \cdot \cos t\\

\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{-43}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(t\_4 \cdot \left(-eh\right), \left(-eh\right) \cdot t, ew\right)}{\cosh \sinh^{-1} \left(t\_4 \cdot eh\right)}\right|\\

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


\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))))) < -5.00000000000000042e-87

    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
    3. Applied rewrites65.0%

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

      \[\leadsto \color{blue}{ew \cdot \left(\cos t \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(ew \cdot \cos t\right) \cdot {\left(\sqrt{-1}\right)}^{2}} \]
      2. unpow2N/A

        \[\leadsto \left(ew \cdot \cos t\right) \cdot \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \]
      3. rem-square-sqrtN/A

        \[\leadsto \left(ew \cdot \cos t\right) \cdot \color{blue}{-1} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \cos t\right)} \]
      5. associate-*r*N/A

        \[\leadsto \color{blue}{\left(-1 \cdot ew\right) \cdot \cos t} \]
      6. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(ew\right)\right)} \cdot \cos t \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \cos t} \]
      8. lower-neg.f64N/A

        \[\leadsto \color{blue}{\left(-ew\right)} \cdot \cos t \]
      9. lower-cos.f6458.4

        \[\leadsto \left(-ew\right) \cdot \color{blue}{\cos t} \]
    6. Applied rewrites58.4%

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

    if -5.00000000000000042e-87 < (-.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))))) < 4.00000000000000031e-43

    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
    3. Taylor expanded in t around 0

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

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

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

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

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

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

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

    if 4.00000000000000031e-43 < (-.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.7%

      \[\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
    3. Applied rewrites78.4%

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

      \[\leadsto \color{blue}{ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{{t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) + ew} \]
      2. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot ew} - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right), {t}^{2}, ew\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew} \cdot \left(-1 + \frac{1}{2}\right)}, {t}^{2}, ew\right) \]
      7. metadata-evalN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew}} \cdot \frac{-1}{2}, {t}^{2}, ew\right) \]
      10. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{\color{blue}{eh \cdot eh}}{ew} \cdot \frac{-1}{2}, {t}^{2}, ew\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{eh \cdot eh}{ew} \cdot \frac{-1}{2}, \color{blue}{t \cdot t}, ew\right) \]
      13. lower-*.f6432.5

        \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, \color{blue}{t \cdot t}, ew\right) \]
    6. Applied rewrites32.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, t \cdot t, ew\right)} \]
    7. Taylor expanded in eh around 0

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

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

        \[\leadsto ew \cdot \color{blue}{\cos t} \]
    9. Applied rewrites68.3%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) \leq -5 \cdot 10^{-87}:\\ \;\;\;\;\left(-ew\right) \cdot \cos t\\ \mathbf{elif}\;\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) \leq 4 \cdot 10^{-43}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\tan t}{ew} \cdot \left(-eh\right), \left(-eh\right) \cdot t, ew\right)}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \cos t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 60.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \cos t\\ t_2 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\ \mathbf{if}\;t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2 \leq -1 \cdot 10^{-283}:\\ \;\;\;\;\left(-ew\right) \cdot \cos t\\ \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-283)
     (* (- ew) (cos t))
     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-283) {
		tmp = -ew * cos(t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(eh, ew, t)
use fmin_fmax_functions
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ew * cos(t)
    t_2 = atan(((eh * tan(t)) / -ew))
    if (((t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= (-1d-283)) then
        tmp = -ew * cos(t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = ew * Math.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-283) {
		tmp = -ew * Math.cos(t);
	} 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-283:
		tmp = -ew * math.cos(t)
	else:
		tmp = t_1
	return tmp
function code(eh, ew, t)
	t_1 = Float64(ew * cos(t))
	t_2 = atan(Float64(Float64(eh * tan(t)) / Float64(-ew)))
	tmp = 0.0
	if (Float64(Float64(t_1 * cos(t_2)) - Float64(Float64(eh * sin(t)) * sin(t_2))) <= -1e-283)
		tmp = Float64(Float64(-ew) * cos(t));
	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-283)
		tmp = -ew * cos(t);
	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-283], N[((-ew) * N[Cos[t], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
t_2 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
\mathbf{if}\;t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2 \leq -1 \cdot 10^{-283}:\\
\;\;\;\;\left(-ew\right) \cdot \cos t\\

\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))))) < -9.99999999999999947e-284

    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
    3. Applied rewrites66.7%

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

      \[\leadsto \color{blue}{ew \cdot \left(\cos t \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(ew \cdot \cos t\right) \cdot {\left(\sqrt{-1}\right)}^{2}} \]
      2. unpow2N/A

        \[\leadsto \left(ew \cdot \cos t\right) \cdot \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \]
      3. rem-square-sqrtN/A

        \[\leadsto \left(ew \cdot \cos t\right) \cdot \color{blue}{-1} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{-1 \cdot \left(ew \cdot \cos t\right)} \]
      5. associate-*r*N/A

        \[\leadsto \color{blue}{\left(-1 \cdot ew\right) \cdot \cos t} \]
      6. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(ew\right)\right)} \cdot \cos t \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \cos t} \]
      8. lower-neg.f64N/A

        \[\leadsto \color{blue}{\left(-ew\right)} \cdot \cos t \]
      9. lower-cos.f6457.6

        \[\leadsto \left(-ew\right) \cdot \color{blue}{\cos t} \]
    6. Applied rewrites57.6%

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

    if -9.99999999999999947e-284 < (-.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. Add Preprocessing
    3. Applied rewrites81.6%

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

      \[\leadsto \color{blue}{ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{{t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) + ew} \]
      2. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot ew} - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right), {t}^{2}, ew\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew} \cdot \left(-1 + \frac{1}{2}\right)}, {t}^{2}, ew\right) \]
      7. metadata-evalN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew}} \cdot \frac{-1}{2}, {t}^{2}, ew\right) \]
      10. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{\color{blue}{eh \cdot eh}}{ew} \cdot \frac{-1}{2}, {t}^{2}, ew\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{eh \cdot eh}{ew} \cdot \frac{-1}{2}, \color{blue}{t \cdot t}, ew\right) \]
      13. lower-*.f6434.1

        \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, \color{blue}{t \cdot t}, ew\right) \]
    6. Applied rewrites34.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, t \cdot t, ew\right)} \]
    7. Taylor expanded in eh around 0

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

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

        \[\leadsto ew \cdot \color{blue}{\cos t} \]
    9. Applied rewrites65.3%

      \[\leadsto \color{blue}{ew \cdot \cos t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.0%

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

Alternative 4: 99.0% accurate, 1.1× speedup?

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

\\
\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{-t}{ew} \cdot eh\right) - \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\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. Add Preprocessing
  3. Taylor expanded in t around 0

    \[\leadsto \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} \color{blue}{\left(-1 \cdot \frac{eh \cdot t}{ew}\right)}\right| \]
  4. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \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} \color{blue}{\left(\mathsf{neg}\left(\frac{eh \cdot t}{ew}\right)\right)}\right| \]
    2. distribute-neg-fracN/A

      \[\leadsto \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} \color{blue}{\left(\frac{\mathsf{neg}\left(eh \cdot t\right)}{ew}\right)}\right| \]
    3. *-commutativeN/A

      \[\leadsto \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{\mathsf{neg}\left(\color{blue}{t \cdot eh}\right)}{ew}\right)\right| \]
    4. distribute-lft-neg-inN/A

      \[\leadsto \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{\color{blue}{\left(\mathsf{neg}\left(t\right)\right) \cdot eh}}{ew}\right)\right| \]
    5. associate-/l*N/A

      \[\leadsto \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} \color{blue}{\left(\left(\mathsf{neg}\left(t\right)\right) \cdot \frac{eh}{ew}\right)}\right| \]
    6. distribute-lft-neg-inN/A

      \[\leadsto \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} \color{blue}{\left(\mathsf{neg}\left(t \cdot \frac{eh}{ew}\right)\right)}\right| \]
    7. associate-/l*N/A

      \[\leadsto \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(\mathsf{neg}\left(\color{blue}{\frac{t \cdot eh}{ew}}\right)\right)\right| \]
    8. associate-*l/N/A

      \[\leadsto \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(\mathsf{neg}\left(\color{blue}{\frac{t}{ew} \cdot eh}\right)\right)\right| \]
    9. distribute-lft-neg-inN/A

      \[\leadsto \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} \color{blue}{\left(\left(\mathsf{neg}\left(\frac{t}{ew}\right)\right) \cdot eh\right)}\right| \]
    10. lower-*.f64N/A

      \[\leadsto \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} \color{blue}{\left(\left(\mathsf{neg}\left(\frac{t}{ew}\right)\right) \cdot eh\right)}\right| \]
    11. distribute-neg-fracN/A

      \[\leadsto \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(\color{blue}{\frac{\mathsf{neg}\left(t\right)}{ew}} \cdot eh\right)\right| \]
    12. lower-/.f64N/A

      \[\leadsto \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(\color{blue}{\frac{\mathsf{neg}\left(t\right)}{ew}} \cdot eh\right)\right| \]
    13. lower-neg.f6499.5

      \[\leadsto \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{\color{blue}{-t}}{ew} \cdot eh\right)\right| \]
  5. Applied rewrites99.5%

    \[\leadsto \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} \color{blue}{\left(\frac{-t}{ew} \cdot eh\right)}\right| \]
  6. Final simplification99.5%

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

Alternative 5: 98.8% accurate, 1.3× speedup?

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

\\
\left|\mathsf{fma}\left(\left(-\sin t\right) \cdot eh, \tanh \left(eh \cdot \frac{-t}{ew}\right), \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\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. Add Preprocessing
  3. Taylor expanded in eh around 0

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

      \[\leadsto \left|\color{blue}{-1 \cdot \left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)\right) - \left(\mathsf{neg}\left(ew\right)\right) \cdot \left(\cos t \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)}\right| \]
    2. distribute-lft-neg-outN/A

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

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

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

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

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

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

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

    \[\leadsto \left|\mathsf{fma}\left(\tanh \left(-1 \cdot \frac{eh \cdot t}{ew}\right) \cdot \left(-\sin t\right), eh, \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\right| \]
  8. Step-by-step derivation
    1. Applied rewrites99.1%

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

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

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

    Alternative 6: 98.8% accurate, 1.3× speedup?

    \[\begin{array}{l} \\ \left|\mathsf{fma}\left(\tanh \left(\frac{\left(-eh\right) \cdot t}{ew}\right) \cdot \left(-\sin t\right), eh, \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\right| \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (fabs
      (fma
       (* (tanh (/ (* (- eh) t) ew)) (- (sin t)))
       eh
       (* (* (cos t) ew) (cos (atan (* (/ (tan t) ew) eh)))))))
    double code(double eh, double ew, double t) {
    	return fabs(fma((tanh(((-eh * t) / ew)) * -sin(t)), eh, ((cos(t) * ew) * cos(atan(((tan(t) / ew) * eh))))));
    }
    
    function code(eh, ew, t)
    	return abs(fma(Float64(tanh(Float64(Float64(Float64(-eh) * t) / ew)) * Float64(-sin(t))), eh, Float64(Float64(cos(t) * ew) * cos(atan(Float64(Float64(tan(t) / ew) * eh))))))
    end
    
    code[eh_, ew_, t_] := N[Abs[N[(N[(N[Tanh[N[(N[((-eh) * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision] * (-N[Sin[t], $MachinePrecision])), $MachinePrecision] * eh + N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \left|\mathsf{fma}\left(\tanh \left(\frac{\left(-eh\right) \cdot t}{ew}\right) \cdot \left(-\sin t\right), eh, \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\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. Add Preprocessing
    3. Taylor expanded in eh around 0

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

        \[\leadsto \left|\color{blue}{-1 \cdot \left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)\right) - \left(\mathsf{neg}\left(ew\right)\right) \cdot \left(\cos t \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)}\right| \]
      2. distribute-lft-neg-outN/A

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(\tanh \left(-1 \cdot \frac{eh \cdot t}{ew}\right) \cdot \left(-\sin t\right), eh, \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\right| \]
    8. Step-by-step derivation
      1. Applied rewrites99.1%

        \[\leadsto \left|\mathsf{fma}\left(\tanh \left(-\frac{eh \cdot t}{ew}\right) \cdot \left(-\sin t\right), eh, \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\right| \]
      2. Final simplification99.1%

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

      Alternative 7: 75.4% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \cos t \cdot ew\\ \mathbf{if}\;ew \leq -1.05 \cdot 10^{-119} \lor \neg \left(ew \leq 1.55 \cdot 10^{-86}\right):\\ \;\;\;\;\left|\cos \tan^{-1} \left(\frac{-\sin t}{ew} \cdot \frac{eh}{\cos t}\right) \cdot t\_1\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(-eh\right) \cdot \left(\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{t\_1}\right) \cdot \sin t\right)\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* (cos t) ew)))
         (if (or (<= ew -1.05e-119) (not (<= ew 1.55e-86)))
           (fabs (* (cos (atan (* (/ (- (sin t)) ew) (/ eh (cos t))))) t_1))
           (fabs (* (- eh) (* (sin (atan (/ (* (- eh) (sin t)) t_1))) (sin t)))))))
      double code(double eh, double ew, double t) {
      	double t_1 = cos(t) * ew;
      	double tmp;
      	if ((ew <= -1.05e-119) || !(ew <= 1.55e-86)) {
      		tmp = fabs((cos(atan(((-sin(t) / ew) * (eh / cos(t))))) * t_1));
      	} else {
      		tmp = fabs((-eh * (sin(atan(((-eh * sin(t)) / t_1))) * sin(t))));
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(eh, ew, t)
      use fmin_fmax_functions
          real(8), intent (in) :: eh
          real(8), intent (in) :: ew
          real(8), intent (in) :: t
          real(8) :: t_1
          real(8) :: tmp
          t_1 = cos(t) * ew
          if ((ew <= (-1.05d-119)) .or. (.not. (ew <= 1.55d-86))) then
              tmp = abs((cos(atan(((-sin(t) / ew) * (eh / cos(t))))) * t_1))
          else
              tmp = abs((-eh * (sin(atan(((-eh * sin(t)) / t_1))) * sin(t))))
          end if
          code = tmp
      end function
      
      public static double code(double eh, double ew, double t) {
      	double t_1 = Math.cos(t) * ew;
      	double tmp;
      	if ((ew <= -1.05e-119) || !(ew <= 1.55e-86)) {
      		tmp = Math.abs((Math.cos(Math.atan(((-Math.sin(t) / ew) * (eh / Math.cos(t))))) * t_1));
      	} else {
      		tmp = Math.abs((-eh * (Math.sin(Math.atan(((-eh * Math.sin(t)) / t_1))) * Math.sin(t))));
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	t_1 = math.cos(t) * ew
      	tmp = 0
      	if (ew <= -1.05e-119) or not (ew <= 1.55e-86):
      		tmp = math.fabs((math.cos(math.atan(((-math.sin(t) / ew) * (eh / math.cos(t))))) * t_1))
      	else:
      		tmp = math.fabs((-eh * (math.sin(math.atan(((-eh * math.sin(t)) / t_1))) * math.sin(t))))
      	return tmp
      
      function code(eh, ew, t)
      	t_1 = Float64(cos(t) * ew)
      	tmp = 0.0
      	if ((ew <= -1.05e-119) || !(ew <= 1.55e-86))
      		tmp = abs(Float64(cos(atan(Float64(Float64(Float64(-sin(t)) / ew) * Float64(eh / cos(t))))) * t_1));
      	else
      		tmp = abs(Float64(Float64(-eh) * Float64(sin(atan(Float64(Float64(Float64(-eh) * sin(t)) / t_1))) * sin(t))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	t_1 = cos(t) * ew;
      	tmp = 0.0;
      	if ((ew <= -1.05e-119) || ~((ew <= 1.55e-86)))
      		tmp = abs((cos(atan(((-sin(t) / ew) * (eh / cos(t))))) * t_1));
      	else
      		tmp = abs((-eh * (sin(atan(((-eh * sin(t)) / t_1))) * sin(t))));
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, If[Or[LessEqual[ew, -1.05e-119], N[Not[LessEqual[ew, 1.55e-86]], $MachinePrecision]], N[Abs[N[(N[Cos[N[ArcTan[N[(N[((-N[Sin[t], $MachinePrecision]) / ew), $MachinePrecision] * N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], N[Abs[N[((-eh) * N[(N[Sin[N[ArcTan[N[(N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \cos t \cdot ew\\
      \mathbf{if}\;ew \leq -1.05 \cdot 10^{-119} \lor \neg \left(ew \leq 1.55 \cdot 10^{-86}\right):\\
      \;\;\;\;\left|\cos \tan^{-1} \left(\frac{-\sin t}{ew} \cdot \frac{eh}{\cos t}\right) \cdot t\_1\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|\left(-eh\right) \cdot \left(\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{t\_1}\right) \cdot \sin t\right)\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if ew < -1.05e-119 or 1.54999999999999994e-86 < 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. Add Preprocessing
        3. Taylor expanded in eh around 0

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

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

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

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

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

        if -1.05e-119 < ew < 1.54999999999999994e-86

        1. Initial program 99.7%

          \[\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
        3. Taylor expanded in eh around 0

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

            \[\leadsto \left|\color{blue}{-1 \cdot \left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)\right) - \left(\mathsf{neg}\left(ew\right)\right) \cdot \left(\cos t \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)}\right| \]
          2. distribute-lft-neg-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 8: 71.2% accurate, 1.6× speedup?

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

        1. Initial program 99.6%

          \[\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
        3. Taylor expanded in eh around 0

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

            \[\leadsto \left|\color{blue}{-1 \cdot \left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)\right) - \left(\mathsf{neg}\left(ew\right)\right) \cdot \left(\cos t \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)\right)}\right| \]
          2. distribute-lft-neg-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -2.80000000000000012e-18 < t < 14

        1. Initial program 100.0%

          \[\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
        3. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

      Alternative 9: 50.1% accurate, 7.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -1.75 \cdot 10^{-174}:\\ \;\;\;\;-ew\\ \mathbf{elif}\;ew \leq 4.6 \cdot 10^{-93}:\\ \;\;\;\;eh \cdot \sin t\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \cos t\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (if (<= ew -1.75e-174)
         (- ew)
         (if (<= ew 4.6e-93) (* eh (sin t)) (* ew (cos t)))))
      double code(double eh, double ew, double t) {
      	double tmp;
      	if (ew <= -1.75e-174) {
      		tmp = -ew;
      	} else if (ew <= 4.6e-93) {
      		tmp = eh * sin(t);
      	} else {
      		tmp = ew * cos(t);
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(eh, ew, t)
      use fmin_fmax_functions
          real(8), intent (in) :: eh
          real(8), intent (in) :: ew
          real(8), intent (in) :: t
          real(8) :: tmp
          if (ew <= (-1.75d-174)) then
              tmp = -ew
          else if (ew <= 4.6d-93) then
              tmp = eh * sin(t)
          else
              tmp = ew * cos(t)
          end if
          code = tmp
      end function
      
      public static double code(double eh, double ew, double t) {
      	double tmp;
      	if (ew <= -1.75e-174) {
      		tmp = -ew;
      	} else if (ew <= 4.6e-93) {
      		tmp = eh * Math.sin(t);
      	} else {
      		tmp = ew * Math.cos(t);
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	tmp = 0
      	if ew <= -1.75e-174:
      		tmp = -ew
      	elif ew <= 4.6e-93:
      		tmp = eh * math.sin(t)
      	else:
      		tmp = ew * math.cos(t)
      	return tmp
      
      function code(eh, ew, t)
      	tmp = 0.0
      	if (ew <= -1.75e-174)
      		tmp = Float64(-ew);
      	elseif (ew <= 4.6e-93)
      		tmp = Float64(eh * sin(t));
      	else
      		tmp = Float64(ew * cos(t));
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	tmp = 0.0;
      	if (ew <= -1.75e-174)
      		tmp = -ew;
      	elseif (ew <= 4.6e-93)
      		tmp = eh * sin(t);
      	else
      		tmp = ew * cos(t);
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := If[LessEqual[ew, -1.75e-174], (-ew), If[LessEqual[ew, 4.6e-93], N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision], N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;ew \leq -1.75 \cdot 10^{-174}:\\
      \;\;\;\;-ew\\
      
      \mathbf{elif}\;ew \leq 4.6 \cdot 10^{-93}:\\
      \;\;\;\;eh \cdot \sin t\\
      
      \mathbf{else}:\\
      \;\;\;\;ew \cdot \cos t\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if ew < -1.74999999999999994e-174

        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
        3. Applied rewrites56.3%

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

          \[\leadsto \color{blue}{ew \cdot {\left(\sqrt{-1}\right)}^{2}} \]
        5. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot ew} \]
          2. unpow2N/A

            \[\leadsto \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot ew \]
          3. rem-square-sqrtN/A

            \[\leadsto \color{blue}{-1} \cdot ew \]
          4. mul-1-negN/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(ew\right)} \]
          5. lower-neg.f6455.3

            \[\leadsto \color{blue}{-ew} \]
        6. Applied rewrites55.3%

          \[\leadsto \color{blue}{-ew} \]

        if -1.74999999999999994e-174 < ew < 4.5999999999999996e-93

        1. Initial program 99.7%

          \[\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
        3. Applied rewrites25.5%

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

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

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

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

            \[\leadsto \frac{\color{blue}{2 \cdot \left({eh}^{2} \cdot {\sin t}^{2}\right)}}{ew \cdot \left(\cos t \cdot \left(e^{\log \left(2 \cdot \frac{eh \cdot \sin t}{\cos t}\right) + -1 \cdot \log ew} + \frac{1}{e^{\log \left(2 \cdot \frac{eh \cdot \sin t}{\cos t}\right) + -1 \cdot \log ew}}\right)\right)} \]
          4. *-commutativeN/A

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

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

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

            \[\leadsto \frac{2 \cdot \left({\color{blue}{\sin t}}^{2} \cdot {eh}^{2}\right)}{ew \cdot \left(\cos t \cdot \left(e^{\log \left(2 \cdot \frac{eh \cdot \sin t}{\cos t}\right) + -1 \cdot \log ew} + \frac{1}{e^{\log \left(2 \cdot \frac{eh \cdot \sin t}{\cos t}\right) + -1 \cdot \log ew}}\right)\right)} \]
          8. unpow2N/A

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

            \[\leadsto \frac{2 \cdot \left({\sin t}^{2} \cdot \color{blue}{\left(eh \cdot eh\right)}\right)}{ew \cdot \left(\cos t \cdot \left(e^{\log \left(2 \cdot \frac{eh \cdot \sin t}{\cos t}\right) + -1 \cdot \log ew} + \frac{1}{e^{\log \left(2 \cdot \frac{eh \cdot \sin t}{\cos t}\right) + -1 \cdot \log ew}}\right)\right)} \]
        6. Applied rewrites16.9%

          \[\leadsto \color{blue}{\frac{2 \cdot \left({\sin t}^{2} \cdot \left(eh \cdot eh\right)\right)}{\left(\cos t \cdot ew\right) \cdot \mathsf{fma}\left({ew}^{-1}, \frac{2 \cdot \left(\sin t \cdot eh\right)}{\cos t}, \frac{1}{{ew}^{-1} \cdot \frac{2 \cdot \left(\sin t \cdot eh\right)}{\cos t}}\right)}} \]
        7. Taylor expanded in eh around inf

          \[\leadsto eh \cdot \color{blue}{\sin t} \]
        8. Step-by-step derivation
          1. Applied rewrites36.7%

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

          if 4.5999999999999996e-93 < ew

          1. Initial program 99.7%

            \[\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
          3. Applied rewrites65.7%

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

            \[\leadsto \color{blue}{ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right)} \]
          5. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \color{blue}{{t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) + ew} \]
            2. *-commutativeN/A

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

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot ew} - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right), {t}^{2}, ew\right) \]
            6. distribute-rgt-outN/A

              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew} \cdot \left(-1 + \frac{1}{2}\right)}, {t}^{2}, ew\right) \]
            7. metadata-evalN/A

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

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

              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew}} \cdot \frac{-1}{2}, {t}^{2}, ew\right) \]
            10. unpow2N/A

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

              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{\color{blue}{eh \cdot eh}}{ew} \cdot \frac{-1}{2}, {t}^{2}, ew\right) \]
            12. unpow2N/A

              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{eh \cdot eh}{ew} \cdot \frac{-1}{2}, \color{blue}{t \cdot t}, ew\right) \]
            13. lower-*.f6439.5

              \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, \color{blue}{t \cdot t}, ew\right) \]
          6. Applied rewrites39.5%

            \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, t \cdot t, ew\right)} \]
          7. Taylor expanded in eh around 0

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

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

              \[\leadsto ew \cdot \color{blue}{\cos t} \]
          9. Applied rewrites60.9%

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

        Alternative 10: 43.5% accurate, 7.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -1.75 \cdot 10^{-174}:\\ \;\;\;\;-ew\\ \mathbf{elif}\;ew \leq 3.5 \cdot 10^{-90}:\\ \;\;\;\;eh \cdot \sin t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5 \cdot \frac{eh \cdot eh}{ew}, t \cdot t, ew\right)\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (if (<= ew -1.75e-174)
           (- ew)
           (if (<= ew 3.5e-90)
             (* eh (sin t))
             (fma (* 0.5 (/ (* eh eh) ew)) (* t t) ew))))
        double code(double eh, double ew, double t) {
        	double tmp;
        	if (ew <= -1.75e-174) {
        		tmp = -ew;
        	} else if (ew <= 3.5e-90) {
        		tmp = eh * sin(t);
        	} else {
        		tmp = fma((0.5 * ((eh * eh) / ew)), (t * t), ew);
        	}
        	return tmp;
        }
        
        function code(eh, ew, t)
        	tmp = 0.0
        	if (ew <= -1.75e-174)
        		tmp = Float64(-ew);
        	elseif (ew <= 3.5e-90)
        		tmp = Float64(eh * sin(t));
        	else
        		tmp = fma(Float64(0.5 * Float64(Float64(eh * eh) / ew)), Float64(t * t), ew);
        	end
        	return tmp
        end
        
        code[eh_, ew_, t_] := If[LessEqual[ew, -1.75e-174], (-ew), If[LessEqual[ew, 3.5e-90], N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(N[(eh * eh), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + ew), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;ew \leq -1.75 \cdot 10^{-174}:\\
        \;\;\;\;-ew\\
        
        \mathbf{elif}\;ew \leq 3.5 \cdot 10^{-90}:\\
        \;\;\;\;eh \cdot \sin t\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(0.5 \cdot \frac{eh \cdot eh}{ew}, t \cdot t, ew\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if ew < -1.74999999999999994e-174

          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
          3. Applied rewrites56.3%

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

            \[\leadsto \color{blue}{ew \cdot {\left(\sqrt{-1}\right)}^{2}} \]
          5. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot ew} \]
            2. unpow2N/A

              \[\leadsto \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot ew \]
            3. rem-square-sqrtN/A

              \[\leadsto \color{blue}{-1} \cdot ew \]
            4. mul-1-negN/A

              \[\leadsto \color{blue}{\mathsf{neg}\left(ew\right)} \]
            5. lower-neg.f6455.3

              \[\leadsto \color{blue}{-ew} \]
          6. Applied rewrites55.3%

            \[\leadsto \color{blue}{-ew} \]

          if -1.74999999999999994e-174 < ew < 3.4999999999999999e-90

          1. Initial program 99.7%

            \[\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
          3. Applied rewrites25.5%

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

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

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

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

              \[\leadsto \frac{\color{blue}{2 \cdot \left({eh}^{2} \cdot {\sin t}^{2}\right)}}{ew \cdot \left(\cos t \cdot \left(e^{\log \left(2 \cdot \frac{eh \cdot \sin t}{\cos t}\right) + -1 \cdot \log ew} + \frac{1}{e^{\log \left(2 \cdot \frac{eh \cdot \sin t}{\cos t}\right) + -1 \cdot \log ew}}\right)\right)} \]
            4. *-commutativeN/A

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

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

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

              \[\leadsto \frac{2 \cdot \left({\color{blue}{\sin t}}^{2} \cdot {eh}^{2}\right)}{ew \cdot \left(\cos t \cdot \left(e^{\log \left(2 \cdot \frac{eh \cdot \sin t}{\cos t}\right) + -1 \cdot \log ew} + \frac{1}{e^{\log \left(2 \cdot \frac{eh \cdot \sin t}{\cos t}\right) + -1 \cdot \log ew}}\right)\right)} \]
            8. unpow2N/A

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

              \[\leadsto \frac{2 \cdot \left({\sin t}^{2} \cdot \color{blue}{\left(eh \cdot eh\right)}\right)}{ew \cdot \left(\cos t \cdot \left(e^{\log \left(2 \cdot \frac{eh \cdot \sin t}{\cos t}\right) + -1 \cdot \log ew} + \frac{1}{e^{\log \left(2 \cdot \frac{eh \cdot \sin t}{\cos t}\right) + -1 \cdot \log ew}}\right)\right)} \]
          6. Applied rewrites16.9%

            \[\leadsto \color{blue}{\frac{2 \cdot \left({\sin t}^{2} \cdot \left(eh \cdot eh\right)\right)}{\left(\cos t \cdot ew\right) \cdot \mathsf{fma}\left({ew}^{-1}, \frac{2 \cdot \left(\sin t \cdot eh\right)}{\cos t}, \frac{1}{{ew}^{-1} \cdot \frac{2 \cdot \left(\sin t \cdot eh\right)}{\cos t}}\right)}} \]
          7. Taylor expanded in eh around inf

            \[\leadsto eh \cdot \color{blue}{\sin t} \]
          8. Step-by-step derivation
            1. Applied rewrites36.7%

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

            if 3.4999999999999999e-90 < ew

            1. Initial program 99.7%

              \[\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
            3. Applied rewrites65.7%

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

              \[\leadsto \color{blue}{ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right)} \]
            5. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{{t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) + ew} \]
              2. *-commutativeN/A

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

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot ew} - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right), {t}^{2}, ew\right) \]
              6. distribute-rgt-outN/A

                \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew} \cdot \left(-1 + \frac{1}{2}\right)}, {t}^{2}, ew\right) \]
              7. metadata-evalN/A

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

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

                \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew}} \cdot \frac{-1}{2}, {t}^{2}, ew\right) \]
              10. unpow2N/A

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

                \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{\color{blue}{eh \cdot eh}}{ew} \cdot \frac{-1}{2}, {t}^{2}, ew\right) \]
              12. unpow2N/A

                \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{eh \cdot eh}{ew} \cdot \frac{-1}{2}, \color{blue}{t \cdot t}, ew\right) \]
              13. lower-*.f6439.5

                \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, \color{blue}{t \cdot t}, ew\right) \]
            6. Applied rewrites39.5%

              \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, t \cdot t, ew\right)} \]
            7. Taylor expanded in eh around inf

              \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot \frac{{eh}^{2}}{ew}, \color{blue}{t} \cdot t, ew\right) \]
            8. Step-by-step derivation
              1. Applied rewrites44.6%

                \[\leadsto \mathsf{fma}\left(0.5 \cdot \frac{eh \cdot eh}{ew}, \color{blue}{t} \cdot t, ew\right) \]
            9. Recombined 3 regimes into one program.
            10. Add Preprocessing

            Alternative 11: 38.5% accurate, 22.1× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq 2.35 \cdot 10^{-296}:\\ \;\;\;\;-ew\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5 \cdot \frac{eh \cdot eh}{ew}, t \cdot t, ew\right)\\ \end{array} \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (if (<= ew 2.35e-296) (- ew) (fma (* 0.5 (/ (* eh eh) ew)) (* t t) ew)))
            double code(double eh, double ew, double t) {
            	double tmp;
            	if (ew <= 2.35e-296) {
            		tmp = -ew;
            	} else {
            		tmp = fma((0.5 * ((eh * eh) / ew)), (t * t), ew);
            	}
            	return tmp;
            }
            
            function code(eh, ew, t)
            	tmp = 0.0
            	if (ew <= 2.35e-296)
            		tmp = Float64(-ew);
            	else
            		tmp = fma(Float64(0.5 * Float64(Float64(eh * eh) / ew)), Float64(t * t), ew);
            	end
            	return tmp
            end
            
            code[eh_, ew_, t_] := If[LessEqual[ew, 2.35e-296], (-ew), N[(N[(0.5 * N[(N[(eh * eh), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + ew), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;ew \leq 2.35 \cdot 10^{-296}:\\
            \;\;\;\;-ew\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(0.5 \cdot \frac{eh \cdot eh}{ew}, t \cdot t, ew\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if ew < 2.35e-296

              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
              3. Applied rewrites51.5%

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

                \[\leadsto \color{blue}{ew \cdot {\left(\sqrt{-1}\right)}^{2}} \]
              5. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot ew} \]
                2. unpow2N/A

                  \[\leadsto \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot ew \]
                3. rem-square-sqrtN/A

                  \[\leadsto \color{blue}{-1} \cdot ew \]
                4. mul-1-negN/A

                  \[\leadsto \color{blue}{\mathsf{neg}\left(ew\right)} \]
                5. lower-neg.f6441.9

                  \[\leadsto \color{blue}{-ew} \]
              6. Applied rewrites41.9%

                \[\leadsto \color{blue}{-ew} \]

              if 2.35e-296 < ew

              1. Initial program 99.7%

                \[\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
              3. Applied rewrites55.1%

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

                \[\leadsto \color{blue}{ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right)} \]
              5. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \color{blue}{{t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) + ew} \]
                2. *-commutativeN/A

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

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

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

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot ew} - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right), {t}^{2}, ew\right) \]
                6. distribute-rgt-outN/A

                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew} \cdot \left(-1 + \frac{1}{2}\right)}, {t}^{2}, ew\right) \]
                7. metadata-evalN/A

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

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

                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew}} \cdot \frac{-1}{2}, {t}^{2}, ew\right) \]
                10. unpow2N/A

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

                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{\color{blue}{eh \cdot eh}}{ew} \cdot \frac{-1}{2}, {t}^{2}, ew\right) \]
                12. unpow2N/A

                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{eh \cdot eh}{ew} \cdot \frac{-1}{2}, \color{blue}{t \cdot t}, ew\right) \]
                13. lower-*.f6432.0

                  \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, \color{blue}{t \cdot t}, ew\right) \]
              6. Applied rewrites32.0%

                \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, t \cdot t, ew\right)} \]
              7. Taylor expanded in eh around inf

                \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot \frac{{eh}^{2}}{ew}, \color{blue}{t} \cdot t, ew\right) \]
              8. Step-by-step derivation
                1. Applied rewrites35.9%

                  \[\leadsto \mathsf{fma}\left(0.5 \cdot \frac{eh \cdot eh}{ew}, \color{blue}{t} \cdot t, ew\right) \]
              9. Recombined 2 regimes into one program.
              10. Add Preprocessing

              Alternative 12: 38.6% accurate, 37.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq 5.2 \cdot 10^{-237}:\\ \;\;\;\;-ew\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot ew, t \cdot t, ew\right)\\ \end{array} \end{array} \]
              (FPCore (eh ew t)
               :precision binary64
               (if (<= ew 5.2e-237) (- ew) (fma (* -0.5 ew) (* t t) ew)))
              double code(double eh, double ew, double t) {
              	double tmp;
              	if (ew <= 5.2e-237) {
              		tmp = -ew;
              	} else {
              		tmp = fma((-0.5 * ew), (t * t), ew);
              	}
              	return tmp;
              }
              
              function code(eh, ew, t)
              	tmp = 0.0
              	if (ew <= 5.2e-237)
              		tmp = Float64(-ew);
              	else
              		tmp = fma(Float64(-0.5 * ew), Float64(t * t), ew);
              	end
              	return tmp
              end
              
              code[eh_, ew_, t_] := If[LessEqual[ew, 5.2e-237], (-ew), N[(N[(-0.5 * ew), $MachinePrecision] * N[(t * t), $MachinePrecision] + ew), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;ew \leq 5.2 \cdot 10^{-237}:\\
              \;\;\;\;-ew\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(-0.5 \cdot ew, t \cdot t, ew\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if ew < 5.2000000000000005e-237

                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
                3. Applied rewrites49.4%

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

                  \[\leadsto \color{blue}{ew \cdot {\left(\sqrt{-1}\right)}^{2}} \]
                5. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot ew} \]
                  2. unpow2N/A

                    \[\leadsto \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot ew \]
                  3. rem-square-sqrtN/A

                    \[\leadsto \color{blue}{-1} \cdot ew \]
                  4. mul-1-negN/A

                    \[\leadsto \color{blue}{\mathsf{neg}\left(ew\right)} \]
                  5. lower-neg.f6439.2

                    \[\leadsto \color{blue}{-ew} \]
                6. Applied rewrites39.2%

                  \[\leadsto \color{blue}{-ew} \]

                if 5.2000000000000005e-237 < ew

                1. Initial program 99.7%

                  \[\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
                3. Applied rewrites58.9%

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

                  \[\leadsto \color{blue}{ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right)} \]
                5. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \color{blue}{{t}^{2} \cdot \left(\frac{-1}{2} \cdot ew - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right)\right) + ew} \]
                  2. *-commutativeN/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot ew} - \left(-1 \cdot \frac{{eh}^{2}}{ew} + \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}\right), {t}^{2}, ew\right) \]
                  6. distribute-rgt-outN/A

                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew} \cdot \left(-1 + \frac{1}{2}\right)}, {t}^{2}, ew\right) \]
                  7. metadata-evalN/A

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \color{blue}{\frac{{eh}^{2}}{ew}} \cdot \frac{-1}{2}, {t}^{2}, ew\right) \]
                  10. unpow2N/A

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

                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{\color{blue}{eh \cdot eh}}{ew} \cdot \frac{-1}{2}, {t}^{2}, ew\right) \]
                  12. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{eh \cdot eh}{ew} \cdot \frac{-1}{2}, \color{blue}{t \cdot t}, ew\right) \]
                  13. lower-*.f6434.5

                    \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, \color{blue}{t \cdot t}, ew\right) \]
                6. Applied rewrites34.5%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot ew - \frac{eh \cdot eh}{ew} \cdot -0.5, t \cdot t, ew\right)} \]
                7. Taylor expanded in eh around 0

                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot ew, \color{blue}{t} \cdot t, ew\right) \]
                8. Step-by-step derivation
                  1. Applied rewrites36.2%

                    \[\leadsto \mathsf{fma}\left(-0.5 \cdot ew, \color{blue}{t} \cdot t, ew\right) \]
                9. Recombined 2 regimes into one program.
                10. Add Preprocessing

                Alternative 13: 21.7% accurate, 287.3× speedup?

                \[\begin{array}{l} \\ -ew \end{array} \]
                (FPCore (eh ew t) :precision binary64 (- ew))
                double code(double eh, double ew, double t) {
                	return -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
                end function
                
                public static double code(double eh, double ew, double t) {
                	return -ew;
                }
                
                def code(eh, ew, t):
                	return -ew
                
                function code(eh, ew, t)
                	return Float64(-ew)
                end
                
                function tmp = code(eh, ew, t)
                	tmp = -ew;
                end
                
                code[eh_, ew_, t_] := (-ew)
                
                \begin{array}{l}
                
                \\
                -ew
                \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
                3. Applied rewrites36.8%

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

                  \[\leadsto \color{blue}{ew \cdot {\left(\sqrt{-1}\right)}^{2}} \]
                5. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot ew} \]
                  2. unpow2N/A

                    \[\leadsto \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot ew \]
                  3. rem-square-sqrtN/A

                    \[\leadsto \color{blue}{-1} \cdot ew \]
                  4. mul-1-negN/A

                    \[\leadsto \color{blue}{\mathsf{neg}\left(ew\right)} \]
                  5. lower-neg.f6422.4

                    \[\leadsto \color{blue}{-ew} \]
                6. Applied rewrites22.4%

                  \[\leadsto \color{blue}{-ew} \]
                7. Add Preprocessing

                Reproduce

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