Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 15.5s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew))))
   (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((-eh * tan(t)) / ew));
	return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(eh, ew, t)
use fmin_fmax_functions
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    t_1 = atan(((-eh * tan(t)) / ew))
    code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
	return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t):
	t_1 = math.atan(((-eh * math.tan(t)) / ew))
	return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
	return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1))))
end
function tmp = code(eh, ew, t)
	t_1 = atan(((-eh * tan(t)) / ew));
	tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 54.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
t_2 := \left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+153}:\\
\;\;\;\;\left|\cos \tan^{-1} \left(\frac{\sin t \cdot eh}{\mathsf{fma}\left(\left(t \cdot t\right) \cdot ew, 0.5, -ew\right)}\right) \cdot ew\right|\\

\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-273}:\\
\;\;\;\;{\left({\left({\cos t}^{2} \cdot \left(ew \cdot ew\right)\right)}^{0.25}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\cos t \cdot ew\\


\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))))) < -2e153

    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}{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. *-commutativeN/A

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

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

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

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

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

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

        if -2e153 < (-.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))))) < -4e-273

        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 rewrites0.0%

          \[\leadsto \color{blue}{{\left(\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)}}\right)}^{2}} \]
        4. Step-by-step derivation
          1. lift-sqrt.f64N/A

            \[\leadsto {\color{blue}{\left(\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)}}\right)}}^{2} \]
          2. pow1/2N/A

            \[\leadsto {\color{blue}{\left({\left(\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)}\right)}^{\frac{1}{2}}\right)}}^{2} \]
          3. sqr-powN/A

            \[\leadsto {\color{blue}{\left({\left(\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)}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left(\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)}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}}^{2} \]
          4. pow-prod-downN/A

            \[\leadsto {\color{blue}{\left({\left(\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 \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)}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}}^{2} \]
          5. lower-pow.f64N/A

            \[\leadsto {\color{blue}{\left({\left(\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 \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)}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}}^{2} \]
        5. Applied rewrites73.1%

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

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

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

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

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

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

            \[\leadsto {\left({\left({\cos t}^{2} \cdot \color{blue}{\left(ew \cdot ew\right)}\right)}^{\frac{1}{4}}\right)}^{2} \]
          6. lower-*.f6458.1

            \[\leadsto {\left({\left({\cos t}^{2} \cdot \color{blue}{\left(ew \cdot ew\right)}\right)}^{0.25}\right)}^{2} \]
        8. Applied rewrites58.1%

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

        if -4e-273 < (-.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 rewrites64.6%

          \[\leadsto \color{blue}{\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 \cos t} \]
        5. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\cos t \cdot ew} \]
          2. lower-*.f64N/A

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

            \[\leadsto \color{blue}{\cos t} \cdot ew \]
        6. Applied rewrites58.6%

          \[\leadsto \color{blue}{\cos t \cdot ew} \]
      4. Recombined 3 regimes into one program.
      5. Final simplification55.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 -2 \cdot 10^{+153}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\sin t \cdot eh}{\mathsf{fma}\left(\left(t \cdot t\right) \cdot ew, 0.5, -ew\right)}\right) \cdot ew\right|\\ \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^{-273}:\\ \;\;\;\;{\left({\left({\cos t}^{2} \cdot \left(ew \cdot ew\right)\right)}^{0.25}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\cos t \cdot ew\\ \end{array} \]
      6. Add Preprocessing

      Alternative 3: 51.7% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\ \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1 \leq -4 \cdot 10^{-273}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\sin t \cdot eh}{\mathsf{fma}\left(\left(t \cdot t\right) \cdot ew, 0.5, -ew\right)}\right) \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\cos t \cdot ew\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (atan (/ (* eh (tan t)) (- ew)))))
         (if (<=
              (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1)))
              -4e-273)
           (fabs
            (* (cos (atan (/ (* (sin t) eh) (fma (* (* t t) ew) 0.5 (- ew))))) ew))
           (* (cos t) ew))))
      double code(double eh, double ew, double t) {
      	double t_1 = atan(((eh * tan(t)) / -ew));
      	double tmp;
      	if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= -4e-273) {
      		tmp = fabs((cos(atan(((sin(t) * eh) / fma(((t * t) * ew), 0.5, -ew)))) * ew));
      	} else {
      		tmp = cos(t) * ew;
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	t_1 = atan(Float64(Float64(eh * tan(t)) / Float64(-ew)))
      	tmp = 0.0
      	if (Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1))) <= -4e-273)
      		tmp = abs(Float64(cos(atan(Float64(Float64(sin(t) * eh) / fma(Float64(Float64(t * t) * ew), 0.5, Float64(-ew))))) * ew));
      	else
      		tmp = Float64(cos(t) * ew);
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[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], -4e-273], N[Abs[N[(N[Cos[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] / N[(N[(N[(t * t), $MachinePrecision] * ew), $MachinePrecision] * 0.5 + (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
      \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1 \leq -4 \cdot 10^{-273}:\\
      \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\sin t \cdot eh}{\mathsf{fma}\left(\left(t \cdot t\right) \cdot ew, 0.5, -ew\right)}\right) \cdot ew\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\cos t \cdot ew\\
      
      
      \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))))) < -4e-273

        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}{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. *-commutativeN/A

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

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

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

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

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

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

            if -4e-273 < (-.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 rewrites64.6%

              \[\leadsto \color{blue}{\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 \cos t} \]
            5. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{\cos t \cdot ew} \]
              2. lower-*.f64N/A

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

                \[\leadsto \color{blue}{\cos t} \cdot ew \]
            6. Applied rewrites58.6%

              \[\leadsto \color{blue}{\cos t \cdot ew} \]
          4. Recombined 2 regimes into one program.
          5. Final simplification50.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 -4 \cdot 10^{-273}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\sin t \cdot eh}{\mathsf{fma}\left(\left(t \cdot t\right) \cdot ew, 0.5, -ew\right)}\right) \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\cos t \cdot ew\\ \end{array} \]
          6. Add Preprocessing

          Alternative 4: 51.7% accurate, 0.7× speedup?

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

            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}{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. *-commutativeN/A

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

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

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

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

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

              if -4e-273 < (-.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 rewrites64.6%

                \[\leadsto \color{blue}{\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 \cos t} \]
              5. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{\cos t \cdot ew} \]
                2. lower-*.f64N/A

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

                  \[\leadsto \color{blue}{\cos t} \cdot ew \]
              6. Applied rewrites58.6%

                \[\leadsto \color{blue}{\cos t \cdot ew} \]
            7. Recombined 2 regimes into one program.
            8. Final simplification49.9%

              \[\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 -4 \cdot 10^{-273}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right) \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\cos t \cdot ew\\ \end{array} \]
            9. Add Preprocessing

            Alternative 5: 50.3% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\ \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1 \leq -4 \cdot 10^{-273}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(\mathsf{fma}\left(-0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{-eh}{ew}\right) \cdot t\right) \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\cos t \cdot ew\\ \end{array} \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (let* ((t_1 (atan (/ (* eh (tan t)) (- ew)))))
               (if (<=
                    (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1)))
                    -4e-273)
                 (fabs
                  (*
                   (cos
                    (atan
                     (* (fma (* -0.3333333333333333 (/ eh ew)) (* t t) (/ (- eh) ew)) t)))
                   ew))
                 (* (cos t) ew))))
            double code(double eh, double ew, double t) {
            	double t_1 = atan(((eh * tan(t)) / -ew));
            	double tmp;
            	if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= -4e-273) {
            		tmp = fabs((cos(atan((fma((-0.3333333333333333 * (eh / ew)), (t * t), (-eh / ew)) * t))) * ew));
            	} else {
            		tmp = cos(t) * ew;
            	}
            	return tmp;
            }
            
            function code(eh, ew, t)
            	t_1 = atan(Float64(Float64(eh * tan(t)) / Float64(-ew)))
            	tmp = 0.0
            	if (Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1))) <= -4e-273)
            		tmp = abs(Float64(cos(atan(Float64(fma(Float64(-0.3333333333333333 * Float64(eh / ew)), Float64(t * t), Float64(Float64(-eh) / ew)) * t))) * ew));
            	else
            		tmp = Float64(cos(t) * ew);
            	end
            	return tmp
            end
            
            code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[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], -4e-273], N[Abs[N[(N[Cos[N[ArcTan[N[(N[(N[(-0.3333333333333333 * N[(eh / ew), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + N[((-eh) / ew), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
            \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1 \leq -4 \cdot 10^{-273}:\\
            \;\;\;\;\left|\cos \tan^{-1} \left(\mathsf{fma}\left(-0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{-eh}{ew}\right) \cdot t\right) \cdot ew\right|\\
            
            \mathbf{else}:\\
            \;\;\;\;\cos t \cdot ew\\
            
            
            \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))))) < -4e-273

              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}{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. *-commutativeN/A

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

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

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

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

                  \[\leadsto \left|\cos \tan^{-1} \left(\mathsf{fma}\left(-0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, -\frac{eh}{ew}\right) \cdot t\right) \cdot ew\right| \]

                if -4e-273 < (-.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 rewrites64.6%

                  \[\leadsto \color{blue}{\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 \cos t} \]
                5. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{\cos t \cdot ew} \]
                  2. lower-*.f64N/A

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

                    \[\leadsto \color{blue}{\cos t} \cdot ew \]
                6. Applied rewrites58.6%

                  \[\leadsto \color{blue}{\cos t \cdot ew} \]
              8. Recombined 2 regimes into one program.
              9. Final simplification48.5%

                \[\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 -4 \cdot 10^{-273}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(\mathsf{fma}\left(-0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{-eh}{ew}\right) \cdot t\right) \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\cos t \cdot ew\\ \end{array} \]
              10. Add Preprocessing

              Alternative 6: 43.7% accurate, 0.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\ \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1 \leq -4 \cdot 10^{-273}:\\ \;\;\;\;{\left({\left(ew \cdot ew\right)}^{0.25}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\cos t \cdot ew\\ \end{array} \end{array} \]
              (FPCore (eh ew t)
               :precision binary64
               (let* ((t_1 (atan (/ (* eh (tan t)) (- ew)))))
                 (if (<=
                      (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1)))
                      -4e-273)
                   (pow (pow (* ew ew) 0.25) 2.0)
                   (* (cos t) ew))))
              double code(double eh, double ew, double t) {
              	double t_1 = atan(((eh * tan(t)) / -ew));
              	double tmp;
              	if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= -4e-273) {
              		tmp = pow(pow((ew * ew), 0.25), 2.0);
              	} else {
              		tmp = cos(t) * ew;
              	}
              	return tmp;
              }
              
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(eh, ew, t)
              use fmin_fmax_functions
                  real(8), intent (in) :: eh
                  real(8), intent (in) :: ew
                  real(8), intent (in) :: t
                  real(8) :: t_1
                  real(8) :: tmp
                  t_1 = atan(((eh * tan(t)) / -ew))
                  if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= (-4d-273)) then
                      tmp = ((ew * ew) ** 0.25d0) ** 2.0d0
                  else
                      tmp = cos(t) * ew
                  end if
                  code = tmp
              end function
              
              public static double code(double eh, double ew, double t) {
              	double t_1 = Math.atan(((eh * Math.tan(t)) / -ew));
              	double tmp;
              	if ((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))) <= -4e-273) {
              		tmp = Math.pow(Math.pow((ew * ew), 0.25), 2.0);
              	} else {
              		tmp = Math.cos(t) * ew;
              	}
              	return tmp;
              }
              
              def code(eh, ew, t):
              	t_1 = math.atan(((eh * math.tan(t)) / -ew))
              	tmp = 0
              	if (((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))) <= -4e-273:
              		tmp = math.pow(math.pow((ew * ew), 0.25), 2.0)
              	else:
              		tmp = math.cos(t) * ew
              	return tmp
              
              function code(eh, ew, t)
              	t_1 = atan(Float64(Float64(eh * tan(t)) / Float64(-ew)))
              	tmp = 0.0
              	if (Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1))) <= -4e-273)
              		tmp = (Float64(ew * ew) ^ 0.25) ^ 2.0;
              	else
              		tmp = Float64(cos(t) * ew);
              	end
              	return tmp
              end
              
              function tmp_2 = code(eh, ew, t)
              	t_1 = atan(((eh * tan(t)) / -ew));
              	tmp = 0.0;
              	if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= -4e-273)
              		tmp = ((ew * ew) ^ 0.25) ^ 2.0;
              	else
              		tmp = cos(t) * ew;
              	end
              	tmp_2 = tmp;
              end
              
              code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[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], -4e-273], N[Power[N[Power[N[(ew * ew), $MachinePrecision], 0.25], $MachinePrecision], 2.0], $MachinePrecision], N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
              \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1 \leq -4 \cdot 10^{-273}:\\
              \;\;\;\;{\left({\left(ew \cdot ew\right)}^{0.25}\right)}^{2}\\
              
              \mathbf{else}:\\
              \;\;\;\;\cos t \cdot ew\\
              
              
              \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))))) < -4e-273

                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 rewrites0.0%

                  \[\leadsto \color{blue}{{\left(\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)}}\right)}^{2}} \]
                4. Step-by-step derivation
                  1. lift-sqrt.f64N/A

                    \[\leadsto {\color{blue}{\left(\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)}}\right)}}^{2} \]
                  2. pow1/2N/A

                    \[\leadsto {\color{blue}{\left({\left(\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)}\right)}^{\frac{1}{2}}\right)}}^{2} \]
                  3. sqr-powN/A

                    \[\leadsto {\color{blue}{\left({\left(\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)}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {\left(\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)}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}}^{2} \]
                  4. pow-prod-downN/A

                    \[\leadsto {\color{blue}{\left({\left(\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 \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)}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}}^{2} \]
                  5. lower-pow.f64N/A

                    \[\leadsto {\color{blue}{\left({\left(\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 \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)}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}}^{2} \]
                5. Applied rewrites52.9%

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

                  \[\leadsto {\left({\color{blue}{\left({ew}^{2}\right)}}^{\frac{1}{4}}\right)}^{2} \]
                7. Step-by-step derivation
                  1. unpow2N/A

                    \[\leadsto {\left({\color{blue}{\left(ew \cdot ew\right)}}^{\frac{1}{4}}\right)}^{2} \]
                  2. lower-*.f6429.6

                    \[\leadsto {\left({\color{blue}{\left(ew \cdot ew\right)}}^{0.25}\right)}^{2} \]
                8. Applied rewrites29.6%

                  \[\leadsto {\left({\color{blue}{\left(ew \cdot ew\right)}}^{0.25}\right)}^{2} \]

                if -4e-273 < (-.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 rewrites64.6%

                  \[\leadsto \color{blue}{\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 \cos t} \]
                5. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{\cos t \cdot ew} \]
                  2. lower-*.f64N/A

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

                    \[\leadsto \color{blue}{\cos t} \cdot ew \]
                6. Applied rewrites58.6%

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

                \[\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 -4 \cdot 10^{-273}:\\ \;\;\;\;{\left({\left(ew \cdot ew\right)}^{0.25}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\cos t \cdot ew\\ \end{array} \]
              5. Add Preprocessing

              Alternative 7: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

              Alternative 8: 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.f6498.9

                  \[\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 rewrites98.9%

                \[\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 simplification98.9%

                \[\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 9: 99.0% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left|\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t\right) \cdot ew - \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. associate-/l*N/A

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

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

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

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

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

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

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

              Alternative 10: 95.6% accurate, 1.3× speedup?

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

                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. Step-by-step derivation
                  1. lift-*.f64N/A

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

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

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

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

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

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

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

                    \[\leadsto \left|\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t\right) \cdot ew - \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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

                if -1.7500000000000001e43 < eh < 2.45000000000000013e76

                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 rewrites43.7%

                  \[\leadsto \color{blue}{\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. Step-by-step derivation
                  1. rem-square-sqrtN/A

                    \[\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)}}} \]
                  2. sqrt-unprodN/A

                    \[\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 \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)}}} \]
                  3. rem-sqrt-squareN/A

                    \[\leadsto \color{blue}{\left|\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)}\right|} \]
                  4. lower-fabs.f6496.3

                    \[\leadsto \color{blue}{\left|\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)}\right|} \]
                5. Applied rewrites97.5%

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

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

              Alternative 11: 94.2% accurate, 1.3× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\tan t}{ew}\\ \mathbf{if}\;eh \leq -1.75 \cdot 10^{+43} \lor \neg \left(eh \leq 2.45 \cdot 10^{+76}\right):\\ \;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{-t}{ew}\right) - \left(\cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \cos t\right) \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_1 \cdot \left(eh \cdot eh\right), \cos t \cdot 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 (<= eh -1.75e+43) (not (<= eh 2.45e+76)))
                   (fabs
                    (-
                     (* (* eh (sin t)) (sin (atan (* eh (/ (- t) ew)))))
                     (* (* (cos (atan (/ (* eh t) ew))) (cos t)) ew)))
                   (fabs
                    (/
                     (fma (sin t) (* t_1 (* eh eh)) (* (cos t) ew))
                     (cosh (asinh (* t_1 eh))))))))
              double code(double eh, double ew, double t) {
              	double t_1 = tan(t) / ew;
              	double tmp;
              	if ((eh <= -1.75e+43) || !(eh <= 2.45e+76)) {
              		tmp = fabs((((eh * sin(t)) * sin(atan((eh * (-t / ew))))) - ((cos(atan(((eh * t) / ew))) * cos(t)) * ew)));
              	} else {
              		tmp = fabs((fma(sin(t), (t_1 * (eh * eh)), (cos(t) * ew)) / cosh(asinh((t_1 * eh)))));
              	}
              	return tmp;
              }
              
              function code(eh, ew, t)
              	t_1 = Float64(tan(t) / ew)
              	tmp = 0.0
              	if ((eh <= -1.75e+43) || !(eh <= 2.45e+76))
              		tmp = abs(Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(eh * Float64(Float64(-t) / ew))))) - Float64(Float64(cos(atan(Float64(Float64(eh * t) / ew))) * cos(t)) * ew)));
              	else
              		tmp = abs(Float64(fma(sin(t), Float64(t_1 * Float64(eh * eh)), Float64(cos(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[eh, -1.75e+43], N[Not[LessEqual[eh, 2.45e+76]], $MachinePrecision]], N[Abs[N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[((-t) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Cos[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * N[(t$95$1 * N[(eh * eh), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $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}\;eh \leq -1.75 \cdot 10^{+43} \lor \neg \left(eh \leq 2.45 \cdot 10^{+76}\right):\\
              \;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{-t}{ew}\right) - \left(\cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \cos t\right) \cdot ew\right|\\
              
              \mathbf{else}:\\
              \;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_1 \cdot \left(eh \cdot eh\right), \cos t \cdot 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 eh < -1.7500000000000001e43 or 2.45000000000000013e76 < eh

                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. Step-by-step derivation
                  1. lift-*.f64N/A

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

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

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

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

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

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

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

                    \[\leadsto \left|\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t\right) \cdot ew - \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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

                if -1.7500000000000001e43 < eh < 2.45000000000000013e76

                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 rewrites96.3%

                  \[\leadsto \color{blue}{\left|\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)}\right|} \]
              3. Recombined 2 regimes into one program.
              4. Final simplification96.0%

                \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.75 \cdot 10^{+43} \lor \neg \left(eh \leq 2.45 \cdot 10^{+76}\right):\\ \;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{-t}{ew}\right) - \left(\cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \cos t\right) \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\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)}\right|\\ \end{array} \]
              5. Add Preprocessing

              Alternative 12: 90.2% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left|\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t\right) \cdot ew - \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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

              Alternative 13: 75.2% accurate, 1.6× speedup?

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

                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 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| \]
                4. Step-by-step derivation
                  1. mul-1-negN/A

                    \[\leadsto \left|\color{blue}{\mathsf{neg}\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| \]
                  2. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -6.99999999999999999e95 < eh < 4.60000000000000002e76

                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. Step-by-step derivation
                  1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 14: 61.5% accurate, 1.6× speedup?

              \[\begin{array}{l} \\ \left|\left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\sin t \cdot eh}{ew}}{\cos t}\right)\right| \end{array} \]
              (FPCore (eh ew t)
               :precision binary64
               (fabs (* (* (cos t) ew) (cos (atan (/ (/ (* (sin t) eh) ew) (cos t)))))))
              double code(double eh, double ew, double t) {
              	return fabs(((cos(t) * ew) * cos(atan((((sin(t) * eh) / ew) / cos(t))))));
              }
              
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(eh, ew, t)
              use fmin_fmax_functions
                  real(8), intent (in) :: eh
                  real(8), intent (in) :: ew
                  real(8), intent (in) :: t
                  code = abs(((cos(t) * ew) * cos(atan((((sin(t) * eh) / ew) / cos(t))))))
              end function
              
              public static double code(double eh, double ew, double t) {
              	return Math.abs(((Math.cos(t) * ew) * Math.cos(Math.atan((((Math.sin(t) * eh) / ew) / Math.cos(t))))));
              }
              
              def code(eh, ew, t):
              	return math.fabs(((math.cos(t) * ew) * math.cos(math.atan((((math.sin(t) * eh) / ew) / math.cos(t))))))
              
              function code(eh, ew, t)
              	return abs(Float64(Float64(cos(t) * ew) * cos(atan(Float64(Float64(Float64(sin(t) * eh) / ew) / cos(t))))))
              end
              
              function tmp = code(eh, ew, t)
              	tmp = abs(((cos(t) * ew) * cos(atan((((sin(t) * eh) / ew) / cos(t))))));
              end
              
              code[eh_, ew_, t_] := N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              \left|\left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\sin t \cdot eh}{ew}}{\cos t}\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. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 15: 32.0% accurate, 8.1× speedup?

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

                \[\leadsto \color{blue}{\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 \cos t} \]
              5. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{\cos t \cdot ew} \]
                2. lower-*.f64N/A

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

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

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

              Alternative 16: 23.2% accurate, 39.2× speedup?

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

                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 rewrites15.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(\frac{-1}{2} \cdot {t}^{2}\right) \cdot ew \]
                  3. Step-by-step derivation
                    1. Applied rewrites4.6%

                      \[\leadsto \left(\left(t \cdot t\right) \cdot -0.5\right) \cdot ew \]

                    if -1.64999999999999991e-305 < 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 rewrites49.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto ew \cdot \color{blue}{\left(1 + \frac{-1}{2} \cdot {t}^{2}\right)} \]
                    8. Step-by-step derivation
                      1. Applied rewrites30.0%

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

                        \[\leadsto 1 \cdot ew \]
                      3. Step-by-step derivation
                        1. Applied rewrites36.6%

                          \[\leadsto 1 \cdot ew \]
                      4. Recombined 2 regimes into one program.
                      5. Add Preprocessing

                      Alternative 17: 21.6% accurate, 143.7× speedup?

                      \[\begin{array}{l} \\ 1 \cdot ew \end{array} \]
                      (FPCore (eh ew t) :precision binary64 (* 1.0 ew))
                      double code(double eh, double ew, double t) {
                      	return 1.0 * ew;
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(eh, ew, t)
                      use fmin_fmax_functions
                          real(8), intent (in) :: eh
                          real(8), intent (in) :: ew
                          real(8), intent (in) :: t
                          code = 1.0d0 * ew
                      end function
                      
                      public static double code(double eh, double ew, double t) {
                      	return 1.0 * ew;
                      }
                      
                      def code(eh, ew, t):
                      	return 1.0 * ew
                      
                      function code(eh, ew, t)
                      	return Float64(1.0 * ew)
                      end
                      
                      function tmp = code(eh, ew, t)
                      	tmp = 1.0 * ew;
                      end
                      
                      code[eh_, ew_, t_] := N[(1.0 * ew), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      1 \cdot 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 rewrites31.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto ew \cdot \color{blue}{\left(1 + \frac{-1}{2} \cdot {t}^{2}\right)} \]
                      8. Step-by-step derivation
                        1. Applied rewrites16.0%

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

                          \[\leadsto 1 \cdot ew \]
                        3. Step-by-step derivation
                          1. Applied rewrites18.0%

                            \[\leadsto 1 \cdot ew \]
                          2. Add Preprocessing

                          Reproduce

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