
(FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
double code(double x, double y, double z, double a) {
return x + (tan((y + z)) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (tan((y + z)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((y + z)) - Math.tan(a));
}
def code(x, y, z, a): return x + (math.tan((y + z)) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(tan(Float64(y + z)) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (tan((y + z)) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\tan \left(y + z\right) - \tan a\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
double code(double x, double y, double z, double a) {
return x + (tan((y + z)) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (tan((y + z)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((y + z)) - Math.tan(a));
}
def code(x, y, z, a): return x + (math.tan((y + z)) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(tan(Float64(y + z)) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (tan((y + z)) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\tan \left(y + z\right) - \tan a\right)
\end{array}
(FPCore (x y z a)
:precision binary64
(+
x
(-
(*
(/
(+ (tan y) (tan z))
(-
1.0
(*
(/ (pow (sin y) 2.0) (pow (cos z) 2.0))
(/ (pow (sin z) 2.0) (pow (cos y) 2.0)))))
(+ 1.0 (* (tan y) (tan z))))
(tan a))))
double code(double x, double y, double z, double a) {
return x + ((((tan(y) + tan(z)) / (1.0 - ((pow(sin(y), 2.0) / pow(cos(z), 2.0)) * (pow(sin(z), 2.0) / pow(cos(y), 2.0))))) * (1.0 + (tan(y) * tan(z)))) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + ((((tan(y) + tan(z)) / (1.0d0 - (((sin(y) ** 2.0d0) / (cos(z) ** 2.0d0)) * ((sin(z) ** 2.0d0) / (cos(y) ** 2.0d0))))) * (1.0d0 + (tan(y) * tan(z)))) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + ((((Math.tan(y) + Math.tan(z)) / (1.0 - ((Math.pow(Math.sin(y), 2.0) / Math.pow(Math.cos(z), 2.0)) * (Math.pow(Math.sin(z), 2.0) / Math.pow(Math.cos(y), 2.0))))) * (1.0 + (Math.tan(y) * Math.tan(z)))) - Math.tan(a));
}
def code(x, y, z, a): return x + ((((math.tan(y) + math.tan(z)) / (1.0 - ((math.pow(math.sin(y), 2.0) / math.pow(math.cos(z), 2.0)) * (math.pow(math.sin(z), 2.0) / math.pow(math.cos(y), 2.0))))) * (1.0 + (math.tan(y) * math.tan(z)))) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(Float64(tan(y) + tan(z)) / Float64(1.0 - Float64(Float64((sin(y) ^ 2.0) / (cos(z) ^ 2.0)) * Float64((sin(z) ^ 2.0) / (cos(y) ^ 2.0))))) * Float64(1.0 + Float64(tan(y) * tan(z)))) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + ((((tan(y) + tan(z)) / (1.0 - (((sin(y) ^ 2.0) / (cos(z) ^ 2.0)) * ((sin(z) ^ 2.0) / (cos(y) ^ 2.0))))) * (1.0 + (tan(y) * tan(z)))) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[(N[Power[N[Sin[y], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[N[Cos[z], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[z], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[N[Cos[y], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\frac{\tan y + \tan z}{1 - \frac{{\sin y}^{2}}{{\cos z}^{2}} \cdot \frac{{\sin z}^{2}}{{\cos y}^{2}}} \cdot \left(1 + \tan y \cdot \tan z\right) - \tan a\right)
\end{array}
Initial program 80.4%
tan-sumN/A
flip--N/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
Taylor expanded in y around inf
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
sin-lowering-sin.f64N/A
pow-lowering-pow.f64N/A
cos-lowering-cos.f64N/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
sin-lowering-sin.f64N/A
pow-lowering-pow.f64N/A
cos-lowering-cos.f6499.7%
Simplified99.7%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (* (tan y) (tan z))))
(+
x
(-
(* (+ 1.0 t_0) (/ (+ (tan y) (tan z)) (- 1.0 (pow t_0 2.0))))
(tan a)))))
double code(double x, double y, double z, double a) {
double t_0 = tan(y) * tan(z);
return x + (((1.0 + t_0) * ((tan(y) + tan(z)) / (1.0 - pow(t_0, 2.0)))) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
t_0 = tan(y) * tan(z)
code = x + (((1.0d0 + t_0) * ((tan(y) + tan(z)) / (1.0d0 - (t_0 ** 2.0d0)))) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan(y) * Math.tan(z);
return x + (((1.0 + t_0) * ((Math.tan(y) + Math.tan(z)) / (1.0 - Math.pow(t_0, 2.0)))) - Math.tan(a));
}
def code(x, y, z, a): t_0 = math.tan(y) * math.tan(z) return x + (((1.0 + t_0) * ((math.tan(y) + math.tan(z)) / (1.0 - math.pow(t_0, 2.0)))) - math.tan(a))
function code(x, y, z, a) t_0 = Float64(tan(y) * tan(z)) return Float64(x + Float64(Float64(Float64(1.0 + t_0) * Float64(Float64(tan(y) + tan(z)) / Float64(1.0 - (t_0 ^ 2.0)))) - tan(a))) end
function tmp = code(x, y, z, a) t_0 = tan(y) * tan(z); tmp = x + (((1.0 + t_0) * ((tan(y) + tan(z)) / (1.0 - (t_0 ^ 2.0)))) - tan(a)); end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]}, N[(x + N[(N[(N[(1.0 + t$95$0), $MachinePrecision] * N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan y \cdot \tan z\\
x + \left(\left(1 + t\_0\right) \cdot \frac{\tan y + \tan z}{1 - {t\_0}^{2}} - \tan a\right)
\end{array}
\end{array}
Initial program 80.4%
tan-sumN/A
flip--N/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (x y z a) :precision binary64 (+ x (- (* (+ (tan y) (tan z)) (/ 1.0 (- 1.0 (* (tan y) (tan z))))) (tan a))))
double code(double x, double y, double z, double a) {
return x + (((tan(y) + tan(z)) * (1.0 / (1.0 - (tan(y) * tan(z))))) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (((tan(y) + tan(z)) * (1.0d0 / (1.0d0 - (tan(y) * tan(z))))) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + (((Math.tan(y) + Math.tan(z)) * (1.0 / (1.0 - (Math.tan(y) * Math.tan(z))))) - Math.tan(a));
}
def code(x, y, z, a): return x + (((math.tan(y) + math.tan(z)) * (1.0 / (1.0 - (math.tan(y) * math.tan(z))))) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(tan(y) + tan(z)) * Float64(1.0 / Float64(1.0 - Float64(tan(y) * tan(z))))) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (((tan(y) + tan(z)) * (1.0 / (1.0 - (tan(y) * tan(z))))) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(\tan y + \tan z\right) \cdot \frac{1}{1 - \tan y \cdot \tan z} - \tan a\right)
\end{array}
Initial program 80.4%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (x y z a) :precision binary64 (+ x (- (/ (+ (tan y) (tan z)) (- 1.0 (* (tan y) (tan z)))) (tan a))))
double code(double x, double y, double z, double a) {
return x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (((tan(y) + tan(z)) / (1.0d0 - (tan(y) * tan(z)))) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + (((Math.tan(y) + Math.tan(z)) / (1.0 - (Math.tan(y) * Math.tan(z)))) - Math.tan(a));
}
def code(x, y, z, a): return x + (((math.tan(y) + math.tan(z)) / (1.0 - (math.tan(y) * math.tan(z)))) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(tan(y) + tan(z)) / Float64(1.0 - Float64(tan(y) * tan(z)))) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)
\end{array}
Initial program 80.4%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan y) (tan z))))
(if (<= a -0.00018)
(+ x (- t_0 (tan a)))
(if (<= a 0.00115)
(+ x (- (* t_0 (/ 1.0 (- 1.0 (* (tan y) (tan z))))) a))
(+ x (- (* (/ 1.0 (cos (+ y z))) (sin (+ y z))) (tan a)))))))
double code(double x, double y, double z, double a) {
double t_0 = tan(y) + tan(z);
double tmp;
if (a <= -0.00018) {
tmp = x + (t_0 - tan(a));
} else if (a <= 0.00115) {
tmp = x + ((t_0 * (1.0 / (1.0 - (tan(y) * tan(z))))) - a);
} else {
tmp = x + (((1.0 / cos((y + z))) * sin((y + z))) - tan(a));
}
return tmp;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: tmp
t_0 = tan(y) + tan(z)
if (a <= (-0.00018d0)) then
tmp = x + (t_0 - tan(a))
else if (a <= 0.00115d0) then
tmp = x + ((t_0 * (1.0d0 / (1.0d0 - (tan(y) * tan(z))))) - a)
else
tmp = x + (((1.0d0 / cos((y + z))) * sin((y + z))) - tan(a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan(y) + Math.tan(z);
double tmp;
if (a <= -0.00018) {
tmp = x + (t_0 - Math.tan(a));
} else if (a <= 0.00115) {
tmp = x + ((t_0 * (1.0 / (1.0 - (Math.tan(y) * Math.tan(z))))) - a);
} else {
tmp = x + (((1.0 / Math.cos((y + z))) * Math.sin((y + z))) - Math.tan(a));
}
return tmp;
}
def code(x, y, z, a): t_0 = math.tan(y) + math.tan(z) tmp = 0 if a <= -0.00018: tmp = x + (t_0 - math.tan(a)) elif a <= 0.00115: tmp = x + ((t_0 * (1.0 / (1.0 - (math.tan(y) * math.tan(z))))) - a) else: tmp = x + (((1.0 / math.cos((y + z))) * math.sin((y + z))) - math.tan(a)) return tmp
function code(x, y, z, a) t_0 = Float64(tan(y) + tan(z)) tmp = 0.0 if (a <= -0.00018) tmp = Float64(x + Float64(t_0 - tan(a))); elseif (a <= 0.00115) tmp = Float64(x + Float64(Float64(t_0 * Float64(1.0 / Float64(1.0 - Float64(tan(y) * tan(z))))) - a)); else tmp = Float64(x + Float64(Float64(Float64(1.0 / cos(Float64(y + z))) * sin(Float64(y + z))) - tan(a))); end return tmp end
function tmp_2 = code(x, y, z, a) t_0 = tan(y) + tan(z); tmp = 0.0; if (a <= -0.00018) tmp = x + (t_0 - tan(a)); elseif (a <= 0.00115) tmp = x + ((t_0 * (1.0 / (1.0 - (tan(y) * tan(z))))) - a); else tmp = x + (((1.0 / cos((y + z))) * sin((y + z))) - tan(a)); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.00018], N[(x + N[(t$95$0 - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 0.00115], N[(x + N[(N[(t$95$0 * N[(1.0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(1.0 / N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan y + \tan z\\
\mathbf{if}\;a \leq -0.00018:\\
\;\;\;\;x + \left(t\_0 - \tan a\right)\\
\mathbf{elif}\;a \leq 0.00115:\\
\;\;\;\;x + \left(t\_0 \cdot \frac{1}{1 - \tan y \cdot \tan z} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\frac{1}{\cos \left(y + z\right)} \cdot \sin \left(y + z\right) - \tan a\right)\\
\end{array}
\end{array}
if a < -1.80000000000000011e-4Initial program 78.7%
tan-sumN/A
flip--N/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
div-invN/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
Taylor expanded in y around 0
Simplified79.5%
if -1.80000000000000011e-4 < a < 0.00115Initial program 79.1%
Taylor expanded in a around 0
Simplified79.1%
tan-sumN/A
div-invN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
if 0.00115 < a Initial program 85.2%
tan-quotN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
sin-lowering-sin.f64N/A
+-lowering-+.f6485.2%
Applied egg-rr85.2%
Final simplification90.7%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan y) (tan z))))
(if (<= a -0.00038)
(+ x (- t_0 (tan a)))
(if (<= a 0.00065)
(+ x (- (/ t_0 (- 1.0 (* (tan y) (tan z)))) a))
(+ x (- (* (/ 1.0 (cos (+ y z))) (sin (+ y z))) (tan a)))))))
double code(double x, double y, double z, double a) {
double t_0 = tan(y) + tan(z);
double tmp;
if (a <= -0.00038) {
tmp = x + (t_0 - tan(a));
} else if (a <= 0.00065) {
tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
} else {
tmp = x + (((1.0 / cos((y + z))) * sin((y + z))) - tan(a));
}
return tmp;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: tmp
t_0 = tan(y) + tan(z)
if (a <= (-0.00038d0)) then
tmp = x + (t_0 - tan(a))
else if (a <= 0.00065d0) then
tmp = x + ((t_0 / (1.0d0 - (tan(y) * tan(z)))) - a)
else
tmp = x + (((1.0d0 / cos((y + z))) * sin((y + z))) - tan(a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan(y) + Math.tan(z);
double tmp;
if (a <= -0.00038) {
tmp = x + (t_0 - Math.tan(a));
} else if (a <= 0.00065) {
tmp = x + ((t_0 / (1.0 - (Math.tan(y) * Math.tan(z)))) - a);
} else {
tmp = x + (((1.0 / Math.cos((y + z))) * Math.sin((y + z))) - Math.tan(a));
}
return tmp;
}
def code(x, y, z, a): t_0 = math.tan(y) + math.tan(z) tmp = 0 if a <= -0.00038: tmp = x + (t_0 - math.tan(a)) elif a <= 0.00065: tmp = x + ((t_0 / (1.0 - (math.tan(y) * math.tan(z)))) - a) else: tmp = x + (((1.0 / math.cos((y + z))) * math.sin((y + z))) - math.tan(a)) return tmp
function code(x, y, z, a) t_0 = Float64(tan(y) + tan(z)) tmp = 0.0 if (a <= -0.00038) tmp = Float64(x + Float64(t_0 - tan(a))); elseif (a <= 0.00065) tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) - a)); else tmp = Float64(x + Float64(Float64(Float64(1.0 / cos(Float64(y + z))) * sin(Float64(y + z))) - tan(a))); end return tmp end
function tmp_2 = code(x, y, z, a) t_0 = tan(y) + tan(z); tmp = 0.0; if (a <= -0.00038) tmp = x + (t_0 - tan(a)); elseif (a <= 0.00065) tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a); else tmp = x + (((1.0 / cos((y + z))) * sin((y + z))) - tan(a)); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.00038], N[(x + N[(t$95$0 - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 0.00065], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(1.0 / N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan y + \tan z\\
\mathbf{if}\;a \leq -0.00038:\\
\;\;\;\;x + \left(t\_0 - \tan a\right)\\
\mathbf{elif}\;a \leq 0.00065:\\
\;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\frac{1}{\cos \left(y + z\right)} \cdot \sin \left(y + z\right) - \tan a\right)\\
\end{array}
\end{array}
if a < -3.8000000000000002e-4Initial program 78.7%
tan-sumN/A
flip--N/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
div-invN/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
Taylor expanded in y around 0
Simplified79.5%
if -3.8000000000000002e-4 < a < 6.4999999999999997e-4Initial program 79.1%
Taylor expanded in a around 0
Simplified79.1%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
if 6.4999999999999997e-4 < a Initial program 85.2%
tan-quotN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
sin-lowering-sin.f64N/A
+-lowering-+.f6485.2%
Applied egg-rr85.2%
Final simplification90.7%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ x (- (tan y) (tan a)))))
(if (<= (tan a) -0.02)
t_0
(if (<= (tan a) 1e-8)
(+
x
(+
(tan (+ y z))
(*
a
(-
-1.0
(*
(* a a)
(+ 0.3333333333333333 (* (* a a) 0.13333333333333333)))))))
t_0))))
double code(double x, double y, double z, double a) {
double t_0 = x + (tan(y) - tan(a));
double tmp;
if (tan(a) <= -0.02) {
tmp = t_0;
} else if (tan(a) <= 1e-8) {
tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: tmp
t_0 = x + (tan(y) - tan(a))
if (tan(a) <= (-0.02d0)) then
tmp = t_0
else if (tan(a) <= 1d-8) then
tmp = x + (tan((y + z)) + (a * ((-1.0d0) - ((a * a) * (0.3333333333333333d0 + ((a * a) * 0.13333333333333333d0))))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double t_0 = x + (Math.tan(y) - Math.tan(a));
double tmp;
if (Math.tan(a) <= -0.02) {
tmp = t_0;
} else if (Math.tan(a) <= 1e-8) {
tmp = x + (Math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z, a): t_0 = x + (math.tan(y) - math.tan(a)) tmp = 0 if math.tan(a) <= -0.02: tmp = t_0 elif math.tan(a) <= 1e-8: tmp = x + (math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333)))))) else: tmp = t_0 return tmp
function code(x, y, z, a) t_0 = Float64(x + Float64(tan(y) - tan(a))) tmp = 0.0 if (tan(a) <= -0.02) tmp = t_0; elseif (tan(a) <= 1e-8) tmp = Float64(x + Float64(tan(Float64(y + z)) + Float64(a * Float64(-1.0 - Float64(Float64(a * a) * Float64(0.3333333333333333 + Float64(Float64(a * a) * 0.13333333333333333))))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z, a) t_0 = x + (tan(y) - tan(a)); tmp = 0.0; if (tan(a) <= -0.02) tmp = t_0; elseif (tan(a) <= 1e-8) tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333)))))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x + N[(N[Tan[y], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.02], t$95$0, If[LessEqual[N[Tan[a], $MachinePrecision], 1e-8], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + N[(a * N[(-1.0 - N[(N[(a * a), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(a * a), $MachinePrecision] * 0.13333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(\tan y - \tan a\right)\\
\mathbf{if}\;\tan a \leq -0.02:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\tan a \leq 10^{-8}:\\
\;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot 0.13333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (tan.f64 a) < -0.0200000000000000004 or 1e-8 < (tan.f64 a) Initial program 81.0%
Taylor expanded in y around inf
Simplified58.5%
if -0.0200000000000000004 < (tan.f64 a) < 1e-8Initial program 79.8%
Taylor expanded in a around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.8%
Simplified79.8%
Final simplification69.0%
(FPCore (x y z a) :precision binary64 (+ x (- (+ (tan y) (tan z)) (tan a))))
double code(double x, double y, double z, double a) {
return x + ((tan(y) + tan(z)) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + ((tan(y) + tan(z)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + ((Math.tan(y) + Math.tan(z)) - Math.tan(a));
}
def code(x, y, z, a): return x + ((math.tan(y) + math.tan(z)) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(Float64(tan(y) + tan(z)) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + ((tan(y) + tan(z)) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(\tan y + \tan z\right) - \tan a\right)
\end{array}
Initial program 80.4%
tan-sumN/A
flip--N/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
div-invN/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
Taylor expanded in y around 0
Simplified80.7%
Final simplification80.7%
(FPCore (x y z a) :precision binary64 (if (<= (+ y z) -5e-12) (+ x (- (tan y) (tan a))) (+ x (- (tan z) (tan a)))))
double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -5e-12) {
tmp = x + (tan(y) - tan(a));
} else {
tmp = x + (tan(z) - tan(a));
}
return tmp;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if ((y + z) <= (-5d-12)) then
tmp = x + (tan(y) - tan(a))
else
tmp = x + (tan(z) - tan(a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -5e-12) {
tmp = x + (Math.tan(y) - Math.tan(a));
} else {
tmp = x + (Math.tan(z) - Math.tan(a));
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if (y + z) <= -5e-12: tmp = x + (math.tan(y) - math.tan(a)) else: tmp = x + (math.tan(z) - math.tan(a)) return tmp
function code(x, y, z, a) tmp = 0.0 if (Float64(y + z) <= -5e-12) tmp = Float64(x + Float64(tan(y) - tan(a))); else tmp = Float64(x + Float64(tan(z) - tan(a))); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if ((y + z) <= -5e-12) tmp = x + (tan(y) - tan(a)); else tmp = x + (tan(z) - tan(a)); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -5e-12], N[(x + N[(N[Tan[y], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[z], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + z \leq -5 \cdot 10^{-12}:\\
\;\;\;\;x + \left(\tan y - \tan a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan z - \tan a\right)\\
\end{array}
\end{array}
if (+.f64 y z) < -4.9999999999999997e-12Initial program 76.0%
Taylor expanded in y around inf
Simplified47.9%
if -4.9999999999999997e-12 < (+.f64 y z) Initial program 83.3%
Taylor expanded in y around 0
Simplified67.6%
(FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
double code(double x, double y, double z, double a) {
return x + (tan((y + z)) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (tan((y + z)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((y + z)) - Math.tan(a));
}
def code(x, y, z, a): return x + (math.tan((y + z)) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(tan(Float64(y + z)) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (tan((y + z)) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\tan \left(y + z\right) - \tan a\right)
\end{array}
Initial program 80.4%
(FPCore (x y z a)
:precision binary64
(if (<= (+ y z) -2000000.0)
(/ 1.0 (/ 1.0 (+ x (tan y))))
(if (<= (+ y z) 2e-7)
(/
1.0
(/
1.0
(+
(*
y
(+
1.0
(* (* y y) (+ 0.3333333333333333 (* 0.13333333333333333 (* y y))))))
(- x (tan a)))))
(+
x
(+
(tan (+ y z))
(*
a
(-
-1.0
(*
(* a a)
(+ 0.3333333333333333 (* (* a a) 0.13333333333333333))))))))))
double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -2000000.0) {
tmp = 1.0 / (1.0 / (x + tan(y)));
} else if ((y + z) <= 2e-7) {
tmp = 1.0 / (1.0 / ((y * (1.0 + ((y * y) * (0.3333333333333333 + (0.13333333333333333 * (y * y)))))) + (x - tan(a))));
} else {
tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))));
}
return tmp;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if ((y + z) <= (-2000000.0d0)) then
tmp = 1.0d0 / (1.0d0 / (x + tan(y)))
else if ((y + z) <= 2d-7) then
tmp = 1.0d0 / (1.0d0 / ((y * (1.0d0 + ((y * y) * (0.3333333333333333d0 + (0.13333333333333333d0 * (y * y)))))) + (x - tan(a))))
else
tmp = x + (tan((y + z)) + (a * ((-1.0d0) - ((a * a) * (0.3333333333333333d0 + ((a * a) * 0.13333333333333333d0))))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -2000000.0) {
tmp = 1.0 / (1.0 / (x + Math.tan(y)));
} else if ((y + z) <= 2e-7) {
tmp = 1.0 / (1.0 / ((y * (1.0 + ((y * y) * (0.3333333333333333 + (0.13333333333333333 * (y * y)))))) + (x - Math.tan(a))));
} else {
tmp = x + (Math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))));
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if (y + z) <= -2000000.0: tmp = 1.0 / (1.0 / (x + math.tan(y))) elif (y + z) <= 2e-7: tmp = 1.0 / (1.0 / ((y * (1.0 + ((y * y) * (0.3333333333333333 + (0.13333333333333333 * (y * y)))))) + (x - math.tan(a)))) else: tmp = x + (math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333)))))) return tmp
function code(x, y, z, a) tmp = 0.0 if (Float64(y + z) <= -2000000.0) tmp = Float64(1.0 / Float64(1.0 / Float64(x + tan(y)))); elseif (Float64(y + z) <= 2e-7) tmp = Float64(1.0 / Float64(1.0 / Float64(Float64(y * Float64(1.0 + Float64(Float64(y * y) * Float64(0.3333333333333333 + Float64(0.13333333333333333 * Float64(y * y)))))) + Float64(x - tan(a))))); else tmp = Float64(x + Float64(tan(Float64(y + z)) + Float64(a * Float64(-1.0 - Float64(Float64(a * a) * Float64(0.3333333333333333 + Float64(Float64(a * a) * 0.13333333333333333))))))); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if ((y + z) <= -2000000.0) tmp = 1.0 / (1.0 / (x + tan(y))); elseif ((y + z) <= 2e-7) tmp = 1.0 / (1.0 / ((y * (1.0 + ((y * y) * (0.3333333333333333 + (0.13333333333333333 * (y * y)))))) + (x - tan(a)))); else tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333)))))); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -2000000.0], N[(1.0 / N[(1.0 / N[(x + N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y + z), $MachinePrecision], 2e-7], N[(1.0 / N[(1.0 / N[(N[(y * N[(1.0 + N[(N[(y * y), $MachinePrecision] * N[(0.3333333333333333 + N[(0.13333333333333333 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + N[(a * N[(-1.0 - N[(N[(a * a), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(a * a), $MachinePrecision] * 0.13333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + z \leq -2000000:\\
\;\;\;\;\frac{1}{\frac{1}{x + \tan y}}\\
\mathbf{elif}\;y + z \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\frac{1}{y \cdot \left(1 + \left(y \cdot y\right) \cdot \left(0.3333333333333333 + 0.13333333333333333 \cdot \left(y \cdot y\right)\right)\right) + \left(x - \tan a\right)}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot 0.13333333333333333\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 y z) < -2e6Initial program 75.2%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
tan-lowering-tan.f6475.1%
Applied egg-rr75.1%
Taylor expanded in y around inf
Simplified46.5%
Taylor expanded in x around inf
Simplified37.4%
if -2e6 < (+.f64 y z) < 1.9999999999999999e-7Initial program 99.9%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
tan-lowering-tan.f6499.6%
Applied egg-rr99.6%
Taylor expanded in y around inf
Simplified98.7%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.7%
Simplified98.7%
if 1.9999999999999999e-7 < (+.f64 y z) Initial program 73.6%
Taylor expanded in a around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6433.7%
Simplified33.7%
Final simplification50.4%
(FPCore (x y z a)
:precision binary64
(if (<= (+ y z) -2000000.0)
(/ 1.0 (/ 1.0 (+ x (tan y))))
(if (<= (+ y z) 2e-7)
(/
1.0
(/ 1.0 (+ (- x (tan a)) (* y (+ 1.0 (* 0.3333333333333333 (* y y)))))))
(+
x
(+
(tan (+ y z))
(*
a
(-
-1.0
(*
(* a a)
(+ 0.3333333333333333 (* (* a a) 0.13333333333333333))))))))))
double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -2000000.0) {
tmp = 1.0 / (1.0 / (x + tan(y)));
} else if ((y + z) <= 2e-7) {
tmp = 1.0 / (1.0 / ((x - tan(a)) + (y * (1.0 + (0.3333333333333333 * (y * y))))));
} else {
tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))));
}
return tmp;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if ((y + z) <= (-2000000.0d0)) then
tmp = 1.0d0 / (1.0d0 / (x + tan(y)))
else if ((y + z) <= 2d-7) then
tmp = 1.0d0 / (1.0d0 / ((x - tan(a)) + (y * (1.0d0 + (0.3333333333333333d0 * (y * y))))))
else
tmp = x + (tan((y + z)) + (a * ((-1.0d0) - ((a * a) * (0.3333333333333333d0 + ((a * a) * 0.13333333333333333d0))))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -2000000.0) {
tmp = 1.0 / (1.0 / (x + Math.tan(y)));
} else if ((y + z) <= 2e-7) {
tmp = 1.0 / (1.0 / ((x - Math.tan(a)) + (y * (1.0 + (0.3333333333333333 * (y * y))))));
} else {
tmp = x + (Math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))));
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if (y + z) <= -2000000.0: tmp = 1.0 / (1.0 / (x + math.tan(y))) elif (y + z) <= 2e-7: tmp = 1.0 / (1.0 / ((x - math.tan(a)) + (y * (1.0 + (0.3333333333333333 * (y * y)))))) else: tmp = x + (math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333)))))) return tmp
function code(x, y, z, a) tmp = 0.0 if (Float64(y + z) <= -2000000.0) tmp = Float64(1.0 / Float64(1.0 / Float64(x + tan(y)))); elseif (Float64(y + z) <= 2e-7) tmp = Float64(1.0 / Float64(1.0 / Float64(Float64(x - tan(a)) + Float64(y * Float64(1.0 + Float64(0.3333333333333333 * Float64(y * y))))))); else tmp = Float64(x + Float64(tan(Float64(y + z)) + Float64(a * Float64(-1.0 - Float64(Float64(a * a) * Float64(0.3333333333333333 + Float64(Float64(a * a) * 0.13333333333333333))))))); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if ((y + z) <= -2000000.0) tmp = 1.0 / (1.0 / (x + tan(y))); elseif ((y + z) <= 2e-7) tmp = 1.0 / (1.0 / ((x - tan(a)) + (y * (1.0 + (0.3333333333333333 * (y * y)))))); else tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333)))))); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -2000000.0], N[(1.0 / N[(1.0 / N[(x + N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y + z), $MachinePrecision], 2e-7], N[(1.0 / N[(1.0 / N[(N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 + N[(0.3333333333333333 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + N[(a * N[(-1.0 - N[(N[(a * a), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(a * a), $MachinePrecision] * 0.13333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + z \leq -2000000:\\
\;\;\;\;\frac{1}{\frac{1}{x + \tan y}}\\
\mathbf{elif}\;y + z \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\frac{1}{\left(x - \tan a\right) + y \cdot \left(1 + 0.3333333333333333 \cdot \left(y \cdot y\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot 0.13333333333333333\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 y z) < -2e6Initial program 75.2%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
tan-lowering-tan.f6475.1%
Applied egg-rr75.1%
Taylor expanded in y around inf
Simplified46.5%
Taylor expanded in x around inf
Simplified37.4%
if -2e6 < (+.f64 y z) < 1.9999999999999999e-7Initial program 99.9%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
tan-lowering-tan.f6499.6%
Applied egg-rr99.6%
Taylor expanded in y around inf
Simplified98.7%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.4%
Simplified98.4%
if 1.9999999999999999e-7 < (+.f64 y z) Initial program 73.6%
Taylor expanded in a around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6433.7%
Simplified33.7%
Final simplification50.3%
(FPCore (x y z a)
:precision binary64
(if (<= (+ y z) -2000000.0)
(/ 1.0 (/ 1.0 (+ x (tan y))))
(if (<= (+ y z) 2e-7)
(/
1.0
(/ 1.0 (+ (- x (tan a)) (* y (+ 1.0 (* 0.3333333333333333 (* y y)))))))
(+ x (- (tan (* z (+ 1.0 (/ y z)))) a)))))
double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -2000000.0) {
tmp = 1.0 / (1.0 / (x + tan(y)));
} else if ((y + z) <= 2e-7) {
tmp = 1.0 / (1.0 / ((x - tan(a)) + (y * (1.0 + (0.3333333333333333 * (y * y))))));
} else {
tmp = x + (tan((z * (1.0 + (y / z)))) - a);
}
return tmp;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if ((y + z) <= (-2000000.0d0)) then
tmp = 1.0d0 / (1.0d0 / (x + tan(y)))
else if ((y + z) <= 2d-7) then
tmp = 1.0d0 / (1.0d0 / ((x - tan(a)) + (y * (1.0d0 + (0.3333333333333333d0 * (y * y))))))
else
tmp = x + (tan((z * (1.0d0 + (y / z)))) - a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -2000000.0) {
tmp = 1.0 / (1.0 / (x + Math.tan(y)));
} else if ((y + z) <= 2e-7) {
tmp = 1.0 / (1.0 / ((x - Math.tan(a)) + (y * (1.0 + (0.3333333333333333 * (y * y))))));
} else {
tmp = x + (Math.tan((z * (1.0 + (y / z)))) - a);
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if (y + z) <= -2000000.0: tmp = 1.0 / (1.0 / (x + math.tan(y))) elif (y + z) <= 2e-7: tmp = 1.0 / (1.0 / ((x - math.tan(a)) + (y * (1.0 + (0.3333333333333333 * (y * y)))))) else: tmp = x + (math.tan((z * (1.0 + (y / z)))) - a) return tmp
function code(x, y, z, a) tmp = 0.0 if (Float64(y + z) <= -2000000.0) tmp = Float64(1.0 / Float64(1.0 / Float64(x + tan(y)))); elseif (Float64(y + z) <= 2e-7) tmp = Float64(1.0 / Float64(1.0 / Float64(Float64(x - tan(a)) + Float64(y * Float64(1.0 + Float64(0.3333333333333333 * Float64(y * y))))))); else tmp = Float64(x + Float64(tan(Float64(z * Float64(1.0 + Float64(y / z)))) - a)); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if ((y + z) <= -2000000.0) tmp = 1.0 / (1.0 / (x + tan(y))); elseif ((y + z) <= 2e-7) tmp = 1.0 / (1.0 / ((x - tan(a)) + (y * (1.0 + (0.3333333333333333 * (y * y)))))); else tmp = x + (tan((z * (1.0 + (y / z)))) - a); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -2000000.0], N[(1.0 / N[(1.0 / N[(x + N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y + z), $MachinePrecision], 2e-7], N[(1.0 / N[(1.0 / N[(N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 + N[(0.3333333333333333 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[N[(z * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + z \leq -2000000:\\
\;\;\;\;\frac{1}{\frac{1}{x + \tan y}}\\
\mathbf{elif}\;y + z \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\frac{1}{\left(x - \tan a\right) + y \cdot \left(1 + 0.3333333333333333 \cdot \left(y \cdot y\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan \left(z \cdot \left(1 + \frac{y}{z}\right)\right) - a\right)\\
\end{array}
\end{array}
if (+.f64 y z) < -2e6Initial program 75.2%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
tan-lowering-tan.f6475.1%
Applied egg-rr75.1%
Taylor expanded in y around inf
Simplified46.5%
Taylor expanded in x around inf
Simplified37.4%
if -2e6 < (+.f64 y z) < 1.9999999999999999e-7Initial program 99.9%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
tan-lowering-tan.f6499.6%
Applied egg-rr99.6%
Taylor expanded in y around inf
Simplified98.7%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.4%
Simplified98.4%
if 1.9999999999999999e-7 < (+.f64 y z) Initial program 73.6%
Taylor expanded in a around 0
Simplified33.7%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6431.0%
Simplified31.0%
Final simplification49.3%
(FPCore (x y z a)
:precision binary64
(if (<= (+ y z) -2000000.0)
(/ 1.0 (/ 1.0 (+ x (tan y))))
(if (<= (+ y z) 2e-7)
(/ 1.0 (/ 1.0 (+ y (- x (tan a)))))
(+ x (- (tan (* z (+ 1.0 (/ y z)))) a)))))
double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -2000000.0) {
tmp = 1.0 / (1.0 / (x + tan(y)));
} else if ((y + z) <= 2e-7) {
tmp = 1.0 / (1.0 / (y + (x - tan(a))));
} else {
tmp = x + (tan((z * (1.0 + (y / z)))) - a);
}
return tmp;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if ((y + z) <= (-2000000.0d0)) then
tmp = 1.0d0 / (1.0d0 / (x + tan(y)))
else if ((y + z) <= 2d-7) then
tmp = 1.0d0 / (1.0d0 / (y + (x - tan(a))))
else
tmp = x + (tan((z * (1.0d0 + (y / z)))) - a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -2000000.0) {
tmp = 1.0 / (1.0 / (x + Math.tan(y)));
} else if ((y + z) <= 2e-7) {
tmp = 1.0 / (1.0 / (y + (x - Math.tan(a))));
} else {
tmp = x + (Math.tan((z * (1.0 + (y / z)))) - a);
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if (y + z) <= -2000000.0: tmp = 1.0 / (1.0 / (x + math.tan(y))) elif (y + z) <= 2e-7: tmp = 1.0 / (1.0 / (y + (x - math.tan(a)))) else: tmp = x + (math.tan((z * (1.0 + (y / z)))) - a) return tmp
function code(x, y, z, a) tmp = 0.0 if (Float64(y + z) <= -2000000.0) tmp = Float64(1.0 / Float64(1.0 / Float64(x + tan(y)))); elseif (Float64(y + z) <= 2e-7) tmp = Float64(1.0 / Float64(1.0 / Float64(y + Float64(x - tan(a))))); else tmp = Float64(x + Float64(tan(Float64(z * Float64(1.0 + Float64(y / z)))) - a)); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if ((y + z) <= -2000000.0) tmp = 1.0 / (1.0 / (x + tan(y))); elseif ((y + z) <= 2e-7) tmp = 1.0 / (1.0 / (y + (x - tan(a)))); else tmp = x + (tan((z * (1.0 + (y / z)))) - a); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -2000000.0], N[(1.0 / N[(1.0 / N[(x + N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y + z), $MachinePrecision], 2e-7], N[(1.0 / N[(1.0 / N[(y + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[N[(z * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + z \leq -2000000:\\
\;\;\;\;\frac{1}{\frac{1}{x + \tan y}}\\
\mathbf{elif}\;y + z \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\frac{1}{y + \left(x - \tan a\right)}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan \left(z \cdot \left(1 + \frac{y}{z}\right)\right) - a\right)\\
\end{array}
\end{array}
if (+.f64 y z) < -2e6Initial program 75.2%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
tan-lowering-tan.f6475.1%
Applied egg-rr75.1%
Taylor expanded in y around inf
Simplified46.5%
Taylor expanded in x around inf
Simplified37.4%
if -2e6 < (+.f64 y z) < 1.9999999999999999e-7Initial program 99.9%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
tan-lowering-tan.f6499.6%
Applied egg-rr99.6%
Taylor expanded in y around inf
Simplified98.7%
Taylor expanded in y around 0
Simplified98.1%
if 1.9999999999999999e-7 < (+.f64 y z) Initial program 73.6%
Taylor expanded in a around 0
Simplified33.7%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6431.0%
Simplified31.0%
Final simplification49.2%
(FPCore (x y z a)
:precision binary64
(if (<= (+ y z) -2000000.0)
(/ 1.0 (/ 1.0 (+ x (tan y))))
(if (<= (+ y z) 2e-7)
(/ 1.0 (/ 1.0 (+ y (- x (tan a)))))
(+ x (- (tan (+ y z)) a)))))
double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -2000000.0) {
tmp = 1.0 / (1.0 / (x + tan(y)));
} else if ((y + z) <= 2e-7) {
tmp = 1.0 / (1.0 / (y + (x - tan(a))));
} else {
tmp = x + (tan((y + z)) - a);
}
return tmp;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if ((y + z) <= (-2000000.0d0)) then
tmp = 1.0d0 / (1.0d0 / (x + tan(y)))
else if ((y + z) <= 2d-7) then
tmp = 1.0d0 / (1.0d0 / (y + (x - tan(a))))
else
tmp = x + (tan((y + z)) - a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -2000000.0) {
tmp = 1.0 / (1.0 / (x + Math.tan(y)));
} else if ((y + z) <= 2e-7) {
tmp = 1.0 / (1.0 / (y + (x - Math.tan(a))));
} else {
tmp = x + (Math.tan((y + z)) - a);
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if (y + z) <= -2000000.0: tmp = 1.0 / (1.0 / (x + math.tan(y))) elif (y + z) <= 2e-7: tmp = 1.0 / (1.0 / (y + (x - math.tan(a)))) else: tmp = x + (math.tan((y + z)) - a) return tmp
function code(x, y, z, a) tmp = 0.0 if (Float64(y + z) <= -2000000.0) tmp = Float64(1.0 / Float64(1.0 / Float64(x + tan(y)))); elseif (Float64(y + z) <= 2e-7) tmp = Float64(1.0 / Float64(1.0 / Float64(y + Float64(x - tan(a))))); else tmp = Float64(x + Float64(tan(Float64(y + z)) - a)); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if ((y + z) <= -2000000.0) tmp = 1.0 / (1.0 / (x + tan(y))); elseif ((y + z) <= 2e-7) tmp = 1.0 / (1.0 / (y + (x - tan(a)))); else tmp = x + (tan((y + z)) - a); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -2000000.0], N[(1.0 / N[(1.0 / N[(x + N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y + z), $MachinePrecision], 2e-7], N[(1.0 / N[(1.0 / N[(y + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + z \leq -2000000:\\
\;\;\;\;\frac{1}{\frac{1}{x + \tan y}}\\
\mathbf{elif}\;y + z \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\frac{1}{y + \left(x - \tan a\right)}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - a\right)\\
\end{array}
\end{array}
if (+.f64 y z) < -2e6Initial program 75.2%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
tan-lowering-tan.f6475.1%
Applied egg-rr75.1%
Taylor expanded in y around inf
Simplified46.5%
Taylor expanded in x around inf
Simplified37.4%
if -2e6 < (+.f64 y z) < 1.9999999999999999e-7Initial program 99.9%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
tan-lowering-tan.f6499.6%
Applied egg-rr99.6%
Taylor expanded in y around inf
Simplified98.7%
Taylor expanded in y around 0
Simplified98.1%
if 1.9999999999999999e-7 < (+.f64 y z) Initial program 73.6%
Taylor expanded in a around 0
Simplified33.7%
Final simplification50.2%
(FPCore (x y z a) :precision binary64 (if (<= a -1.56) (/ 1.0 (/ 1.0 (+ x (tan y)))) (if (<= a 7.2e-5) (+ x (- (tan (+ y z)) a)) x)))
double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.56) {
tmp = 1.0 / (1.0 / (x + tan(y)));
} else if (a <= 7.2e-5) {
tmp = x + (tan((y + z)) - a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.56d0)) then
tmp = 1.0d0 / (1.0d0 / (x + tan(y)))
else if (a <= 7.2d-5) then
tmp = x + (tan((y + z)) - a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.56) {
tmp = 1.0 / (1.0 / (x + Math.tan(y)));
} else if (a <= 7.2e-5) {
tmp = x + (Math.tan((y + z)) - a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if a <= -1.56: tmp = 1.0 / (1.0 / (x + math.tan(y))) elif a <= 7.2e-5: tmp = x + (math.tan((y + z)) - a) else: tmp = x return tmp
function code(x, y, z, a) tmp = 0.0 if (a <= -1.56) tmp = Float64(1.0 / Float64(1.0 / Float64(x + tan(y)))); elseif (a <= 7.2e-5) tmp = Float64(x + Float64(tan(Float64(y + z)) - a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if (a <= -1.56) tmp = 1.0 / (1.0 / (x + tan(y))); elseif (a <= 7.2e-5) tmp = x + (tan((y + z)) - a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[a, -1.56], N[(1.0 / N[(1.0 / N[(x + N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.2e-5], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.56:\\
\;\;\;\;\frac{1}{\frac{1}{x + \tan y}}\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-5}:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - a\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.5600000000000001Initial program 78.1%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
tan-lowering-tan.f6478.0%
Applied egg-rr78.0%
Taylor expanded in y around inf
Simplified59.1%
Taylor expanded in x around inf
Simplified22.8%
if -1.5600000000000001 < a < 7.20000000000000018e-5Initial program 79.8%
Taylor expanded in a around 0
Simplified79.3%
if 7.20000000000000018e-5 < a Initial program 84.2%
Taylor expanded in x around inf
Simplified22.3%
Final simplification50.5%
(FPCore (x y z a) :precision binary64 (if (<= a -1.95) x (if (<= a 7.2e-5) (+ x (- (tan (+ y z)) a)) x)))
double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.95) {
tmp = x;
} else if (a <= 7.2e-5) {
tmp = x + (tan((y + z)) - a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.95d0)) then
tmp = x
else if (a <= 7.2d-5) then
tmp = x + (tan((y + z)) - a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.95) {
tmp = x;
} else if (a <= 7.2e-5) {
tmp = x + (Math.tan((y + z)) - a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if a <= -1.95: tmp = x elif a <= 7.2e-5: tmp = x + (math.tan((y + z)) - a) else: tmp = x return tmp
function code(x, y, z, a) tmp = 0.0 if (a <= -1.95) tmp = x; elseif (a <= 7.2e-5) tmp = Float64(x + Float64(tan(Float64(y + z)) - a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if (a <= -1.95) tmp = x; elseif (a <= 7.2e-5) tmp = x + (tan((y + z)) - a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[a, -1.95], x, If[LessEqual[a, 7.2e-5], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-5}:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - a\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.94999999999999996 or 7.20000000000000018e-5 < a Initial program 81.0%
Taylor expanded in x around inf
Simplified21.6%
if -1.94999999999999996 < a < 7.20000000000000018e-5Initial program 79.8%
Taylor expanded in a around 0
Simplified79.3%
(FPCore (x y z a) :precision binary64 (if (<= a -1.5e-15) x (if (<= a 4.4e-31) (+ x (- (tan y) a)) x)))
double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.5e-15) {
tmp = x;
} else if (a <= 4.4e-31) {
tmp = x + (tan(y) - a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.5d-15)) then
tmp = x
else if (a <= 4.4d-31) then
tmp = x + (tan(y) - a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.5e-15) {
tmp = x;
} else if (a <= 4.4e-31) {
tmp = x + (Math.tan(y) - a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if a <= -1.5e-15: tmp = x elif a <= 4.4e-31: tmp = x + (math.tan(y) - a) else: tmp = x return tmp
function code(x, y, z, a) tmp = 0.0 if (a <= -1.5e-15) tmp = x; elseif (a <= 4.4e-31) tmp = Float64(x + Float64(tan(y) - a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if (a <= -1.5e-15) tmp = x; elseif (a <= 4.4e-31) tmp = x + (tan(y) - a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[a, -1.5e-15], x, If[LessEqual[a, 4.4e-31], N[(x + N[(N[Tan[y], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{-15}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4.4 \cdot 10^{-31}:\\
\;\;\;\;x + \left(\tan y - a\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.5e-15 or 4.40000000000000019e-31 < a Initial program 80.2%
Taylor expanded in x around inf
Simplified22.4%
if -1.5e-15 < a < 4.40000000000000019e-31Initial program 80.6%
Taylor expanded in a around 0
Simplified80.6%
Taylor expanded in y around inf
Simplified59.3%
(FPCore (x y z a) :precision binary64 (if (<= z 1.6e-7) (+ x (- (tan y) a)) (+ x (- (tan z) a))))
double code(double x, double y, double z, double a) {
double tmp;
if (z <= 1.6e-7) {
tmp = x + (tan(y) - a);
} else {
tmp = x + (tan(z) - a);
}
return tmp;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 1.6d-7) then
tmp = x + (tan(y) - a)
else
tmp = x + (tan(z) - a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if (z <= 1.6e-7) {
tmp = x + (Math.tan(y) - a);
} else {
tmp = x + (Math.tan(z) - a);
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if z <= 1.6e-7: tmp = x + (math.tan(y) - a) else: tmp = x + (math.tan(z) - a) return tmp
function code(x, y, z, a) tmp = 0.0 if (z <= 1.6e-7) tmp = Float64(x + Float64(tan(y) - a)); else tmp = Float64(x + Float64(tan(z) - a)); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if (z <= 1.6e-7) tmp = x + (tan(y) - a); else tmp = x + (tan(z) - a); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[z, 1.6e-7], N[(x + N[(N[Tan[y], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[z], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.6 \cdot 10^{-7}:\\
\;\;\;\;x + \left(\tan y - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan z - a\right)\\
\end{array}
\end{array}
if z < 1.6e-7Initial program 88.6%
Taylor expanded in a around 0
Simplified45.7%
Taylor expanded in y around inf
Simplified38.1%
if 1.6e-7 < z Initial program 59.9%
Taylor expanded in a around 0
Simplified28.6%
Taylor expanded in y around 0
Simplified28.6%
(FPCore (x y z a) :precision binary64 x)
double code(double x, double y, double z, double a) {
return x;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double a) {
return x;
}
def code(x, y, z, a): return x
function code(x, y, z, a) return x end
function tmp = code(x, y, z, a) tmp = x; end
code[x_, y_, z_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 80.4%
Taylor expanded in x around inf
Simplified30.4%
herbie shell --seed 2024160
(FPCore (x y z a)
:name "tan-example (used to crash)"
:precision binary64
:pre (and (and (and (or (== x 0.0) (and (<= 0.5884142 x) (<= x 505.5909))) (or (and (<= -1.796658e+308 y) (<= y -9.425585e-310)) (and (<= 1.284938e-309 y) (<= y 1.751224e+308)))) (or (and (<= -1.776707e+308 z) (<= z -8.599796e-310)) (and (<= 3.293145e-311 z) (<= z 1.725154e+308)))) (or (and (<= -1.796658e+308 a) (<= a -9.425585e-310)) (and (<= 1.284938e-309 a) (<= a 1.751224e+308))))
(+ x (- (tan (+ y z)) (tan a))))