Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 17.1s
Alternatives: 13
Speedup: N/A×

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

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

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Add Preprocessing
  3. 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. +-commutativeN/A

      \[\leadsto \left|\color{blue}{\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| \]
    3. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.6% accurate, 1.3× 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.9 \cdot 10^{-13} \lor \neg \left(eh \leq 4.2 \cdot 10^{+23}\right):\\ \;\;\;\;\left|\left(\tanh t\_2 \cdot \cos t\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(\cos t \cdot t\_1, eh, \sin t \cdot ew\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.9e-13) (not (<= eh 4.2e+23)))
     (fabs (* (* (tanh t_2) (cos t)) eh))
     (fabs (/ (fma (* (cos t) t_1) eh (* (sin t) ew)) (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.9e-13) || !(eh <= 4.2e+23)) {
		tmp = fabs(((tanh(t_2) * cos(t)) * eh));
	} else {
		tmp = fabs((fma((cos(t) * t_1), eh, (sin(t) * ew)) / 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.9e-13) || !(eh <= 4.2e+23))
		tmp = abs(Float64(Float64(tanh(t_2) * cos(t)) * eh));
	else
		tmp = abs(Float64(fma(Float64(cos(t) * t_1), eh, Float64(sin(t) * ew)) / 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.9e-13], N[Not[LessEqual[eh, 4.2e+23]], $MachinePrecision]], N[Abs[N[(N[(N[Tanh[t$95$2], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * eh), $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[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.9 \cdot 10^{-13} \lor \neg \left(eh \leq 4.2 \cdot 10^{+23}\right):\\
\;\;\;\;\left|\left(\tanh t\_2 \cdot \cos t\right) \cdot eh\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.9e-13 or 4.2000000000000003e23 < 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.f6489.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 rewrites89.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. Applied rewrites89.5%

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

    if -1.9e-13 < eh < 4.2000000000000003e23

    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 rewrites92.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.9 \cdot 10^{-13} \lor \neg \left(eh \leq 4.2 \cdot 10^{+23}\right):\\ \;\;\;\;\left|\left(\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \cos t\right) \cdot eh\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 3: 75.2% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq -1.95 \cdot 10^{-73} \lor \neg \left(eh \leq 2.4 \cdot 10^{-157}\right):\\ \;\;\;\;\left|\left(\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \cos t\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\cos \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{\sin t}\right) \cdot \left(\sin t \cdot ew\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= eh -1.95e-73) (not (<= eh 2.4e-157)))
   (fabs (* (* (tanh (asinh (/ (/ eh (tan t)) ew))) (cos t)) eh))
   (fabs (* (cos (atan (* (/ (cos t) ew) (/ eh (sin t))))) (* (sin t) ew)))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((eh <= -1.95e-73) || !(eh <= 2.4e-157)) {
		tmp = fabs(((tanh(asinh(((eh / tan(t)) / ew))) * cos(t)) * eh));
	} else {
		tmp = fabs((cos(atan(((cos(t) / ew) * (eh / sin(t))))) * (sin(t) * ew)));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (eh <= -1.95e-73) or not (eh <= 2.4e-157):
		tmp = math.fabs(((math.tanh(math.asinh(((eh / math.tan(t)) / ew))) * math.cos(t)) * eh))
	else:
		tmp = math.fabs((math.cos(math.atan(((math.cos(t) / ew) * (eh / math.sin(t))))) * (math.sin(t) * ew)))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((eh <= -1.95e-73) || !(eh <= 2.4e-157))
		tmp = abs(Float64(Float64(tanh(asinh(Float64(Float64(eh / tan(t)) / ew))) * cos(t)) * eh));
	else
		tmp = abs(Float64(cos(atan(Float64(Float64(cos(t) / ew) * Float64(eh / sin(t))))) * Float64(sin(t) * ew)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((eh <= -1.95e-73) || ~((eh <= 2.4e-157)))
		tmp = abs(((tanh(asinh(((eh / tan(t)) / ew))) * cos(t)) * eh));
	else
		tmp = abs((cos(atan(((cos(t) / ew) * (eh / sin(t))))) * (sin(t) * ew)));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -1.95e-73], N[Not[LessEqual[eh, 2.4e-157]], $MachinePrecision]], N[Abs[N[(N[(N[Tanh[N[ArcSinh[N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Cos[N[ArcTan[N[(N[(N[Cos[t], $MachinePrecision] / ew), $MachinePrecision] * N[(eh / N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.95 \cdot 10^{-73} \lor \neg \left(eh \leq 2.4 \cdot 10^{-157}\right):\\
\;\;\;\;\left|\left(\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \cos t\right) \cdot eh\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.94999999999999991e-73 or 2.4e-157 < 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.f6480.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 rewrites80.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| \]
    6. Applied rewrites80.1%

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

    if -1.94999999999999991e-73 < eh < 2.4e-157

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 75.2% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\\ \mathbf{if}\;eh \leq -1.95 \cdot 10^{-73} \lor \neg \left(eh \leq 2.4 \cdot 10^{-157}\right):\\ \;\;\;\;\left|\left(\tanh t\_1 \cdot \cos t\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{ew \cdot \sin t}{\cosh t\_1}\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (asinh (/ (/ eh (tan t)) ew))))
   (if (or (<= eh -1.95e-73) (not (<= eh 2.4e-157)))
     (fabs (* (* (tanh t_1) (cos t)) eh))
     (fabs (/ (* ew (sin t)) (cosh t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = asinh(((eh / tan(t)) / ew));
	double tmp;
	if ((eh <= -1.95e-73) || !(eh <= 2.4e-157)) {
		tmp = fabs(((tanh(t_1) * cos(t)) * eh));
	} else {
		tmp = fabs(((ew * sin(t)) / cosh(t_1)));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.asinh(((eh / math.tan(t)) / ew))
	tmp = 0
	if (eh <= -1.95e-73) or not (eh <= 2.4e-157):
		tmp = math.fabs(((math.tanh(t_1) * math.cos(t)) * eh))
	else:
		tmp = math.fabs(((ew * math.sin(t)) / math.cosh(t_1)))
	return tmp
function code(eh, ew, t)
	t_1 = asinh(Float64(Float64(eh / tan(t)) / ew))
	tmp = 0.0
	if ((eh <= -1.95e-73) || !(eh <= 2.4e-157))
		tmp = abs(Float64(Float64(tanh(t_1) * cos(t)) * eh));
	else
		tmp = abs(Float64(Float64(ew * sin(t)) / cosh(t_1)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = asinh(((eh / tan(t)) / ew));
	tmp = 0.0;
	if ((eh <= -1.95e-73) || ~((eh <= 2.4e-157)))
		tmp = abs(((tanh(t_1) * cos(t)) * eh));
	else
		tmp = abs(((ew * sin(t)) / cosh(t_1)));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcSinh[N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[eh, -1.95e-73], N[Not[LessEqual[eh, 2.4e-157]], $MachinePrecision]], N[Abs[N[(N[(N[Tanh[t$95$1], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] / N[Cosh[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\\
\mathbf{if}\;eh \leq -1.95 \cdot 10^{-73} \lor \neg \left(eh \leq 2.4 \cdot 10^{-157}\right):\\
\;\;\;\;\left|\left(\tanh t\_1 \cdot \cos t\right) \cdot eh\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{ew \cdot \sin t}{\cosh t\_1}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.94999999999999991e-73 or 2.4e-157 < 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.f6480.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 rewrites80.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| \]
    6. Applied rewrites80.1%

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

    if -1.94999999999999991e-73 < eh < 2.4e-157

    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) + \color{blue}{\left(eh + \frac{-1}{2} \cdot \left(eh \cdot {t}^{2}\right)\right)} \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 61.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{eh \cdot eh}{ew}\\
t_2 := \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)\\
\mathbf{if}\;eh \leq 6.6 \cdot 10^{-308} \lor \neg \left(eh \leq 4.6 \cdot 10^{-161}\right):\\
\;\;\;\;\left|\left(\tanh t\_2 \cdot \cos t\right) \cdot eh\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{\frac{\mathsf{fma}\left(t \cdot t, -0.5 \cdot t\_1 - \mathsf{fma}\left(0.3333333333333333, t\_1, -ew\right), t\_1\right)}{t}}{\cosh t\_2}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < 6.5999999999999996e-308 or 4.6e-161 < 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.f6470.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 rewrites70.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. Applied rewrites70.5%

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

    if 6.5999999999999996e-308 < eh < 4.6e-161

    1. Initial program 99.9%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Add Preprocessing
    3. 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) + \color{blue}{\left(eh + \frac{-1}{2} \cdot \left(eh \cdot {t}^{2}\right)\right)} \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\frac{\color{blue}{\frac{{t}^{2} \cdot \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} - \left(-1 \cdot ew + \frac{1}{3} \cdot \frac{{eh}^{2}}{ew}\right)\right) + \frac{{eh}^{2}}{ew}}{t}}}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}\right| \]
    9. Applied rewrites45.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq 6.6 \cdot 10^{-308} \lor \neg \left(eh \leq 4.6 \cdot 10^{-161}\right):\\ \;\;\;\;\left|\left(\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot \cos t\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\frac{\mathsf{fma}\left(t \cdot t, -0.5 \cdot \frac{eh \cdot eh}{ew} - \mathsf{fma}\left(0.3333333333333333, \frac{eh \cdot eh}{ew}, -ew\right), \frac{eh \cdot eh}{ew}\right)}{t}}{\cosh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right)}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 62.6% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.05 \cdot 10^{-7} \lor \neg \left(t \leq 1.36 \cdot 10^{-8}\right):\\ \;\;\;\;\left|\sin \tan^{-1} \left(-0.3333333333333333 \cdot \frac{eh \cdot t}{ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot eh\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= t -2.05e-7) (not (<= t 1.36e-8)))
   (fabs
    (* (sin (atan (* -0.3333333333333333 (/ (* eh t) ew)))) (* (cos t) eh)))
   (fabs (* (tanh (asinh (/ (/ eh (tan t)) ew))) eh))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -2.05e-7) || !(t <= 1.36e-8)) {
		tmp = fabs((sin(atan((-0.3333333333333333 * ((eh * t) / ew)))) * (cos(t) * eh)));
	} else {
		tmp = fabs((tanh(asinh(((eh / tan(t)) / ew))) * eh));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (t <= -2.05e-7) or not (t <= 1.36e-8):
		tmp = math.fabs((math.sin(math.atan((-0.3333333333333333 * ((eh * t) / ew)))) * (math.cos(t) * eh)))
	else:
		tmp = math.fabs((math.tanh(math.asinh(((eh / math.tan(t)) / ew))) * eh))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((t <= -2.05e-7) || !(t <= 1.36e-8))
		tmp = abs(Float64(sin(atan(Float64(-0.3333333333333333 * Float64(Float64(eh * t) / ew)))) * Float64(cos(t) * eh)));
	else
		tmp = abs(Float64(tanh(asinh(Float64(Float64(eh / tan(t)) / ew))) * eh));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((t <= -2.05e-7) || ~((t <= 1.36e-8)))
		tmp = abs((sin(atan((-0.3333333333333333 * ((eh * t) / ew)))) * (cos(t) * eh)));
	else
		tmp = abs((tanh(asinh(((eh / tan(t)) / ew))) * eh));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -2.05e-7], N[Not[LessEqual[t, 1.36e-8]], $MachinePrecision]], N[Abs[N[(N[Sin[N[ArcTan[N[(-0.3333333333333333 * N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Tanh[N[ArcSinh[N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{-7} \lor \neg \left(t \leq 1.36 \cdot 10^{-8}\right):\\
\;\;\;\;\left|\sin \tan^{-1} \left(-0.3333333333333333 \cdot \frac{eh \cdot t}{ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.05e-7 or 1.3599999999999999e-8 < 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. 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.f6455.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 rewrites55.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{{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 rewrites39.3%

        \[\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| \]
      2. Taylor expanded in t around inf

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

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

        if -2.05e-7 < t < 1.3599999999999999e-8

        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.f6472.6

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

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

            \[\leadsto \color{blue}{\left|\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot eh\right|} \]
        7. Recombined 2 regimes into one program.
        8. Final simplification64.4%

          \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.05 \cdot 10^{-7} \lor \neg \left(t \leq 1.36 \cdot 10^{-8}\right):\\ \;\;\;\;\left|\sin \tan^{-1} \left(-0.3333333333333333 \cdot \frac{eh \cdot t}{ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot eh\right|\\ \end{array} \]
        9. Add Preprocessing

        Alternative 7: 42.8% accurate, 3.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\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{{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 eh\right| \]
        7. Step-by-step derivation
          1. Applied rewrites34.4%

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

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

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

            Alternative 8: 42.8% accurate, 3.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\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{{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 eh\right| \]
            7. Step-by-step derivation
              1. Applied rewrites34.4%

                \[\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 eh\right| \]
              2. Step-by-step derivation
                1. Applied rewrites22.8%

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

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

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

                  Alternative 9: 40.9% accurate, 3.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\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{{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 eh\right| \]
                  7. Step-by-step derivation
                    1. Applied rewrites34.4%

                      \[\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 eh\right| \]
                    2. Taylor expanded in t around 0

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

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

                      Alternative 10: 22.5% accurate, 3.8× speedup?

                      \[\begin{array}{l} \\ \left|\tanh \sinh^{-1} \left(\left(-0.3333333333333333 \cdot \frac{eh}{ew}\right) \cdot t\right) \cdot eh\right| \end{array} \]
                      (FPCore (eh ew t)
                       :precision binary64
                       (fabs (* (tanh (asinh (* (* -0.3333333333333333 (/ eh ew)) t))) eh)))
                      double code(double eh, double ew, double t) {
                      	return fabs((tanh(asinh(((-0.3333333333333333 * (eh / ew)) * t))) * eh));
                      }
                      
                      def code(eh, ew, t):
                      	return math.fabs((math.tanh(math.asinh(((-0.3333333333333333 * (eh / ew)) * t))) * eh))
                      
                      function code(eh, ew, t)
                      	return abs(Float64(tanh(asinh(Float64(Float64(-0.3333333333333333 * Float64(eh / ew)) * t))) * eh))
                      end
                      
                      function tmp = code(eh, ew, t)
                      	tmp = abs((tanh(asinh(((-0.3333333333333333 * (eh / ew)) * t))) * eh));
                      end
                      
                      code[eh_, ew_, t_] := N[Abs[N[(N[Tanh[N[ArcSinh[N[(N[(-0.3333333333333333 * N[(eh / ew), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      \left|\tanh \sinh^{-1} \left(\left(-0.3333333333333333 \cdot \frac{eh}{ew}\right) \cdot t\right) \cdot eh\right|
                      \end{array}
                      
                      Derivation
                      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\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{{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 eh\right| \]
                      7. Step-by-step derivation
                        1. Applied rewrites34.4%

                          \[\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 eh\right| \]
                        2. Taylor expanded in t around inf

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

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

                              \[\leadsto \color{blue}{\left|\tanh \sinh^{-1} \left(\left(-0.3333333333333333 \cdot \frac{eh}{ew}\right) \cdot t\right) \cdot eh\right|} \]
                            2. Final simplification26.8%

                              \[\leadsto \left|\tanh \sinh^{-1} \left(\left(-0.3333333333333333 \cdot \frac{eh}{ew}\right) \cdot t\right) \cdot eh\right| \]
                            3. Add Preprocessing

                            Alternative 11: 22.5% accurate, 3.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\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{{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 eh\right| \]
                            7. Step-by-step derivation
                              1. Applied rewrites34.4%

                                \[\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 eh\right| \]
                              2. Taylor expanded in t around inf

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

                                  \[\leadsto \left|\sin \tan^{-1} \left(-0.3333333333333333 \cdot \frac{eh \cdot t}{ew}\right) \cdot eh\right| \]
                                2. Final simplification26.8%

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

                                Alternative 12: 22.4% accurate, 3.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\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{{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 eh\right| \]
                                7. Step-by-step derivation
                                  1. Applied rewrites34.4%

                                    \[\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 eh\right| \]
                                  2. Taylor expanded in t around inf

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

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

                                        \[\leadsto \left|\sin \tan^{-1} \left(-0.3333333333333333 \cdot \left(\frac{t}{ew} \cdot eh\right)\right) \cdot eh\right| \]
                                      2. Final simplification26.7%

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

                                      Alternative 13: 12.1% accurate, 3.8× speedup?

                                      \[\begin{array}{l} \\ \tanh \sinh^{-1} \left(\left(-0.3333333333333333 \cdot \frac{eh}{ew}\right) \cdot t\right) \cdot eh \end{array} \]
                                      (FPCore (eh ew t)
                                       :precision binary64
                                       (* (tanh (asinh (* (* -0.3333333333333333 (/ eh ew)) t))) eh))
                                      double code(double eh, double ew, double t) {
                                      	return tanh(asinh(((-0.3333333333333333 * (eh / ew)) * t))) * eh;
                                      }
                                      
                                      def code(eh, ew, t):
                                      	return math.tanh(math.asinh(((-0.3333333333333333 * (eh / ew)) * t))) * eh
                                      
                                      function code(eh, ew, t)
                                      	return Float64(tanh(asinh(Float64(Float64(-0.3333333333333333 * Float64(eh / ew)) * t))) * eh)
                                      end
                                      
                                      function tmp = code(eh, ew, t)
                                      	tmp = tanh(asinh(((-0.3333333333333333 * (eh / ew)) * t))) * eh;
                                      end
                                      
                                      code[eh_, ew_, t_] := N[(N[Tanh[N[ArcSinh[N[(N[(-0.3333333333333333 * N[(eh / ew), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \tanh \sinh^{-1} \left(\left(-0.3333333333333333 \cdot \frac{eh}{ew}\right) \cdot t\right) \cdot eh
                                      \end{array}
                                      
                                      Derivation
                                      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\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{{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 eh\right| \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites34.4%

                                          \[\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 eh\right| \]
                                        2. Taylor expanded in t around inf

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

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

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

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

                                            \[\leadsto \color{blue}{\tanh \sinh^{-1} \left(\left(-0.3333333333333333 \cdot \frac{eh}{ew}\right) \cdot t\right) \cdot eh} \]
                                          4. Final simplification14.0%

                                            \[\leadsto \tanh \sinh^{-1} \left(\left(-0.3333333333333333 \cdot \frac{eh}{ew}\right) \cdot t\right) \cdot eh \]
                                          5. Add Preprocessing

                                          Reproduce

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