Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 28.2s
Alternatives: 7
Speedup: N/A×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 7 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\sin t \cdot \left(\sin \tan^{-1} \left(\frac{\tan t}{\frac{ew}{eh}}\right) \cdot eh\right) + \color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}}\right| \]
  7. Applied egg-rr99.8%

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

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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.9% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left|\color{blue}{\sin t \cdot \left(\sin \tan^{-1} \left(\frac{\tan t}{\frac{ew}{eh}}\right) \cdot eh\right) + ew \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}}\right| \]
  6. Step-by-step derivation
    1. add-cbrt-cube99.6%

      \[\leadsto \left|\sin t \cdot \left(\sin \tan^{-1} \left(\frac{\tan t}{\frac{ew}{eh}}\right) \cdot eh\right) + ew \cdot \color{blue}{\sqrt[3]{\left(\frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)} \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}\right) \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}}}\right| \]
    2. pow199.6%

      \[\leadsto \left|\sin t \cdot \left(\sin \tan^{-1} \left(\frac{\tan t}{\frac{ew}{eh}}\right) \cdot eh\right) + ew \cdot \sqrt[3]{\left(\color{blue}{{\left(\frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}\right)}^{1}} \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}\right) \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}}\right| \]
    3. pow199.6%

      \[\leadsto \left|\sin t \cdot \left(\sin \tan^{-1} \left(\frac{\tan t}{\frac{ew}{eh}}\right) \cdot eh\right) + ew \cdot \sqrt[3]{\left({\left(\frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}\right)}^{1} \cdot \color{blue}{{\left(\frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}\right)}^{1}}\right) \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}}\right| \]
    4. pow-prod-up99.6%

      \[\leadsto \left|\sin t \cdot \left(\sin \tan^{-1} \left(\frac{\tan t}{\frac{ew}{eh}}\right) \cdot eh\right) + ew \cdot \sqrt[3]{\color{blue}{{\left(\frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}\right)}^{\left(1 + 1\right)}} \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}}\right| \]
    5. metadata-eval99.6%

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

    \[\leadsto \left|\sin t \cdot \left(\sin \tan^{-1} \left(\frac{\tan t}{\frac{ew}{eh}}\right) \cdot eh\right) + ew \cdot \color{blue}{\sqrt[3]{{\left(\frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}\right)}^{2} \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}}}\right| \]
  8. Step-by-step derivation
    1. unpow299.6%

      \[\leadsto \left|\sin t \cdot \left(\sin \tan^{-1} \left(\frac{\tan t}{\frac{ew}{eh}}\right) \cdot eh\right) + ew \cdot \sqrt[3]{\color{blue}{\left(\frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)} \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}\right)} \cdot \frac{\cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}}\right| \]
    2. add-cbrt-cube99.8%

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

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

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

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

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

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

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

Alternative 4: 98.3% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 75.0% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right)\right|\\ \mathbf{if}\;eh \leq -5.5 \cdot 10^{+100}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;eh \leq 2.9 \cdot 10^{+79}:\\ \;\;\;\;\left|ew \cdot \cos t\right| \cdot \left|{1}^{0.3333333333333333}\right|\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (fabs (* eh (* (sin t) (sin (atan (* eh (/ (tan t) ew)))))))))
   (if (<= eh -5.5e+100)
     t_1
     (if (<= eh 2.9e+79)
       (* (fabs (* ew (cos t))) (fabs (pow 1.0 0.3333333333333333)))
       t_1))))
double code(double eh, double ew, double t) {
	double t_1 = fabs((eh * (sin(t) * sin(atan((eh * (tan(t) / ew)))))));
	double tmp;
	if (eh <= -5.5e+100) {
		tmp = t_1;
	} else if (eh <= 2.9e+79) {
		tmp = fabs((ew * cos(t))) * fabs(pow(1.0, 0.3333333333333333));
	} 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((eh * (sin(t) * sin(atan((eh * (tan(t) / ew)))))))
    if (eh <= (-5.5d+100)) then
        tmp = t_1
    else if (eh <= 2.9d+79) then
        tmp = abs((ew * cos(t))) * abs((1.0d0 ** 0.3333333333333333d0))
    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((eh * (Math.sin(t) * Math.sin(Math.atan((eh * (Math.tan(t) / ew)))))));
	double tmp;
	if (eh <= -5.5e+100) {
		tmp = t_1;
	} else if (eh <= 2.9e+79) {
		tmp = Math.abs((ew * Math.cos(t))) * Math.abs(Math.pow(1.0, 0.3333333333333333));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.fabs((eh * (math.sin(t) * math.sin(math.atan((eh * (math.tan(t) / ew)))))))
	tmp = 0
	if eh <= -5.5e+100:
		tmp = t_1
	elif eh <= 2.9e+79:
		tmp = math.fabs((ew * math.cos(t))) * math.fabs(math.pow(1.0, 0.3333333333333333))
	else:
		tmp = t_1
	return tmp
function code(eh, ew, t)
	t_1 = abs(Float64(eh * Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / ew)))))))
	tmp = 0.0
	if (eh <= -5.5e+100)
		tmp = t_1;
	elseif (eh <= 2.9e+79)
		tmp = Float64(abs(Float64(ew * cos(t))) * abs((1.0 ^ 0.3333333333333333)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = abs((eh * (sin(t) * sin(atan((eh * (tan(t) / ew)))))));
	tmp = 0.0;
	if (eh <= -5.5e+100)
		tmp = t_1;
	elseif (eh <= 2.9e+79)
		tmp = abs((ew * cos(t))) * abs((1.0 ^ 0.3333333333333333));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -5.5e+100], t$95$1, If[LessEqual[eh, 2.9e+79], N[(N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Abs[N[Power[1.0, 0.3333333333333333], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;eh \leq 2.9 \cdot 10^{+79}:\\
\;\;\;\;\left|ew \cdot \cos t\right| \cdot \left|{1}^{0.3333333333333333}\right|\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -5.5000000000000002e100 or 2.89999999999999992e79 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)\right)\right)\right|} \]
    4. Step-by-step derivation
      1. add-cube-cbrt98.0%

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

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

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

      \[\leadsto \left|\color{blue}{\left(\sin t \cdot \left(\sin \tan^{-1} \left(\frac{\tan t \cdot eh}{ew}\right) \cdot eh\right)\right) \cdot {1}^{0.3333333333333333}}\right| \]
    7. Step-by-step derivation
      1. pow-base-178.1%

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

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

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

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

        \[\leadsto \left|\color{blue}{\left(eh \cdot \sin \tan^{-1} \left(\frac{\tan t}{\frac{ew}{eh}}\right)\right) \cdot \sin t}\right| \]
      6. associate-*l*78.1%

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

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

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

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

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

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

    if -5.5000000000000002e100 < eh < 2.89999999999999992e79

    1. Initial program 99.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)\right)\right)\right|} \]
    4. Step-by-step derivation
      1. add-cube-cbrt97.9%

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

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

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

      \[\leadsto \left|\color{blue}{\left(\cos t \cdot ew\right) \cdot {1}^{0.3333333333333333}}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification81.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -5.5 \cdot 10^{+100}:\\ \;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right)\right|\\ \mathbf{elif}\;eh \leq 2.9 \cdot 10^{+79}:\\ \;\;\;\;\left|ew \cdot \cos t\right| \cdot \left|{1}^{0.3333333333333333}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right)\right|\\ \end{array} \]

Alternative 6: 61.2% accurate, 2.3× speedup?

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

\\
\left|ew \cdot \cos t\right| \cdot \left|{1}^{0.3333333333333333}\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)\right)\right)\right|} \]
  4. Step-by-step derivation
    1. add-cube-cbrt97.9%

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

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

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

    \[\leadsto \left|\color{blue}{\left(\cos t \cdot ew\right) \cdot {1}^{0.3333333333333333}}\right| \]
  7. Final simplification61.9%

    \[\leadsto \left|ew \cdot \cos t\right| \cdot \left|{1}^{0.3333333333333333}\right| \]

Alternative 7: 41.8% accurate, 9.1× speedup?

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

\\
\left|ew\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew, \cos \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right) \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\left(-\tan t\right) \cdot \frac{eh}{ew}\right)\right)\right)\right|} \]
  4. Step-by-step derivation
    1. add-cube-cbrt97.9%

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

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

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

    \[\leadsto \left|{\color{blue}{\left({ew}^{0.3333333333333333}\right)}}^{3}\right| \]
  7. Step-by-step derivation
    1. unpow1/340.0%

      \[\leadsto \left|{\color{blue}{\left(\sqrt[3]{ew}\right)}}^{3}\right| \]
  8. Simplified40.0%

    \[\leadsto \left|{\color{blue}{\left(\sqrt[3]{ew}\right)}}^{3}\right| \]
  9. Step-by-step derivation
    1. rem-cube-cbrt40.7%

      \[\leadsto \left|\color{blue}{ew}\right| \]
    2. expm1-log1p-u28.0%

      \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(ew\right)\right)}\right| \]
    3. expm1-udef14.2%

      \[\leadsto \left|\color{blue}{e^{\mathsf{log1p}\left(ew\right)} - 1}\right| \]
  10. Applied egg-rr14.2%

    \[\leadsto \left|\color{blue}{e^{\mathsf{log1p}\left(ew\right)} - 1}\right| \]
  11. Step-by-step derivation
    1. expm1-def28.0%

      \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(ew\right)\right)}\right| \]
    2. expm1-log1p40.7%

      \[\leadsto \left|\color{blue}{ew}\right| \]
  12. Simplified40.7%

    \[\leadsto \left|\color{blue}{ew}\right| \]
  13. Final simplification40.7%

    \[\leadsto \left|ew\right| \]

Reproduce

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