Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 18.3s
Alternatives: 6
Speedup: 1.0×

Specification

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\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) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
    5. lower-*.f6499.8

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

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

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

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

Alternative 2: 99.0% accurate, 1.2× speedup?

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

\\
\left|\mathsf{fma}\left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right), eh, \left(\cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot ew\right) \cdot \sin t\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|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
    2. lift-/.f64N/A

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

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\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) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
    5. lower-*.f6499.8

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

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

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

    \[\leadsto \left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot \cos t, eh, \left(\cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) \cdot ew\right) \cdot \sin t\right)\right| \]
  7. Step-by-step derivation
    1. lower-*.f6499.4

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

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

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

Alternative 3: 76.1% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{t}\right)\\ t_2 := \sin t \cdot ew\\ t_3 := \tan^{-1} \left(\frac{\frac{eh}{\sin t}}{ew} \cdot \cos t\right)\\ t_4 := \left|\left(\cos t \cdot eh\right) \cdot \sin t\_3\right|\\ t_5 := \left|t\_2 \cdot \cos t\_3\right|\\ \mathbf{if}\;t \leq -2.3 \cdot 10^{+127}:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;t \leq -2.22 \cdot 10^{+55}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;t \leq 2700000000:\\ \;\;\;\;\left|\sin t\_1 \cdot \mathsf{fma}\left(-0.5 \cdot eh, t \cdot t, eh\right) + \cos t\_1 \cdot t\_2\right|\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{+160}:\\ \;\;\;\;t\_4\\ \mathbf{else}:\\ \;\;\;\;t\_5\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (/ eh ew) t)))
        (t_2 (* (sin t) ew))
        (t_3 (atan (* (/ (/ eh (sin t)) ew) (cos t))))
        (t_4 (fabs (* (* (cos t) eh) (sin t_3))))
        (t_5 (fabs (* t_2 (cos t_3)))))
   (if (<= t -2.3e+127)
     t_5
     (if (<= t -2.22e+55)
       t_4
       (if (<= t 2700000000.0)
         (fabs
          (+ (* (sin t_1) (fma (* -0.5 eh) (* t t) eh)) (* (cos t_1) t_2)))
         (if (<= t 6.2e+160) t_4 t_5))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((eh / ew) / t));
	double t_2 = sin(t) * ew;
	double t_3 = atan((((eh / sin(t)) / ew) * cos(t)));
	double t_4 = fabs(((cos(t) * eh) * sin(t_3)));
	double t_5 = fabs((t_2 * cos(t_3)));
	double tmp;
	if (t <= -2.3e+127) {
		tmp = t_5;
	} else if (t <= -2.22e+55) {
		tmp = t_4;
	} else if (t <= 2700000000.0) {
		tmp = fabs(((sin(t_1) * fma((-0.5 * eh), (t * t), eh)) + (cos(t_1) * t_2)));
	} else if (t <= 6.2e+160) {
		tmp = t_4;
	} else {
		tmp = t_5;
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(eh / ew) / t))
	t_2 = Float64(sin(t) * ew)
	t_3 = atan(Float64(Float64(Float64(eh / sin(t)) / ew) * cos(t)))
	t_4 = abs(Float64(Float64(cos(t) * eh) * sin(t_3)))
	t_5 = abs(Float64(t_2 * cos(t_3)))
	tmp = 0.0
	if (t <= -2.3e+127)
		tmp = t_5;
	elseif (t <= -2.22e+55)
		tmp = t_4;
	elseif (t <= 2700000000.0)
		tmp = abs(Float64(Float64(sin(t_1) * fma(Float64(-0.5 * eh), Float64(t * t), eh)) + Float64(cos(t_1) * t_2)));
	elseif (t <= 6.2e+160)
		tmp = t_4;
	else
		tmp = t_5;
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$3 = N[ArcTan[N[(N[(N[(eh / N[Sin[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[Abs[N[(t$95$2 * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -2.3e+127], t$95$5, If[LessEqual[t, -2.22e+55], t$95$4, If[LessEqual[t, 2700000000.0], N[Abs[N[(N[(N[Sin[t$95$1], $MachinePrecision] * N[(N[(-0.5 * eh), $MachinePrecision] * N[(t * t), $MachinePrecision] + eh), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t$95$1], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 6.2e+160], t$95$4, t$95$5]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{t}\right)\\
t_2 := \sin t \cdot ew\\
t_3 := \tan^{-1} \left(\frac{\frac{eh}{\sin t}}{ew} \cdot \cos t\right)\\
t_4 := \left|\left(\cos t \cdot eh\right) \cdot \sin t\_3\right|\\
t_5 := \left|t\_2 \cdot \cos t\_3\right|\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{+127}:\\
\;\;\;\;t\_5\\

\mathbf{elif}\;t \leq -2.22 \cdot 10^{+55}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t \leq 2700000000:\\
\;\;\;\;\left|\sin t\_1 \cdot \mathsf{fma}\left(-0.5 \cdot eh, t \cdot t, eh\right) + \cos t\_1 \cdot t\_2\right|\\

\mathbf{elif}\;t \leq 6.2 \cdot 10^{+160}:\\
\;\;\;\;t\_4\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.3000000000000002e127 or 6.1999999999999996e160 < t

    1. Initial program 99.5%

      \[\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. Applied rewrites61.6%

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

    if -2.3000000000000002e127 < t < -2.2200000000000001e55 or 2.7e9 < t < 6.1999999999999996e160

    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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

    if -2.2200000000000001e55 < t < 2.7e9

    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-*.f6497.8

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

      \[\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. 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) + \mathsf{fma}\left(\frac{-1}{2} \cdot eh, t \cdot t, eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
    7. 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) + \mathsf{fma}\left(\frac{-1}{2} \cdot eh, t \cdot t, eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{\frac{eh}{ew}}{t}\right)}\right| \]
      2. lower-/.f64N/A

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

        \[\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, t \cdot t, eh\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\frac{eh}{ew}}}{t}\right)\right| \]
    8. Applied rewrites97.8%

      \[\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, t \cdot t, eh\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{\frac{eh}{ew}}{t}\right)}\right| \]
    9. Taylor expanded in t around 0

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.3 \cdot 10^{+127}:\\ \;\;\;\;\left|\left(\sin t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{\sin t}}{ew} \cdot \cos t\right)\right|\\ \mathbf{elif}\;t \leq -2.22 \cdot 10^{+55}:\\ \;\;\;\;\left|\left(\cos t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\sin t}}{ew} \cdot \cos t\right)\right|\\ \mathbf{elif}\;t \leq 2700000000:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{t}\right) \cdot \mathsf{fma}\left(-0.5 \cdot eh, t \cdot t, eh\right) + \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{t}\right) \cdot \left(\sin t \cdot ew\right)\right|\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{+160}:\\ \;\;\;\;\left|\left(\cos t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{\sin t}}{ew} \cdot \cos t\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(\sin t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{\sin t}}{ew} \cdot \cos t\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.1% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\frac{eh}{\sin t}}{ew} \cdot \cos t\right)\\ t_2 := \left|\left(\cos t \cdot eh\right) \cdot \sin t\_1\right|\\ \mathbf{if}\;eh \leq -4.2 \cdot 10^{-35}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;eh \leq 6.5 \cdot 10^{-15}:\\ \;\;\;\;\left|\left(\sin t \cdot ew\right) \cdot \cos t\_1\right|\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (* (/ (/ eh (sin t)) ew) (cos t))))
        (t_2 (fabs (* (* (cos t) eh) (sin t_1)))))
   (if (<= eh -4.2e-35)
     t_2
     (if (<= eh 6.5e-15) (fabs (* (* (sin t) ew) (cos t_1))) t_2))))
double code(double eh, double ew, double t) {
	double t_1 = atan((((eh / sin(t)) / ew) * cos(t)));
	double t_2 = fabs(((cos(t) * eh) * sin(t_1)));
	double tmp;
	if (eh <= -4.2e-35) {
		tmp = t_2;
	} else if (eh <= 6.5e-15) {
		tmp = fabs(((sin(t) * ew) * cos(t_1)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = atan((((eh / sin(t)) / ew) * cos(t)))
    t_2 = abs(((cos(t) * eh) * sin(t_1)))
    if (eh <= (-4.2d-35)) then
        tmp = t_2
    else if (eh <= 6.5d-15) then
        tmp = abs(((sin(t) * ew) * cos(t_1)))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan((((eh / Math.sin(t)) / ew) * Math.cos(t)));
	double t_2 = Math.abs(((Math.cos(t) * eh) * Math.sin(t_1)));
	double tmp;
	if (eh <= -4.2e-35) {
		tmp = t_2;
	} else if (eh <= 6.5e-15) {
		tmp = Math.abs(((Math.sin(t) * ew) * Math.cos(t_1)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.atan((((eh / math.sin(t)) / ew) * math.cos(t)))
	t_2 = math.fabs(((math.cos(t) * eh) * math.sin(t_1)))
	tmp = 0
	if eh <= -4.2e-35:
		tmp = t_2
	elif eh <= 6.5e-15:
		tmp = math.fabs(((math.sin(t) * ew) * math.cos(t_1)))
	else:
		tmp = t_2
	return tmp
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(Float64(eh / sin(t)) / ew) * cos(t)))
	t_2 = abs(Float64(Float64(cos(t) * eh) * sin(t_1)))
	tmp = 0.0
	if (eh <= -4.2e-35)
		tmp = t_2;
	elseif (eh <= 6.5e-15)
		tmp = abs(Float64(Float64(sin(t) * ew) * cos(t_1)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = atan((((eh / sin(t)) / ew) * cos(t)));
	t_2 = abs(((cos(t) * eh) * sin(t_1)));
	tmp = 0.0;
	if (eh <= -4.2e-35)
		tmp = t_2;
	elseif (eh <= 6.5e-15)
		tmp = abs(((sin(t) * ew) * cos(t_1)));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(N[(eh / N[Sin[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -4.2e-35], t$95$2, If[LessEqual[eh, 6.5e-15], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}

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

\mathbf{elif}\;eh \leq 6.5 \cdot 10^{-15}:\\
\;\;\;\;\left|\left(\sin t \cdot ew\right) \cdot \cos t\_1\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -4.2e-35 or 6.49999999999999991e-15 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2e-35 < eh < 6.49999999999999991e-15

    1. Initial program 99.8%

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

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

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

Alternative 5: 62.0% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\left(\sin t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{\sin t}}{ew} \cdot \cos t\right)\right|\\ \mathbf{if}\;t \leq -0.0048:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-73}:\\ \;\;\;\;\left|-eh\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1
         (fabs
          (* (* (sin t) ew) (cos (atan (* (/ (/ eh (sin t)) ew) (cos t))))))))
   (if (<= t -0.0048) t_1 (if (<= t 2.8e-73) (fabs (- eh)) t_1))))
double code(double eh, double ew, double t) {
	double t_1 = fabs(((sin(t) * ew) * cos(atan((((eh / sin(t)) / ew) * cos(t))))));
	double tmp;
	if (t <= -0.0048) {
		tmp = t_1;
	} else if (t <= 2.8e-73) {
		tmp = fabs(-eh);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = abs(((sin(t) * ew) * cos(atan((((eh / sin(t)) / ew) * cos(t))))))
    if (t <= (-0.0048d0)) then
        tmp = t_1
    else if (t <= 2.8d-73) then
        tmp = abs(-eh)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.abs(((Math.sin(t) * ew) * Math.cos(Math.atan((((eh / Math.sin(t)) / ew) * Math.cos(t))))));
	double tmp;
	if (t <= -0.0048) {
		tmp = t_1;
	} else if (t <= 2.8e-73) {
		tmp = Math.abs(-eh);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.fabs(((math.sin(t) * ew) * math.cos(math.atan((((eh / math.sin(t)) / ew) * math.cos(t))))))
	tmp = 0
	if t <= -0.0048:
		tmp = t_1
	elif t <= 2.8e-73:
		tmp = math.fabs(-eh)
	else:
		tmp = t_1
	return tmp
function code(eh, ew, t)
	t_1 = abs(Float64(Float64(sin(t) * ew) * cos(atan(Float64(Float64(Float64(eh / sin(t)) / ew) * cos(t))))))
	tmp = 0.0
	if (t <= -0.0048)
		tmp = t_1;
	elseif (t <= 2.8e-73)
		tmp = abs(Float64(-eh));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = abs(((sin(t) * ew) * cos(atan((((eh / sin(t)) / ew) * cos(t))))));
	tmp = 0.0;
	if (t <= -0.0048)
		tmp = t_1;
	elseif (t <= 2.8e-73)
		tmp = abs(-eh);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(N[(eh / N[Sin[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -0.0048], t$95$1, If[LessEqual[t, 2.8e-73], N[Abs[(-eh)], $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 2.8 \cdot 10^{-73}:\\
\;\;\;\;\left|-eh\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.00479999999999999958 or 2.80000000000000012e-73 < 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 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. Applied rewrites53.0%

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

    if -0.00479999999999999958 < t < 2.80000000000000012e-73

    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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|-1 \cdot \color{blue}{eh}\right| \]
        3. Step-by-step derivation
          1. Applied rewrites78.7%

            \[\leadsto \left|-eh\right| \]
        4. Recombined 2 regimes into one program.
        5. Final simplification65.1%

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

        Alternative 6: 42.5% accurate, 174.0× speedup?

        \[\begin{array}{l} \\ \left|-eh\right| \end{array} \]
        (FPCore (eh ew t) :precision binary64 (fabs (- eh)))
        double code(double eh, double ew, double t) {
        	return fabs(-eh);
        }
        
        real(8) function code(eh, ew, t)
            real(8), intent (in) :: eh
            real(8), intent (in) :: ew
            real(8), intent (in) :: t
            code = abs(-eh)
        end function
        
        public static double code(double eh, double ew, double t) {
        	return Math.abs(-eh);
        }
        
        def code(eh, ew, t):
        	return math.fabs(-eh)
        
        function code(eh, ew, t)
        	return abs(Float64(-eh))
        end
        
        function tmp = code(eh, ew, t)
        	tmp = abs(-eh);
        end
        
        code[eh_, ew_, t_] := N[Abs[(-eh)], $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        \left|-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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left|-1 \cdot \color{blue}{eh}\right| \]
            3. Step-by-step derivation
              1. Applied rewrites46.2%

                \[\leadsto \left|-eh\right| \]
              2. Add Preprocessing

              Reproduce

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