
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (/ (- (* y z) x) t_1)) (t_3 (/ x t_1)))
(if (<= t_2 (- INFINITY))
(* y (+ (/ z t_1) (/ x (* y (- t (* z a))))))
(if (<= t_2 -1e-306)
t_2
(if (<= t_2 0.0)
(* (/ -1.0 z) (/ (- x (* y z)) (- a (/ t z))))
(if (<= t_2 5e+293) (- (/ (* y z) t_1) t_3) (- (/ y a) t_3)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = ((y * z) - x) / t_1;
double t_3 = x / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = y * ((z / t_1) + (x / (y * (t - (z * a)))));
} else if (t_2 <= -1e-306) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (-1.0 / z) * ((x - (y * z)) / (a - (t / z)));
} else if (t_2 <= 5e+293) {
tmp = ((y * z) / t_1) - t_3;
} else {
tmp = (y / a) - t_3;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = ((y * z) - x) / t_1;
double t_3 = x / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = y * ((z / t_1) + (x / (y * (t - (z * a)))));
} else if (t_2 <= -1e-306) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (-1.0 / z) * ((x - (y * z)) / (a - (t / z)));
} else if (t_2 <= 5e+293) {
tmp = ((y * z) / t_1) - t_3;
} else {
tmp = (y / a) - t_3;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = ((y * z) - x) / t_1 t_3 = x / t_1 tmp = 0 if t_2 <= -math.inf: tmp = y * ((z / t_1) + (x / (y * (t - (z * a))))) elif t_2 <= -1e-306: tmp = t_2 elif t_2 <= 0.0: tmp = (-1.0 / z) * ((x - (y * z)) / (a - (t / z))) elif t_2 <= 5e+293: tmp = ((y * z) / t_1) - t_3 else: tmp = (y / a) - t_3 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(Float64(y * z) - x) / t_1) t_3 = Float64(x / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(y * Float64(Float64(z / t_1) + Float64(x / Float64(y * Float64(t - Float64(z * a)))))); elseif (t_2 <= -1e-306) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(-1.0 / z) * Float64(Float64(x - Float64(y * z)) / Float64(a - Float64(t / z)))); elseif (t_2 <= 5e+293) tmp = Float64(Float64(Float64(y * z) / t_1) - t_3); else tmp = Float64(Float64(y / a) - t_3); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = ((y * z) - x) / t_1; t_3 = x / t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = y * ((z / t_1) + (x / (y * (t - (z * a))))); elseif (t_2 <= -1e-306) tmp = t_2; elseif (t_2 <= 0.0) tmp = (-1.0 / z) * ((x - (y * z)) / (a - (t / z))); elseif (t_2 <= 5e+293) tmp = ((y * z) / t_1) - t_3; else tmp = (y / a) - t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(y * N[(N[(z / t$95$1), $MachinePrecision] + N[(x / N[(y * N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-306], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(-1.0 / z), $MachinePrecision] * N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+293], N[(N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision] - t$95$3), $MachinePrecision], N[(N[(y / a), $MachinePrecision] - t$95$3), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{y \cdot z - x}{t\_1}\\
t_3 := \frac{x}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;y \cdot \left(\frac{z}{t\_1} + \frac{x}{y \cdot \left(t - z \cdot a\right)}\right)\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-306}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{-1}{z} \cdot \frac{x - y \cdot z}{a - \frac{t}{z}}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+293}:\\
\;\;\;\;\frac{y \cdot z}{t\_1} - t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} - t\_3\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 62.3%
*-commutative62.3%
Simplified62.3%
Taylor expanded in y around inf 99.8%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.00000000000000003e-306Initial program 99.6%
if -1.00000000000000003e-306 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 72.8%
*-commutative72.8%
Simplified72.8%
Taylor expanded in z around inf 72.8%
*-un-lft-identity72.8%
times-frac99.8%
Applied egg-rr99.8%
if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5.00000000000000033e293Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
if 5.00000000000000033e293 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 36.3%
*-commutative36.3%
Simplified36.3%
Taylor expanded in x around 0 36.3%
Taylor expanded in z around inf 89.8%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (/ x t_1)) (t_3 (/ (- (* y z) x) t_1)))
(if (<= t_3 -1e-306)
t_3
(if (<= t_3 0.0)
(* (/ -1.0 z) (/ (- x (* y z)) (- a (/ t z))))
(if (<= t_3 5e+293) (- (/ (* y z) t_1) t_2) (- (/ y a) t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = x / t_1;
double t_3 = ((y * z) - x) / t_1;
double tmp;
if (t_3 <= -1e-306) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = (-1.0 / z) * ((x - (y * z)) / (a - (t / z)));
} else if (t_3 <= 5e+293) {
tmp = ((y * z) / t_1) - t_2;
} else {
tmp = (y / a) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (z * a) - t
t_2 = x / t_1
t_3 = ((y * z) - x) / t_1
if (t_3 <= (-1d-306)) then
tmp = t_3
else if (t_3 <= 0.0d0) then
tmp = ((-1.0d0) / z) * ((x - (y * z)) / (a - (t / z)))
else if (t_3 <= 5d+293) then
tmp = ((y * z) / t_1) - t_2
else
tmp = (y / a) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = x / t_1;
double t_3 = ((y * z) - x) / t_1;
double tmp;
if (t_3 <= -1e-306) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = (-1.0 / z) * ((x - (y * z)) / (a - (t / z)));
} else if (t_3 <= 5e+293) {
tmp = ((y * z) / t_1) - t_2;
} else {
tmp = (y / a) - t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = x / t_1 t_3 = ((y * z) - x) / t_1 tmp = 0 if t_3 <= -1e-306: tmp = t_3 elif t_3 <= 0.0: tmp = (-1.0 / z) * ((x - (y * z)) / (a - (t / z))) elif t_3 <= 5e+293: tmp = ((y * z) / t_1) - t_2 else: tmp = (y / a) - t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(x / t_1) t_3 = Float64(Float64(Float64(y * z) - x) / t_1) tmp = 0.0 if (t_3 <= -1e-306) tmp = t_3; elseif (t_3 <= 0.0) tmp = Float64(Float64(-1.0 / z) * Float64(Float64(x - Float64(y * z)) / Float64(a - Float64(t / z)))); elseif (t_3 <= 5e+293) tmp = Float64(Float64(Float64(y * z) / t_1) - t_2); else tmp = Float64(Float64(y / a) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = x / t_1; t_3 = ((y * z) - x) / t_1; tmp = 0.0; if (t_3 <= -1e-306) tmp = t_3; elseif (t_3 <= 0.0) tmp = (-1.0 / z) * ((x - (y * z)) / (a - (t / z))); elseif (t_3 <= 5e+293) tmp = ((y * z) / t_1) - t_2; else tmp = (y / a) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(x / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-306], t$95$3, If[LessEqual[t$95$3, 0.0], N[(N[(-1.0 / z), $MachinePrecision] * N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+293], N[(N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(y / a), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{x}{t\_1}\\
t_3 := \frac{y \cdot z - x}{t\_1}\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-306}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{-1}{z} \cdot \frac{x - y \cdot z}{a - \frac{t}{z}}\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+293}:\\
\;\;\;\;\frac{y \cdot z}{t\_1} - t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} - t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.00000000000000003e-306Initial program 93.1%
if -1.00000000000000003e-306 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 72.8%
*-commutative72.8%
Simplified72.8%
Taylor expanded in z around inf 72.8%
*-un-lft-identity72.8%
times-frac99.8%
Applied egg-rr99.8%
if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5.00000000000000033e293Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
if 5.00000000000000033e293 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 36.3%
*-commutative36.3%
Simplified36.3%
Taylor expanded in x around 0 36.3%
Taylor expanded in z around inf 89.8%
Final simplification95.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)) (t_2 (/ (- (* y z) x) t_1)))
(if (<= t_2 -1e-306)
t_2
(if (<= t_2 0.0)
(* (/ -1.0 z) (/ (- x (* y z)) (- a (/ t z))))
(if (<= t_2 5e+293) t_2 (- (/ y a) (/ x t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = ((y * z) - x) / t_1;
double tmp;
if (t_2 <= -1e-306) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (-1.0 / z) * ((x - (y * z)) / (a - (t / z)));
} else if (t_2 <= 5e+293) {
tmp = t_2;
} else {
tmp = (y / a) - (x / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z * a) - t
t_2 = ((y * z) - x) / t_1
if (t_2 <= (-1d-306)) then
tmp = t_2
else if (t_2 <= 0.0d0) then
tmp = ((-1.0d0) / z) * ((x - (y * z)) / (a - (t / z)))
else if (t_2 <= 5d+293) then
tmp = t_2
else
tmp = (y / a) - (x / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = ((y * z) - x) / t_1;
double tmp;
if (t_2 <= -1e-306) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (-1.0 / z) * ((x - (y * z)) / (a - (t / z)));
} else if (t_2 <= 5e+293) {
tmp = t_2;
} else {
tmp = (y / a) - (x / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = ((y * z) - x) / t_1 tmp = 0 if t_2 <= -1e-306: tmp = t_2 elif t_2 <= 0.0: tmp = (-1.0 / z) * ((x - (y * z)) / (a - (t / z))) elif t_2 <= 5e+293: tmp = t_2 else: tmp = (y / a) - (x / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(Float64(y * z) - x) / t_1) tmp = 0.0 if (t_2 <= -1e-306) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(-1.0 / z) * Float64(Float64(x - Float64(y * z)) / Float64(a - Float64(t / z)))); elseif (t_2 <= 5e+293) tmp = t_2; else tmp = Float64(Float64(y / a) - Float64(x / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = ((y * z) - x) / t_1; tmp = 0.0; if (t_2 <= -1e-306) tmp = t_2; elseif (t_2 <= 0.0) tmp = (-1.0 / z) * ((x - (y * z)) / (a - (t / z))); elseif (t_2 <= 5e+293) tmp = t_2; else tmp = (y / a) - (x / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-306], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(-1.0 / z), $MachinePrecision] * N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+293], t$95$2, N[(N[(y / a), $MachinePrecision] - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{y \cdot z - x}{t\_1}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-306}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{-1}{z} \cdot \frac{x - y \cdot z}{a - \frac{t}{z}}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+293}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} - \frac{x}{t\_1}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.00000000000000003e-306 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 5.00000000000000033e293Initial program 95.6%
if -1.00000000000000003e-306 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 72.8%
*-commutative72.8%
Simplified72.8%
Taylor expanded in z around inf 72.8%
*-un-lft-identity72.8%
times-frac99.8%
Applied egg-rr99.8%
if 5.00000000000000033e293 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 36.3%
*-commutative36.3%
Simplified36.3%
Taylor expanded in x around 0 36.3%
Taylor expanded in z around inf 89.8%
Final simplification95.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)))
(if (<= z -1.45e+98)
(/ y (- a (/ t z)))
(if (<= z 6.8e+72)
(/ (- (* y z) x) t_1)
(+ (/ y a) (* x (/ -1.0 t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double tmp;
if (z <= -1.45e+98) {
tmp = y / (a - (t / z));
} else if (z <= 6.8e+72) {
tmp = ((y * z) - x) / t_1;
} else {
tmp = (y / a) + (x * (-1.0 / t_1));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (z * a) - t
if (z <= (-1.45d+98)) then
tmp = y / (a - (t / z))
else if (z <= 6.8d+72) then
tmp = ((y * z) - x) / t_1
else
tmp = (y / a) + (x * ((-1.0d0) / t_1))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double tmp;
if (z <= -1.45e+98) {
tmp = y / (a - (t / z));
} else if (z <= 6.8e+72) {
tmp = ((y * z) - x) / t_1;
} else {
tmp = (y / a) + (x * (-1.0 / t_1));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t tmp = 0 if z <= -1.45e+98: tmp = y / (a - (t / z)) elif z <= 6.8e+72: tmp = ((y * z) - x) / t_1 else: tmp = (y / a) + (x * (-1.0 / t_1)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) tmp = 0.0 if (z <= -1.45e+98) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (z <= 6.8e+72) tmp = Float64(Float64(Float64(y * z) - x) / t_1); else tmp = Float64(Float64(y / a) + Float64(x * Float64(-1.0 / t_1))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; tmp = 0.0; if (z <= -1.45e+98) tmp = y / (a - (t / z)); elseif (z <= 6.8e+72) tmp = ((y * z) - x) / t_1; else tmp = (y / a) + (x * (-1.0 / t_1)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[z, -1.45e+98], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+72], N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(y / a), $MachinePrecision] + N[(x * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+98}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+72}:\\
\;\;\;\;\frac{y \cdot z - x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} + x \cdot \frac{-1}{t\_1}\\
\end{array}
\end{array}
if z < -1.45000000000000005e98Initial program 49.0%
*-commutative49.0%
Simplified49.0%
Taylor expanded in z around inf 49.0%
Taylor expanded in x around 0 84.1%
associate-*r/84.1%
mul-1-neg84.1%
Simplified84.1%
if -1.45000000000000005e98 < z < 6.7999999999999997e72Initial program 98.6%
if 6.7999999999999997e72 < z Initial program 65.6%
*-commutative65.6%
Simplified65.6%
Taylor expanded in x around 0 65.6%
Taylor expanded in z around inf 83.9%
div-inv84.0%
*-commutative84.0%
Applied egg-rr84.0%
Final simplification93.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.8e+64) (not (<= t 9.5e+67))) (/ (- x (* y z)) t) (- (/ y a) (/ x (- (* z a) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.8e+64) || !(t <= 9.5e+67)) {
tmp = (x - (y * z)) / t;
} else {
tmp = (y / a) - (x / ((z * a) - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-6.8d+64)) .or. (.not. (t <= 9.5d+67))) then
tmp = (x - (y * z)) / t
else
tmp = (y / a) - (x / ((z * a) - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.8e+64) || !(t <= 9.5e+67)) {
tmp = (x - (y * z)) / t;
} else {
tmp = (y / a) - (x / ((z * a) - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.8e+64) or not (t <= 9.5e+67): tmp = (x - (y * z)) / t else: tmp = (y / a) - (x / ((z * a) - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.8e+64) || !(t <= 9.5e+67)) tmp = Float64(Float64(x - Float64(y * z)) / t); else tmp = Float64(Float64(y / a) - Float64(x / Float64(Float64(z * a) - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.8e+64) || ~((t <= 9.5e+67))) tmp = (x - (y * z)) / t; else tmp = (y / a) - (x / ((z * a) - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.8e+64], N[Not[LessEqual[t, 9.5e+67]], $MachinePrecision]], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(y / a), $MachinePrecision] - N[(x / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{+64} \lor \neg \left(t \leq 9.5 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a - t}\\
\end{array}
\end{array}
if t < -6.8000000000000003e64 or 9.5000000000000002e67 < t Initial program 85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in t around inf 75.5%
*-commutative75.5%
Simplified75.5%
if -6.8000000000000003e64 < t < 9.5000000000000002e67Initial program 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in x around 0 84.4%
Taylor expanded in z around inf 90.0%
Final simplification83.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.15e-93) (/ y a) (if (<= z 4e-32) (/ x t) (if (<= z 1.02e+29) (* z (/ y (- t))) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.15e-93) {
tmp = y / a;
} else if (z <= 4e-32) {
tmp = x / t;
} else if (z <= 1.02e+29) {
tmp = z * (y / -t);
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.15d-93)) then
tmp = y / a
else if (z <= 4d-32) then
tmp = x / t
else if (z <= 1.02d+29) then
tmp = z * (y / -t)
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.15e-93) {
tmp = y / a;
} else if (z <= 4e-32) {
tmp = x / t;
} else if (z <= 1.02e+29) {
tmp = z * (y / -t);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.15e-93: tmp = y / a elif z <= 4e-32: tmp = x / t elif z <= 1.02e+29: tmp = z * (y / -t) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.15e-93) tmp = Float64(y / a); elseif (z <= 4e-32) tmp = Float64(x / t); elseif (z <= 1.02e+29) tmp = Float64(z * Float64(y / Float64(-t))); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.15e-93) tmp = y / a; elseif (z <= 4e-32) tmp = x / t; elseif (z <= 1.02e+29) tmp = z * (y / -t); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.15e-93], N[(y / a), $MachinePrecision], If[LessEqual[z, 4e-32], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.02e+29], N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-93}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-32}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+29}:\\
\;\;\;\;z \cdot \frac{y}{-t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.1499999999999999e-93 or 1.0200000000000001e29 < z Initial program 72.7%
*-commutative72.7%
Simplified72.7%
Taylor expanded in z around inf 56.2%
if -1.1499999999999999e-93 < z < 4.00000000000000022e-32Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 69.1%
if 4.00000000000000022e-32 < z < 1.0200000000000001e29Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 70.6%
mul-1-neg70.6%
associate-/l*70.5%
distribute-rgt-neg-in70.5%
sub-neg70.5%
mul-1-neg70.5%
+-commutative70.5%
mul-1-neg70.5%
distribute-rgt-neg-in70.5%
fma-undefine70.5%
distribute-neg-frac270.5%
neg-sub070.5%
fma-undefine70.5%
distribute-rgt-neg-in70.5%
distribute-lft-neg-in70.5%
*-commutative70.5%
associate--r+70.5%
neg-sub070.5%
distribute-rgt-neg-out70.5%
remove-double-neg70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in z around 0 64.0%
associate-*r/64.0%
neg-mul-164.0%
Simplified64.0%
Taylor expanded in y around 0 64.1%
mul-1-neg64.1%
*-commutative64.1%
associate-/l*64.1%
distribute-lft-neg-in64.1%
Simplified64.1%
Final simplification61.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.6e-95) (/ y a) (if (<= z 3e-40) (/ x t) (if (<= z 1.22e+29) (* y (/ z (- t))) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e-95) {
tmp = y / a;
} else if (z <= 3e-40) {
tmp = x / t;
} else if (z <= 1.22e+29) {
tmp = y * (z / -t);
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.6d-95)) then
tmp = y / a
else if (z <= 3d-40) then
tmp = x / t
else if (z <= 1.22d+29) then
tmp = y * (z / -t)
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e-95) {
tmp = y / a;
} else if (z <= 3e-40) {
tmp = x / t;
} else if (z <= 1.22e+29) {
tmp = y * (z / -t);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.6e-95: tmp = y / a elif z <= 3e-40: tmp = x / t elif z <= 1.22e+29: tmp = y * (z / -t) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.6e-95) tmp = Float64(y / a); elseif (z <= 3e-40) tmp = Float64(x / t); elseif (z <= 1.22e+29) tmp = Float64(y * Float64(z / Float64(-t))); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.6e-95) tmp = y / a; elseif (z <= 3e-40) tmp = x / t; elseif (z <= 1.22e+29) tmp = y * (z / -t); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.6e-95], N[(y / a), $MachinePrecision], If[LessEqual[z, 3e-40], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.22e+29], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-95}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-40}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{+29}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.6e-95 or 1.22e29 < z Initial program 72.7%
*-commutative72.7%
Simplified72.7%
Taylor expanded in z around inf 56.2%
if -3.6e-95 < z < 3.0000000000000002e-40Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 69.1%
if 3.0000000000000002e-40 < z < 1.22e29Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 70.6%
mul-1-neg70.6%
associate-/l*70.5%
distribute-rgt-neg-in70.5%
sub-neg70.5%
mul-1-neg70.5%
+-commutative70.5%
mul-1-neg70.5%
distribute-rgt-neg-in70.5%
fma-undefine70.5%
distribute-neg-frac270.5%
neg-sub070.5%
fma-undefine70.5%
distribute-rgt-neg-in70.5%
distribute-lft-neg-in70.5%
*-commutative70.5%
associate--r+70.5%
neg-sub070.5%
distribute-rgt-neg-out70.5%
remove-double-neg70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in z around 0 64.0%
associate-*r/64.0%
neg-mul-164.0%
Simplified64.0%
Final simplification61.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)))
(if (<= z -1.45e+98)
(/ y (- a (/ t z)))
(if (<= z 1.95e+74) (/ (- (* y z) x) t_1) (- (/ y a) (/ x t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double tmp;
if (z <= -1.45e+98) {
tmp = y / (a - (t / z));
} else if (z <= 1.95e+74) {
tmp = ((y * z) - x) / t_1;
} else {
tmp = (y / a) - (x / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (z * a) - t
if (z <= (-1.45d+98)) then
tmp = y / (a - (t / z))
else if (z <= 1.95d+74) then
tmp = ((y * z) - x) / t_1
else
tmp = (y / a) - (x / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double tmp;
if (z <= -1.45e+98) {
tmp = y / (a - (t / z));
} else if (z <= 1.95e+74) {
tmp = ((y * z) - x) / t_1;
} else {
tmp = (y / a) - (x / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t tmp = 0 if z <= -1.45e+98: tmp = y / (a - (t / z)) elif z <= 1.95e+74: tmp = ((y * z) - x) / t_1 else: tmp = (y / a) - (x / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) tmp = 0.0 if (z <= -1.45e+98) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (z <= 1.95e+74) tmp = Float64(Float64(Float64(y * z) - x) / t_1); else tmp = Float64(Float64(y / a) - Float64(x / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; tmp = 0.0; if (z <= -1.45e+98) tmp = y / (a - (t / z)); elseif (z <= 1.95e+74) tmp = ((y * z) - x) / t_1; else tmp = (y / a) - (x / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[z, -1.45e+98], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95e+74], N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(y / a), $MachinePrecision] - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+98}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+74}:\\
\;\;\;\;\frac{y \cdot z - x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} - \frac{x}{t\_1}\\
\end{array}
\end{array}
if z < -1.45000000000000005e98Initial program 49.0%
*-commutative49.0%
Simplified49.0%
Taylor expanded in z around inf 49.0%
Taylor expanded in x around 0 84.1%
associate-*r/84.1%
mul-1-neg84.1%
Simplified84.1%
if -1.45000000000000005e98 < z < 1.95000000000000004e74Initial program 98.6%
if 1.95000000000000004e74 < z Initial program 65.6%
*-commutative65.6%
Simplified65.6%
Taylor expanded in x around 0 65.6%
Taylor expanded in z around inf 83.9%
Final simplification93.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.15e-93) (not (<= z 4.7))) (/ (- y (/ x z)) a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e-93) || !(z <= 4.7)) {
tmp = (y - (x / z)) / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.15d-93)) .or. (.not. (z <= 4.7d0))) then
tmp = (y - (x / z)) / a
else
tmp = x / (t - (z * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e-93) || !(z <= 4.7)) {
tmp = (y - (x / z)) / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.15e-93) or not (z <= 4.7): tmp = (y - (x / z)) / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.15e-93) || !(z <= 4.7)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(x / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.15e-93) || ~((z <= 4.7))) tmp = (y - (x / z)) / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.15e-93], N[Not[LessEqual[z, 4.7]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-93} \lor \neg \left(z \leq 4.7\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -1.1499999999999999e-93 or 4.70000000000000018 < z Initial program 73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in z around inf 73.8%
Taylor expanded in t around 0 74.1%
mul-1-neg74.1%
distribute-frac-neg74.1%
sub-neg74.1%
+-commutative74.1%
distribute-neg-in74.1%
remove-double-neg74.1%
unsub-neg74.1%
Simplified74.1%
if -1.1499999999999999e-93 < z < 4.70000000000000018Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 84.6%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.15e+97) (not (<= z 7600.0))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.15e+97) || !(z <= 7600.0)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.15d+97)) .or. (.not. (z <= 7600.0d0))) then
tmp = y / a
else
tmp = x / (t - (z * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.15e+97) || !(z <= 7600.0)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.15e+97) or not (z <= 7600.0): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.15e+97) || !(z <= 7600.0)) tmp = Float64(y / a); else tmp = Float64(x / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.15e+97) || ~((z <= 7600.0))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.15e+97], N[Not[LessEqual[z, 7600.0]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.15 \cdot 10^{+97} \lor \neg \left(z \leq 7600\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -3.14999999999999999e97 or 7600 < z Initial program 65.5%
*-commutative65.5%
Simplified65.5%
Taylor expanded in z around inf 63.8%
if -3.14999999999999999e97 < z < 7600Initial program 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in x around inf 76.7%
Final simplification71.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.15e-93) (/ (- y (/ x z)) a) (if (<= z 7e-12) (/ x (- t (* z a))) (/ y (- a (/ t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.15e-93) {
tmp = (y - (x / z)) / a;
} else if (z <= 7e-12) {
tmp = x / (t - (z * a));
} else {
tmp = y / (a - (t / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.15d-93)) then
tmp = (y - (x / z)) / a
else if (z <= 7d-12) then
tmp = x / (t - (z * a))
else
tmp = y / (a - (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.15e-93) {
tmp = (y - (x / z)) / a;
} else if (z <= 7e-12) {
tmp = x / (t - (z * a));
} else {
tmp = y / (a - (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.15e-93: tmp = (y - (x / z)) / a elif z <= 7e-12: tmp = x / (t - (z * a)) else: tmp = y / (a - (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.15e-93) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (z <= 7e-12) tmp = Float64(x / Float64(t - Float64(z * a))); else tmp = Float64(y / Float64(a - Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.15e-93) tmp = (y - (x / z)) / a; elseif (z <= 7e-12) tmp = x / (t - (z * a)); else tmp = y / (a - (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.15e-93], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 7e-12], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-93}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\end{array}
\end{array}
if z < -1.1499999999999999e-93Initial program 71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in z around inf 71.8%
Taylor expanded in t around 0 75.5%
mul-1-neg75.5%
distribute-frac-neg75.5%
sub-neg75.5%
+-commutative75.5%
distribute-neg-in75.5%
remove-double-neg75.5%
unsub-neg75.5%
Simplified75.5%
if -1.1499999999999999e-93 < z < 7.0000000000000001e-12Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 86.0%
if 7.0000000000000001e-12 < z Initial program 77.0%
*-commutative77.0%
Simplified77.0%
Taylor expanded in z around inf 77.0%
Taylor expanded in x around 0 77.8%
associate-*r/77.8%
mul-1-neg77.8%
Simplified77.8%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.15e-93) (not (<= z 0.001))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e-93) || !(z <= 0.001)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.15d-93)) .or. (.not. (z <= 0.001d0))) then
tmp = y / a
else
tmp = x / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e-93) || !(z <= 0.001)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.15e-93) or not (z <= 0.001): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.15e-93) || !(z <= 0.001)) tmp = Float64(y / a); else tmp = Float64(x / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.15e-93) || ~((z <= 0.001))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.15e-93], N[Not[LessEqual[z, 0.001]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-93} \lor \neg \left(z \leq 0.001\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -1.1499999999999999e-93 or 1e-3 < z Initial program 73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in z around inf 55.4%
if -1.1499999999999999e-93 < z < 1e-3Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 65.7%
Final simplification59.7%
(FPCore (x y z t a) :precision binary64 (/ x t))
double code(double x, double y, double z, double t, double a) {
return x / t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x / t
end function
public static double code(double x, double y, double z, double t, double a) {
return x / t;
}
def code(x, y, z, t, a): return x / t
function code(x, y, z, t, a) return Float64(x / t) end
function tmp = code(x, y, z, t, a) tmp = x / t; end
code[x_, y_, z_, t_, a_] := N[(x / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{t}
\end{array}
Initial program 84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in z around 0 36.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
(if (< z -32113435955957344.0)
t_2
(if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t - (a * z)
t_2 = (x / t_1) - (y / ((t / z) - a))
if (z < (-32113435955957344.0d0)) then
tmp = t_2
else if (z < 3.5139522372978296d-86) then
tmp = (x - (y * z)) * (1.0d0 / t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (a * z) t_2 = (x / t_1) - (y / ((t / z) - a)) tmp = 0 if z < -32113435955957344.0: tmp = t_2 elif z < 3.5139522372978296e-86: tmp = (x - (y * z)) * (1.0 / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a))) tmp = 0.0 if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (a * z); t_2 = (x / t_1) - (y / ((t / z) - a)); tmp = 0.0; if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = (x - (y * z)) * (1.0 / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
t_2 := \frac{x}{t\_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{if}\;z < -32113435955957344:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
\;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024136
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:alt
(! :herbie-platform default (if (< z -32113435955957344) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 4392440296622287/125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* (- x (* y z)) (/ 1 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))))))
(/ (- x (* y z)) (- t (* a z))))