Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 19.9s
Alternatives: 6
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))));
}
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(eh, \cos t \cdot \sin t\_1, ew \cdot \left(\cos t\_1 \cdot \sin t\right)\right)\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ eh (* ew (tan t))))))
   (fabs (fma eh (* (cos t) (sin t_1)) (* ew (* (cos t_1) (sin t)))))))
double code(double eh, double ew, double t) {
	double t_1 = atan((eh / (ew * tan(t))));
	return fabs(fma(eh, (cos(t) * sin(t_1)), (ew * (cos(t_1) * sin(t)))));
}
function code(eh, ew, t)
	t_1 = atan(Float64(eh / Float64(ew * tan(t))))
	return abs(fma(eh, Float64(cos(t) * sin(t_1)), Float64(ew * Float64(cos(t_1) * sin(t)))))
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[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(ew * N[(N[Cos[t$95$1], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $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(eh, \cos t \cdot \sin t\_1, ew \cdot \left(\cos t\_1 \cdot \sin t\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. Taylor expanded in ew around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.5% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (fabs.f64 (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))) < 4e51

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e51 < (fabs.f64 (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))))

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(\color{blue}{1}, eh \cdot \cos t, \frac{ew \cdot \sin t}{\sqrt{\mathsf{fma}\left(eh, \frac{eh}{t \cdot \left(ew \cdot \left(t \cdot ew\right)\right)}, 1\right)}}\right)\right| \]
    11. Step-by-step derivation
      1. Simplified99.2%

        \[\leadsto \left|\mathsf{fma}\left(\color{blue}{1}, eh \cdot \cos t, \frac{ew \cdot \sin t}{\sqrt{\mathsf{fma}\left(eh, \frac{eh}{t \cdot \left(ew \cdot \left(t \cdot ew\right)\right)}, 1\right)}}\right)\right| \]
    12. Recombined 2 regimes into one program.
    13. Final simplification98.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \leq 4 \cdot 10^{+51}:\\ \;\;\;\;\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.3333333333333333, \frac{eh \cdot \left(t \cdot t\right)}{ew}, \frac{eh}{ew}\right)}{t}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(1, eh \cdot \cos t, \frac{ew \cdot \sin t}{\sqrt{\mathsf{fma}\left(eh, \frac{eh}{t \cdot \left(ew \cdot \left(t \cdot ew\right)\right)}, 1\right)}}\right)\right|\\ \end{array} \]
    14. Add Preprocessing

    Alternative 3: 99.1% accurate, 1.1× speedup?

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

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

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

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

    Alternative 4: 96.5% accurate, 3.2× speedup?

    \[\begin{array}{l} \\ \left|\mathsf{fma}\left(-1, eh \cdot \cos t, \frac{ew \cdot \sin t}{\sqrt{\mathsf{fma}\left(eh, \frac{eh}{t \cdot \left(ew \cdot \left(t \cdot ew\right)\right)}, 1\right)}}\right)\right| \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (fabs
      (fma
       -1.0
       (* eh (cos t))
       (/ (* ew (sin t)) (sqrt (fma eh (/ eh (* t (* ew (* t ew)))) 1.0))))))
    double code(double eh, double ew, double t) {
    	return fabs(fma(-1.0, (eh * cos(t)), ((ew * sin(t)) / sqrt(fma(eh, (eh / (t * (ew * (t * ew)))), 1.0)))));
    }
    
    function code(eh, ew, t)
    	return abs(fma(-1.0, Float64(eh * cos(t)), Float64(Float64(ew * sin(t)) / sqrt(fma(eh, Float64(eh / Float64(t * Float64(ew * Float64(t * ew)))), 1.0)))))
    end
    
    code[eh_, ew_, t_] := N[Abs[N[(-1.0 * N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] + N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(eh * N[(eh / N[(t * N[(ew * N[(t * ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \left|\mathsf{fma}\left(-1, eh \cdot \cos t, \frac{ew \cdot \sin t}{\sqrt{\mathsf{fma}\left(eh, \frac{eh}{t \cdot \left(ew \cdot \left(t \cdot ew\right)\right)}, 1\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. 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)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(\color{blue}{-1}, eh \cdot \cos t, \frac{ew \cdot \sin t}{\sqrt{\mathsf{fma}\left(eh, \frac{eh}{t \cdot \left(ew \cdot \left(t \cdot ew\right)\right)}, 1\right)}}\right)\right| \]
    11. Step-by-step derivation
      1. Simplified96.9%

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

      Alternative 5: 61.5% accurate, 7.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|ew \cdot \sin t\right|\\ \mathbf{if}\;t \leq -1.9 \cdot 10^{-54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-42}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (fabs (* ew (sin t)))))
         (if (<= t -1.9e-54) t_1 (if (<= t 3.8e-42) (fabs eh) t_1))))
      double code(double eh, double ew, double t) {
      	double t_1 = fabs((ew * sin(t)));
      	double tmp;
      	if (t <= -1.9e-54) {
      		tmp = t_1;
      	} else if (t <= 3.8e-42) {
      		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((ew * sin(t)))
          if (t <= (-1.9d-54)) then
              tmp = t_1
          else if (t <= 3.8d-42) 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((ew * Math.sin(t)));
      	double tmp;
      	if (t <= -1.9e-54) {
      		tmp = t_1;
      	} else if (t <= 3.8e-42) {
      		tmp = Math.abs(eh);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	t_1 = math.fabs((ew * math.sin(t)))
      	tmp = 0
      	if t <= -1.9e-54:
      		tmp = t_1
      	elif t <= 3.8e-42:
      		tmp = math.fabs(eh)
      	else:
      		tmp = t_1
      	return tmp
      
      function code(eh, ew, t)
      	t_1 = abs(Float64(ew * sin(t)))
      	tmp = 0.0
      	if (t <= -1.9e-54)
      		tmp = t_1;
      	elseif (t <= 3.8e-42)
      		tmp = abs(eh);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	t_1 = abs((ew * sin(t)));
      	tmp = 0.0;
      	if (t <= -1.9e-54)
      		tmp = t_1;
      	elseif (t <= 3.8e-42)
      		tmp = abs(eh);
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.9e-54], t$95$1, If[LessEqual[t, 3.8e-42], N[Abs[eh], $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left|ew \cdot \sin t\right|\\
      \mathbf{if}\;t \leq -1.9 \cdot 10^{-54}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t \leq 3.8 \cdot 10^{-42}:\\
      \;\;\;\;\left|eh\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -1.9000000000000001e-54 or 3.80000000000000017e-42 < t

        1. Initial program 99.6%

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

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

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

            \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
          2. lower-sin.f6456.5

            \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
        6. Simplified56.5%

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

        if -1.9000000000000001e-54 < t < 3.80000000000000017e-42

        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}{ew \cdot \tan t}\right)}\right| \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{eh}{ew \cdot \tan t} \cdot \frac{eh}{ew \cdot \tan t}}}}\right| \]
          5. div-invN/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|eh \cdot \left(\frac{eh}{ew \cdot \tan t} \cdot \frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \color{blue}{\frac{\frac{eh}{ew}}{\tan t}}}}\right)\right| \]
        7. Applied egg-rr14.9%

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

          \[\leadsto \left|\color{blue}{-1 \cdot eh}\right| \]
        9. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh\right)}\right| \]
          2. lower-neg.f6482.5

            \[\leadsto \left|\color{blue}{-eh}\right| \]
        10. Simplified82.5%

          \[\leadsto \left|\color{blue}{-eh}\right| \]
        11. Step-by-step derivation
          1. fabs-negN/A

            \[\leadsto \color{blue}{\left|eh\right|} \]
          2. lower-fabs.f6482.5

            \[\leadsto \color{blue}{\left|eh\right|} \]
        12. Applied egg-rr82.5%

          \[\leadsto \color{blue}{\left|eh\right|} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 6: 41.9% accurate, 290.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(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}{ew \cdot \tan t}\right)}\right| \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|eh \cdot \color{blue}{\frac{\frac{eh}{ew \cdot \tan t}}{\sqrt{1 + \frac{eh}{ew \cdot \tan t} \cdot \frac{eh}{ew \cdot \tan t}}}}\right| \]
        5. div-invN/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|eh \cdot \left(\frac{eh}{ew \cdot \tan t} \cdot \frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \color{blue}{\frac{\frac{eh}{ew}}{\tan t}}}}\right)\right| \]
      7. Applied egg-rr9.3%

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

        \[\leadsto \left|\color{blue}{-1 \cdot eh}\right| \]
      9. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh\right)}\right| \]
        2. lower-neg.f6444.5

          \[\leadsto \left|\color{blue}{-eh}\right| \]
      10. Simplified44.5%

        \[\leadsto \left|\color{blue}{-eh}\right| \]
      11. Step-by-step derivation
        1. fabs-negN/A

          \[\leadsto \color{blue}{\left|eh\right|} \]
        2. lower-fabs.f6444.5

          \[\leadsto \color{blue}{\left|eh\right|} \]
      12. Applied egg-rr44.5%

        \[\leadsto \color{blue}{\left|eh\right|} \]
      13. Add Preprocessing

      Reproduce

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