Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 15.3s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 97.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{\tan t}}{ew}\\
t_2 := \sinh^{-1} t\_1\\
\mathbf{if}\;eh \leq -1.2 \cdot 10^{-80} \lor \neg \left(eh \leq 7.8 \cdot 10^{-108}\right):\\
\;\;\;\;\left|\left(\mathsf{fma}\left(\tanh t\_2, \frac{\cos t}{ew}, \frac{\sin t}{eh} \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{t}\right)\right) \cdot ew\right) \cdot eh\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{\sin t \cdot ew + eh \cdot \left(\cos t \cdot t\_1\right)}{\cosh t\_2}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.2e-80 or 7.79999999999999989e-108 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        if -1.2e-80 < eh < 7.79999999999999989e-108

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 3: 90.3% accurate, 1.1× speedup?

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

        1. Initial program 99.8%

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

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

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

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

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

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

        if -5.05000000000000008e-57 < ew < 1.49999999999999992e-199

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 88.0% accurate, 1.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\frac{eh}{\tan t}}{ew}\\ \mathbf{if}\;eh \leq -7.8 \cdot 10^{-29} \lor \neg \left(eh \leq 0.000108\right):\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\sin t \cdot ew + eh \cdot \left(\cos t \cdot t\_1\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 -7.8e-29) (not (<= eh 0.000108)))
           (fabs (* (sin (atan (* (/ (cos t) ew) (/ eh (sin t))))) (* (cos t) eh)))
           (fabs (/ (+ (* (sin t) ew) (* eh (* (cos t) t_1))) (cosh (asinh t_1)))))))
      double code(double eh, double ew, double t) {
      	double t_1 = (eh / tan(t)) / ew;
      	double tmp;
      	if ((eh <= -7.8e-29) || !(eh <= 0.000108)) {
      		tmp = fabs((sin(atan(((cos(t) / ew) * (eh / sin(t))))) * (cos(t) * eh)));
      	} else {
      		tmp = fabs((((sin(t) * ew) + (eh * (cos(t) * t_1))) / cosh(asinh(t_1))));
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	t_1 = (eh / math.tan(t)) / ew
      	tmp = 0
      	if (eh <= -7.8e-29) or not (eh <= 0.000108):
      		tmp = math.fabs((math.sin(math.atan(((math.cos(t) / ew) * (eh / math.sin(t))))) * (math.cos(t) * eh)))
      	else:
      		tmp = math.fabs((((math.sin(t) * ew) + (eh * (math.cos(t) * t_1))) / math.cosh(math.asinh(t_1))))
      	return tmp
      
      function code(eh, ew, t)
      	t_1 = Float64(Float64(eh / tan(t)) / ew)
      	tmp = 0.0
      	if ((eh <= -7.8e-29) || !(eh <= 0.000108))
      		tmp = abs(Float64(sin(atan(Float64(Float64(cos(t) / ew) * Float64(eh / sin(t))))) * Float64(cos(t) * eh)));
      	else
      		tmp = abs(Float64(Float64(Float64(sin(t) * ew) + Float64(eh * Float64(cos(t) * t_1))) / cosh(asinh(t_1))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	t_1 = (eh / tan(t)) / ew;
      	tmp = 0.0;
      	if ((eh <= -7.8e-29) || ~((eh <= 0.000108)))
      		tmp = abs((sin(atan(((cos(t) / ew) * (eh / sin(t))))) * (cos(t) * eh)));
      	else
      		tmp = abs((((sin(t) * ew) + (eh * (cos(t) * t_1))) / cosh(asinh(t_1))));
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]}, If[Or[LessEqual[eh, -7.8e-29], N[Not[LessEqual[eh, 0.000108]], $MachinePrecision]], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Cos[t], $MachinePrecision] / ew), $MachinePrecision] * N[(eh / N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision] + N[(eh * N[(N[Cos[t], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{\frac{eh}{\tan t}}{ew}\\
      \mathbf{if}\;eh \leq -7.8 \cdot 10^{-29} \lor \neg \left(eh \leq 0.000108\right):\\
      \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot \left(\cos t \cdot eh\right)\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|\frac{\sin t \cdot ew + eh \cdot \left(\cos t \cdot t\_1\right)}{\cosh \sinh^{-1} t\_1}\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if eh < -7.7999999999999995e-29 or 1.08e-4 < eh

        1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -7.7999999999999995e-29 < eh < 1.08e-4

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 5: 88.0% accurate, 1.3× speedup?

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

        1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -7.7999999999999995e-29 < eh < 1.08e-4

        1. Initial program 99.8%

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

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

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

      Alternative 6: 83.8% accurate, 1.4× speedup?

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

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -4.7e-55 < eh < 4.1999999999999996e22

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 7: 75.6% accurate, 1.6× speedup?

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

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.45e-55 < eh < 4.49999999999999994e-18

        1. Initial program 99.8%

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

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

          \[\leadsto \left|{\color{blue}{\left(\sqrt{ew \cdot \sin t}\right)}}^{2}\right| \]
        5. Step-by-step derivation
          1. lower-sqrt.f64N/A

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

            \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
          3. lower-*.f64N/A

            \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
          4. lower-sin.f6440.8

            \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t} \cdot ew}\right)}^{2}\right| \]
        6. Applied rewrites40.8%

          \[\leadsto \left|{\color{blue}{\left(\sqrt{\sin t \cdot ew}\right)}}^{2}\right| \]
        7. Taylor expanded in eh around 0

          \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
        8. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
          2. lower-*.f64N/A

            \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
          3. lower-sin.f6470.1

            \[\leadsto \left|\color{blue}{\sin t} \cdot ew\right| \]
        9. Applied rewrites70.1%

          \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
      3. Recombined 2 regimes into one program.
      4. Final simplification80.6%

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

      Alternative 8: 68.7% accurate, 2.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \cos t \cdot eh\\ t_2 := \left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{t}\right) \cdot t\_1\right|\\ \mathbf{if}\;eh \leq -4.7 \cdot 10^{-55}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;eh \leq 4.5 \cdot 10^{-18}:\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{elif}\;eh \leq 4.8 \cdot 10^{+182}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{eh}{ew} \cdot -0.3333333333333333, t \cdot t, \frac{eh}{ew}\right)}{t}\right) \cdot t\_1\right|\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* (cos t) eh)) (t_2 (fabs (* (sin (atan (/ (/ eh ew) t))) t_1))))
         (if (<= eh -4.7e-55)
           t_2
           (if (<= eh 4.5e-18)
             (fabs (* (sin t) ew))
             (if (<= eh 4.8e+182)
               (fabs
                (*
                 (sin
                  (atan
                   (/ (fma (* (/ eh ew) -0.3333333333333333) (* t t) (/ eh ew)) t)))
                 t_1))
               t_2)))))
      double code(double eh, double ew, double t) {
      	double t_1 = cos(t) * eh;
      	double t_2 = fabs((sin(atan(((eh / ew) / t))) * t_1));
      	double tmp;
      	if (eh <= -4.7e-55) {
      		tmp = t_2;
      	} else if (eh <= 4.5e-18) {
      		tmp = fabs((sin(t) * ew));
      	} else if (eh <= 4.8e+182) {
      		tmp = fabs((sin(atan((fma(((eh / ew) * -0.3333333333333333), (t * t), (eh / ew)) / t))) * t_1));
      	} else {
      		tmp = t_2;
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	t_1 = Float64(cos(t) * eh)
      	t_2 = abs(Float64(sin(atan(Float64(Float64(eh / ew) / t))) * t_1))
      	tmp = 0.0
      	if (eh <= -4.7e-55)
      		tmp = t_2;
      	elseif (eh <= 4.5e-18)
      		tmp = abs(Float64(sin(t) * ew));
      	elseif (eh <= 4.8e+182)
      		tmp = abs(Float64(sin(atan(Float64(fma(Float64(Float64(eh / ew) * -0.3333333333333333), Float64(t * t), Float64(eh / ew)) / t))) * t_1));
      	else
      		tmp = t_2;
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -4.7e-55], t$95$2, If[LessEqual[eh, 4.5e-18], N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 4.8e+182], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(N[(eh / ew), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] * N[(t * t), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], t$95$2]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \cos t \cdot eh\\
      t_2 := \left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{t}\right) \cdot t\_1\right|\\
      \mathbf{if}\;eh \leq -4.7 \cdot 10^{-55}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;eh \leq 4.5 \cdot 10^{-18}:\\
      \;\;\;\;\left|\sin t \cdot ew\right|\\
      
      \mathbf{elif}\;eh \leq 4.8 \cdot 10^{+182}:\\
      \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{eh}{ew} \cdot -0.3333333333333333, t \cdot t, \frac{eh}{ew}\right)}{t}\right) \cdot t\_1\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_2\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if eh < -4.7e-55 or 4.80000000000000019e182 < eh

        1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -4.7e-55 < eh < 4.49999999999999994e-18

          1. Initial program 99.8%

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

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

            \[\leadsto \left|{\color{blue}{\left(\sqrt{ew \cdot \sin t}\right)}}^{2}\right| \]
          5. Step-by-step derivation
            1. lower-sqrt.f64N/A

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

              \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
            3. lower-*.f64N/A

              \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
            4. lower-sin.f6440.8

              \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t} \cdot ew}\right)}^{2}\right| \]
          6. Applied rewrites40.8%

            \[\leadsto \left|{\color{blue}{\left(\sqrt{\sin t \cdot ew}\right)}}^{2}\right| \]
          7. Taylor expanded in eh around 0

            \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
          8. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
            2. lower-*.f64N/A

              \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
            3. lower-sin.f6470.1

              \[\leadsto \left|\color{blue}{\sin t} \cdot ew\right| \]
          9. Applied rewrites70.1%

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

          if 4.49999999999999994e-18 < eh < 4.80000000000000019e182

          1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{eh}{ew} \cdot -0.3333333333333333, t \cdot t, \frac{eh}{ew}\right)}{t}\right) \cdot \left(\cos t \cdot eh\right)\right| \]
          8. Recombined 3 regimes into one program.
          9. Add Preprocessing

          Alternative 9: 68.8% accurate, 2.5× speedup?

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

            1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -4.7e-55 < eh < 9.99999999999999999e-15

              1. Initial program 99.8%

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

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

                \[\leadsto \left|{\color{blue}{\left(\sqrt{ew \cdot \sin t}\right)}}^{2}\right| \]
              5. Step-by-step derivation
                1. lower-sqrt.f64N/A

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

                  \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
                3. lower-*.f64N/A

                  \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
                4. lower-sin.f6440.8

                  \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t} \cdot ew}\right)}^{2}\right| \]
              6. Applied rewrites40.8%

                \[\leadsto \left|{\color{blue}{\left(\sqrt{\sin t \cdot ew}\right)}}^{2}\right| \]
              7. Taylor expanded in eh around 0

                \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
              8. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                2. lower-*.f64N/A

                  \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                3. lower-sin.f6470.1

                  \[\leadsto \left|\color{blue}{\sin t} \cdot ew\right| \]
              9. Applied rewrites70.1%

                \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
            8. Recombined 2 regimes into one program.
            9. Final simplification72.5%

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

            Alternative 10: 61.2% accurate, 2.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{-48} \lor \neg \left(t \leq 8 \cdot 10^{-6}\right):\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.5, t \cdot t, 1\right)}{ew} \cdot \frac{eh}{\mathsf{fma}\left(\mathsf{fma}\left(-0.0001984126984126984, t \cdot t, 0.008333333333333333\right) \cdot \left(t \cdot t\right) - 0.16666666666666666, t \cdot t, 1\right) \cdot t}\right) \cdot eh\right|\\ \end{array} \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (if (or (<= t -7.5e-48) (not (<= t 8e-6)))
               (fabs (* (sin t) ew))
               (fabs
                (*
                 (sin
                  (atan
                   (*
                    (/ (fma -0.5 (* t t) 1.0) ew)
                    (/
                     eh
                     (*
                      (fma
                       (-
                        (*
                         (fma -0.0001984126984126984 (* t t) 0.008333333333333333)
                         (* t t))
                        0.16666666666666666)
                       (* t t)
                       1.0)
                      t)))))
                 eh))))
            double code(double eh, double ew, double t) {
            	double tmp;
            	if ((t <= -7.5e-48) || !(t <= 8e-6)) {
            		tmp = fabs((sin(t) * ew));
            	} else {
            		tmp = fabs((sin(atan(((fma(-0.5, (t * t), 1.0) / ew) * (eh / (fma(((fma(-0.0001984126984126984, (t * t), 0.008333333333333333) * (t * t)) - 0.16666666666666666), (t * t), 1.0) * t))))) * eh));
            	}
            	return tmp;
            }
            
            function code(eh, ew, t)
            	tmp = 0.0
            	if ((t <= -7.5e-48) || !(t <= 8e-6))
            		tmp = abs(Float64(sin(t) * ew));
            	else
            		tmp = abs(Float64(sin(atan(Float64(Float64(fma(-0.5, Float64(t * t), 1.0) / ew) * Float64(eh / Float64(fma(Float64(Float64(fma(-0.0001984126984126984, Float64(t * t), 0.008333333333333333) * Float64(t * t)) - 0.16666666666666666), Float64(t * t), 1.0) * t))))) * eh));
            	end
            	return tmp
            end
            
            code[eh_, ew_, t_] := If[Or[LessEqual[t, -7.5e-48], N[Not[LessEqual[t, 8e-6]], $MachinePrecision]], N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(-0.5 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] / ew), $MachinePrecision] * N[(eh / N[(N[(N[(N[(N[(-0.0001984126984126984 * N[(t * t), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] * N[(t * t), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;t \leq -7.5 \cdot 10^{-48} \lor \neg \left(t \leq 8 \cdot 10^{-6}\right):\\
            \;\;\;\;\left|\sin t \cdot ew\right|\\
            
            \mathbf{else}:\\
            \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.5, t \cdot t, 1\right)}{ew} \cdot \frac{eh}{\mathsf{fma}\left(\mathsf{fma}\left(-0.0001984126984126984, t \cdot t, 0.008333333333333333\right) \cdot \left(t \cdot t\right) - 0.16666666666666666, t \cdot t, 1\right) \cdot t}\right) \cdot eh\right|\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if t < -7.50000000000000042e-48 or 7.99999999999999964e-6 < t

              1. Initial program 99.6%

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

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

                \[\leadsto \left|{\color{blue}{\left(\sqrt{ew \cdot \sin t}\right)}}^{2}\right| \]
              5. Step-by-step derivation
                1. lower-sqrt.f64N/A

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

                  \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
                3. lower-*.f64N/A

                  \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
                4. lower-sin.f6422.9

                  \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t} \cdot ew}\right)}^{2}\right| \]
              6. Applied rewrites22.9%

                \[\leadsto \left|{\color{blue}{\left(\sqrt{\sin t \cdot ew}\right)}}^{2}\right| \]
              7. Taylor expanded in eh around 0

                \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
              8. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                2. lower-*.f64N/A

                  \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                3. lower-sin.f6445.9

                  \[\leadsto \left|\color{blue}{\sin t} \cdot ew\right| \]
              9. Applied rewrites45.9%

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

              if -7.50000000000000042e-48 < t < 7.99999999999999964e-6

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.5, t \cdot t, 1\right)}{ew} \cdot \frac{eh}{\mathsf{fma}\left(\mathsf{fma}\left(-0.0001984126984126984, t \cdot t, 0.008333333333333333\right) \cdot \left(t \cdot t\right) - 0.16666666666666666, t \cdot t, 1\right) \cdot t}\right) \cdot eh\right| \]
                4. Recombined 2 regimes into one program.
                5. Final simplification59.7%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{-48} \lor \neg \left(t \leq 8 \cdot 10^{-6}\right):\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.5, t \cdot t, 1\right)}{ew} \cdot \frac{eh}{\mathsf{fma}\left(\mathsf{fma}\left(-0.0001984126984126984, t \cdot t, 0.008333333333333333\right) \cdot \left(t \cdot t\right) - 0.16666666666666666, t \cdot t, 1\right) \cdot t}\right) \cdot eh\right|\\ \end{array} \]
                6. Add Preprocessing

                Alternative 11: 61.2% accurate, 3.6× speedup?

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

                  1. Initial program 99.6%

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

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

                    \[\leadsto \left|{\color{blue}{\left(\sqrt{ew \cdot \sin t}\right)}}^{2}\right| \]
                  5. Step-by-step derivation
                    1. lower-sqrt.f64N/A

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

                      \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
                    3. lower-*.f64N/A

                      \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
                    4. lower-sin.f6422.9

                      \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t} \cdot ew}\right)}^{2}\right| \]
                  6. Applied rewrites22.9%

                    \[\leadsto \left|{\color{blue}{\left(\sqrt{\sin t \cdot ew}\right)}}^{2}\right| \]
                  7. Taylor expanded in eh around 0

                    \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                  8. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                    2. lower-*.f64N/A

                      \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                    3. lower-sin.f6445.9

                      \[\leadsto \left|\color{blue}{\sin t} \cdot ew\right| \]
                  9. Applied rewrites45.9%

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

                  if -7.50000000000000042e-48 < t < 7.99999999999999964e-6

                  1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 12: 41.5% accurate, 8.1× speedup?

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

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

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

                    \[\leadsto \left|{\color{blue}{\left(\sqrt{ew \cdot \sin t}\right)}}^{2}\right| \]
                  5. Step-by-step derivation
                    1. lower-sqrt.f64N/A

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

                      \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
                    3. lower-*.f64N/A

                      \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
                    4. lower-sin.f6420.4

                      \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t} \cdot ew}\right)}^{2}\right| \]
                  6. Applied rewrites20.4%

                    \[\leadsto \left|{\color{blue}{\left(\sqrt{\sin t \cdot ew}\right)}}^{2}\right| \]
                  7. Taylor expanded in eh around 0

                    \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                  8. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                    2. lower-*.f64N/A

                      \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                    3. lower-sin.f6437.0

                      \[\leadsto \left|\color{blue}{\sin t} \cdot ew\right| \]
                  9. Applied rewrites37.0%

                    \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                  10. Add Preprocessing

                  Alternative 13: 18.8% accurate, 108.8× speedup?

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

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

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

                    \[\leadsto \left|{\color{blue}{\left(\sqrt{ew \cdot \sin t}\right)}}^{2}\right| \]
                  5. Step-by-step derivation
                    1. lower-sqrt.f64N/A

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

                      \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
                    3. lower-*.f64N/A

                      \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t \cdot ew}}\right)}^{2}\right| \]
                    4. lower-sin.f6420.4

                      \[\leadsto \left|{\left(\sqrt{\color{blue}{\sin t} \cdot ew}\right)}^{2}\right| \]
                  6. Applied rewrites20.4%

                    \[\leadsto \left|{\color{blue}{\left(\sqrt{\sin t \cdot ew}\right)}}^{2}\right| \]
                  7. Taylor expanded in eh around 0

                    \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                  8. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                    2. lower-*.f64N/A

                      \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                    3. lower-sin.f6437.0

                      \[\leadsto \left|\color{blue}{\sin t} \cdot ew\right| \]
                  9. Applied rewrites37.0%

                    \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                  10. Taylor expanded in t around 0

                    \[\leadsto \left|ew \cdot \color{blue}{t}\right| \]
                  11. Step-by-step derivation
                    1. Applied rewrites17.2%

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

                    Reproduce

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