
(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 11 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 (- t (* z a)))
(t_2 (/ (- (/ x z) y) (/ t_1 z)))
(t_3 (/ (- x (* y z)) t_1)))
(if (<= t_3 (- INFINITY))
t_2
(if (<= t_3 -2e-319)
t_3
(if (<= t_3 0.0)
(* (/ 1.0 z) (/ (- (* y z) x) a))
(if (<= t_3 5e+284) t_3 (if (<= t_3 INFINITY) t_2 (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = ((x / z) - y) / (t_1 / z);
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_3 <= -2e-319) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = (1.0 / z) * (((y * z) - x) / a);
} else if (t_3 <= 5e+284) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = ((x / z) - y) / (t_1 / z);
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_3 <= -2e-319) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = (1.0 / z) * (((y * z) - x) / a);
} else if (t_3 <= 5e+284) {
tmp = t_3;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = ((x / z) - y) / (t_1 / z) t_3 = (x - (y * z)) / t_1 tmp = 0 if t_3 <= -math.inf: tmp = t_2 elif t_3 <= -2e-319: tmp = t_3 elif t_3 <= 0.0: tmp = (1.0 / z) * (((y * z) - x) / a) elif t_3 <= 5e+284: tmp = t_3 elif t_3 <= math.inf: tmp = t_2 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(Float64(Float64(x / z) - y) / Float64(t_1 / z)) t_3 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_2; elseif (t_3 <= -2e-319) tmp = t_3; elseif (t_3 <= 0.0) tmp = Float64(Float64(1.0 / z) * Float64(Float64(Float64(y * z) - x) / a)); elseif (t_3 <= 5e+284) tmp = t_3; elseif (t_3 <= Inf) tmp = t_2; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = ((x / z) - y) / (t_1 / z); t_3 = (x - (y * z)) / t_1; tmp = 0.0; if (t_3 <= -Inf) tmp = t_2; elseif (t_3 <= -2e-319) tmp = t_3; elseif (t_3 <= 0.0) tmp = (1.0 / z) * (((y * z) - x) / a); elseif (t_3 <= 5e+284) tmp = t_3; elseif (t_3 <= Inf) tmp = t_2; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x / z), $MachinePrecision] - y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$2, If[LessEqual[t$95$3, -2e-319], t$95$3, If[LessEqual[t$95$3, 0.0], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+284], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$2, N[(y / a), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{\frac{x}{z} - y}{\frac{t\_1}{z}}\\
t_3 := \frac{x - y \cdot z}{t\_1}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-319}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{1}{z} \cdot \frac{y \cdot z - x}{a}\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+284}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0 or 4.9999999999999999e284 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 71.8%
*-commutative71.8%
Simplified71.8%
div-sub71.8%
associate-/l*100.0%
Applied egg-rr100.0%
frac-sub71.3%
associate-/r*71.7%
Applied egg-rr71.7%
Taylor expanded in x around -inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
sub-neg100.0%
Simplified100.0%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.99998e-319 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 4.9999999999999999e284Initial program 99.7%
if -1.99998e-319 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 49.8%
*-commutative49.8%
Simplified49.8%
Taylor expanded in t around 0 29.9%
associate-*r/29.9%
neg-mul-129.9%
neg-sub029.9%
sub-neg29.9%
distribute-rgt-neg-out29.9%
+-commutative29.9%
associate--r+29.9%
neg-sub029.9%
distribute-rgt-neg-out29.9%
remove-double-neg29.9%
*-commutative29.9%
Simplified29.9%
*-un-lft-identity29.9%
times-frac86.1%
*-commutative86.1%
Applied egg-rr86.1%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification98.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a)))
(t_2 (- (/ x t_1) (/ y (/ t_1 z))))
(t_3 (/ (- x (* y z)) t_1)))
(if (<= t_3 -2e-319)
t_2
(if (<= t_3 0.0)
(* (/ 1.0 z) (/ (- (* y z) x) a))
(if (<= t_3 1e-17)
(/ (fma y (- z) x) t_1)
(if (<= t_3 INFINITY) t_2 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x / t_1) - (y / (t_1 / z));
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -2e-319) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = (1.0 / z) * (((y * z) - x) / a);
} else if (t_3 <= 1e-17) {
tmp = fma(y, -z, x) / t_1;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(t_1 / z))) t_3 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_3 <= -2e-319) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(Float64(1.0 / z) * Float64(Float64(Float64(y * z) - x) / a)); elseif (t_3 <= 1e-17) tmp = Float64(fma(y, Float64(-z), x) / t_1); elseif (t_3 <= Inf) tmp = t_2; else tmp = Float64(y / a); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-319], t$95$2, If[LessEqual[t$95$3, 0.0], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-17], N[(N[(y * (-z) + x), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$2, N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x}{t\_1} - \frac{y}{\frac{t\_1}{z}}\\
t_3 := \frac{x - y \cdot z}{t\_1}\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{-319}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{1}{z} \cdot \frac{y \cdot z - x}{a}\\
\mathbf{elif}\;t\_3 \leq 10^{-17}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, -z, x\right)}{t\_1}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.99998e-319 or 1.00000000000000007e-17 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 92.7%
*-commutative92.7%
Simplified92.7%
div-sub92.7%
associate-/l*97.6%
Applied egg-rr97.6%
if -1.99998e-319 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 49.8%
*-commutative49.8%
Simplified49.8%
Taylor expanded in t around 0 29.9%
associate-*r/29.9%
neg-mul-129.9%
neg-sub029.9%
sub-neg29.9%
distribute-rgt-neg-out29.9%
+-commutative29.9%
associate--r+29.9%
neg-sub029.9%
distribute-rgt-neg-out29.9%
remove-double-neg29.9%
*-commutative29.9%
Simplified29.9%
*-un-lft-identity29.9%
times-frac86.1%
*-commutative86.1%
Applied egg-rr86.1%
if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1.00000000000000007e-17Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
*-commutative99.9%
mul-1-neg99.9%
associate-/l*89.4%
*-commutative89.4%
sub-neg89.4%
associate-/r/94.9%
associate-*l/99.9%
div-sub99.9%
sub-neg99.9%
distribute-rgt-neg-out99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification96.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a)))
(t_2 (- (/ x t_1) (/ y (/ t_1 z))))
(t_3 (/ (- x (* y z)) t_1)))
(if (<= t_3 -2e-319)
t_2
(if (<= t_3 0.0)
(* (/ 1.0 z) (/ (- (* y z) x) a))
(if (<= t_3 1e-17) t_3 (if (<= t_3 INFINITY) t_2 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x / t_1) - (y / (t_1 / z));
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -2e-319) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = (1.0 / z) * (((y * z) - x) / a);
} else if (t_3 <= 1e-17) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x / t_1) - (y / (t_1 / z));
double t_3 = (x - (y * z)) / t_1;
double tmp;
if (t_3 <= -2e-319) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = (1.0 / z) * (((y * z) - x) / a);
} else if (t_3 <= 1e-17) {
tmp = t_3;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = (x / t_1) - (y / (t_1 / z)) t_3 = (x - (y * z)) / t_1 tmp = 0 if t_3 <= -2e-319: tmp = t_2 elif t_3 <= 0.0: tmp = (1.0 / z) * (((y * z) - x) / a) elif t_3 <= 1e-17: tmp = t_3 elif t_3 <= math.inf: tmp = t_2 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(t_1 / z))) t_3 = Float64(Float64(x - Float64(y * z)) / t_1) tmp = 0.0 if (t_3 <= -2e-319) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(Float64(1.0 / z) * Float64(Float64(Float64(y * z) - x) / a)); elseif (t_3 <= 1e-17) tmp = t_3; elseif (t_3 <= Inf) tmp = t_2; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = (x / t_1) - (y / (t_1 / z)); t_3 = (x - (y * z)) / t_1; tmp = 0.0; if (t_3 <= -2e-319) tmp = t_2; elseif (t_3 <= 0.0) tmp = (1.0 / z) * (((y * z) - x) / a); elseif (t_3 <= 1e-17) tmp = t_3; elseif (t_3 <= Inf) tmp = t_2; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-319], t$95$2, If[LessEqual[t$95$3, 0.0], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-17], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$2, N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x}{t\_1} - \frac{y}{\frac{t\_1}{z}}\\
t_3 := \frac{x - y \cdot z}{t\_1}\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{-319}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{1}{z} \cdot \frac{y \cdot z - x}{a}\\
\mathbf{elif}\;t\_3 \leq 10^{-17}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -1.99998e-319 or 1.00000000000000007e-17 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 92.7%
*-commutative92.7%
Simplified92.7%
div-sub92.7%
associate-/l*97.6%
Applied egg-rr97.6%
if -1.99998e-319 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 49.8%
*-commutative49.8%
Simplified49.8%
Taylor expanded in t around 0 29.9%
associate-*r/29.9%
neg-mul-129.9%
neg-sub029.9%
sub-neg29.9%
distribute-rgt-neg-out29.9%
+-commutative29.9%
associate--r+29.9%
neg-sub029.9%
distribute-rgt-neg-out29.9%
remove-double-neg29.9%
*-commutative29.9%
Simplified29.9%
*-un-lft-identity29.9%
times-frac86.1%
*-commutative86.1%
Applied egg-rr86.1%
if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 1.00000000000000007e-17Initial program 99.9%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification96.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a)))
(t_2 (/ (- y (/ x z)) a))
(t_3 (* y (/ (- z) t_1))))
(if (<= z -1e-104)
t_2
(if (<= z 6.7e-128)
(/ (- x (* y z)) t)
(if (<= z 4.8e-61)
t_3
(if (<= z 2.55e-28)
(/ x t_1)
(if (or (<= z 1.7e+198) (not (<= z 1e+267))) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (y - (x / z)) / a;
double t_3 = y * (-z / t_1);
double tmp;
if (z <= -1e-104) {
tmp = t_2;
} else if (z <= 6.7e-128) {
tmp = (x - (y * z)) / t;
} else if (z <= 4.8e-61) {
tmp = t_3;
} else if (z <= 2.55e-28) {
tmp = x / t_1;
} else if ((z <= 1.7e+198) || !(z <= 1e+267)) {
tmp = t_2;
} else {
tmp = t_3;
}
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 = t - (z * a)
t_2 = (y - (x / z)) / a
t_3 = y * (-z / t_1)
if (z <= (-1d-104)) then
tmp = t_2
else if (z <= 6.7d-128) then
tmp = (x - (y * z)) / t
else if (z <= 4.8d-61) then
tmp = t_3
else if (z <= 2.55d-28) then
tmp = x / t_1
else if ((z <= 1.7d+198) .or. (.not. (z <= 1d+267))) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (y - (x / z)) / a;
double t_3 = y * (-z / t_1);
double tmp;
if (z <= -1e-104) {
tmp = t_2;
} else if (z <= 6.7e-128) {
tmp = (x - (y * z)) / t;
} else if (z <= 4.8e-61) {
tmp = t_3;
} else if (z <= 2.55e-28) {
tmp = x / t_1;
} else if ((z <= 1.7e+198) || !(z <= 1e+267)) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = (y - (x / z)) / a t_3 = y * (-z / t_1) tmp = 0 if z <= -1e-104: tmp = t_2 elif z <= 6.7e-128: tmp = (x - (y * z)) / t elif z <= 4.8e-61: tmp = t_3 elif z <= 2.55e-28: tmp = x / t_1 elif (z <= 1.7e+198) or not (z <= 1e+267): tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(Float64(y - Float64(x / z)) / a) t_3 = Float64(y * Float64(Float64(-z) / t_1)) tmp = 0.0 if (z <= -1e-104) tmp = t_2; elseif (z <= 6.7e-128) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 4.8e-61) tmp = t_3; elseif (z <= 2.55e-28) tmp = Float64(x / t_1); elseif ((z <= 1.7e+198) || !(z <= 1e+267)) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = (y - (x / z)) / a; t_3 = y * (-z / t_1); tmp = 0.0; if (z <= -1e-104) tmp = t_2; elseif (z <= 6.7e-128) tmp = (x - (y * z)) / t; elseif (z <= 4.8e-61) tmp = t_3; elseif (z <= 2.55e-28) tmp = x / t_1; elseif ((z <= 1.7e+198) || ~((z <= 1e+267))) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[(y * N[((-z) / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e-104], t$95$2, If[LessEqual[z, 6.7e-128], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 4.8e-61], t$95$3, If[LessEqual[z, 2.55e-28], N[(x / t$95$1), $MachinePrecision], If[Or[LessEqual[z, 1.7e+198], N[Not[LessEqual[z, 1e+267]], $MachinePrecision]], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
t_3 := y \cdot \frac{-z}{t\_1}\\
\mathbf{if}\;z \leq -1 \cdot 10^{-104}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 6.7 \cdot 10^{-128}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-61}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-28}:\\
\;\;\;\;\frac{x}{t\_1}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+198} \lor \neg \left(z \leq 10^{+267}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -9.99999999999999927e-105 or 2.55000000000000004e-28 < z < 1.7e198 or 9.9999999999999997e266 < z Initial program 77.6%
*-commutative77.6%
Simplified77.6%
div-sub77.6%
associate-/l*85.1%
Applied egg-rr85.1%
Taylor expanded in t around 0 79.4%
distribute-lft-out--79.4%
*-commutative79.4%
associate-/r*80.8%
div-sub80.8%
mul-1-neg80.8%
Simplified80.8%
if -9.99999999999999927e-105 < z < 6.70000000000000027e-128Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 80.2%
if 6.70000000000000027e-128 < z < 4.8000000000000002e-61 or 1.7e198 < z < 9.9999999999999997e266Initial program 90.3%
*-commutative90.3%
Simplified90.3%
div-sub90.3%
associate-/l*99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 71.7%
mul-1-neg71.7%
*-commutative71.7%
associate-*r/80.8%
distribute-rgt-neg-in80.8%
distribute-neg-frac80.8%
*-commutative80.8%
Simplified80.8%
if 4.8000000000000002e-61 < z < 2.55000000000000004e-28Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 81.1%
*-commutative81.1%
Simplified81.1%
Final simplification80.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y z))) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -1e-104)
t_2
(if (<= z 6.7e-128)
(/ t_1 t)
(if (or (<= z 4e-116) (not (<= z 9.5e-29))) t_2 (/ 1.0 (/ t t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * z);
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1e-104) {
tmp = t_2;
} else if (z <= 6.7e-128) {
tmp = t_1 / t;
} else if ((z <= 4e-116) || !(z <= 9.5e-29)) {
tmp = t_2;
} else {
tmp = 1.0 / (t / 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 = x - (y * z)
t_2 = (y - (x / z)) / a
if (z <= (-1d-104)) then
tmp = t_2
else if (z <= 6.7d-128) then
tmp = t_1 / t
else if ((z <= 4d-116) .or. (.not. (z <= 9.5d-29))) then
tmp = t_2
else
tmp = 1.0d0 / (t / 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 = x - (y * z);
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1e-104) {
tmp = t_2;
} else if (z <= 6.7e-128) {
tmp = t_1 / t;
} else if ((z <= 4e-116) || !(z <= 9.5e-29)) {
tmp = t_2;
} else {
tmp = 1.0 / (t / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * z) t_2 = (y - (x / z)) / a tmp = 0 if z <= -1e-104: tmp = t_2 elif z <= 6.7e-128: tmp = t_1 / t elif (z <= 4e-116) or not (z <= 9.5e-29): tmp = t_2 else: tmp = 1.0 / (t / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * z)) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -1e-104) tmp = t_2; elseif (z <= 6.7e-128) tmp = Float64(t_1 / t); elseif ((z <= 4e-116) || !(z <= 9.5e-29)) tmp = t_2; else tmp = Float64(1.0 / Float64(t / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * z); t_2 = (y - (x / z)) / a; tmp = 0.0; if (z <= -1e-104) tmp = t_2; elseif (z <= 6.7e-128) tmp = t_1 / t; elseif ((z <= 4e-116) || ~((z <= 9.5e-29))) tmp = t_2; else tmp = 1.0 / (t / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -1e-104], t$95$2, If[LessEqual[z, 6.7e-128], N[(t$95$1 / t), $MachinePrecision], If[Or[LessEqual[z, 4e-116], N[Not[LessEqual[z, 9.5e-29]], $MachinePrecision]], t$95$2, N[(1.0 / N[(t / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot z\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -1 \cdot 10^{-104}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 6.7 \cdot 10^{-128}:\\
\;\;\;\;\frac{t\_1}{t}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-116} \lor \neg \left(z \leq 9.5 \cdot 10^{-29}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{t}{t\_1}}\\
\end{array}
\end{array}
if z < -9.99999999999999927e-105 or 6.70000000000000027e-128 < z < 4e-116 or 9.50000000000000023e-29 < z Initial program 78.2%
*-commutative78.2%
Simplified78.2%
div-sub78.2%
associate-/l*86.7%
Applied egg-rr86.7%
Taylor expanded in t around 0 77.8%
distribute-lft-out--77.8%
*-commutative77.8%
associate-/r*79.0%
div-sub79.0%
mul-1-neg79.0%
Simplified79.0%
if -9.99999999999999927e-105 < z < 6.70000000000000027e-128Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 80.2%
if 4e-116 < z < 9.50000000000000023e-29Initial program 99.6%
*-commutative99.6%
Simplified99.6%
div-sub99.6%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in t around inf 68.9%
*-commutative68.9%
Simplified68.9%
clear-num69.0%
inv-pow69.0%
Applied egg-rr69.0%
unpow-169.0%
*-commutative69.0%
Simplified69.0%
Final simplification78.7%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -9.5e-105)
(not (or (<= z 1.65e-128) (and (not (<= z 4e-116)) (<= z 2.05e-28)))))
(/ (- y (/ x z)) a)
(/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.5e-105) || !((z <= 1.65e-128) || (!(z <= 4e-116) && (z <= 2.05e-28)))) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / 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 <= (-9.5d-105)) .or. (.not. (z <= 1.65d-128) .or. (.not. (z <= 4d-116)) .and. (z <= 2.05d-28))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (y * z)) / 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 <= -9.5e-105) || !((z <= 1.65e-128) || (!(z <= 4e-116) && (z <= 2.05e-28)))) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.5e-105) or not ((z <= 1.65e-128) or (not (z <= 4e-116) and (z <= 2.05e-28))): tmp = (y - (x / z)) / a else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.5e-105) || !((z <= 1.65e-128) || (!(z <= 4e-116) && (z <= 2.05e-28)))) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(y * z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9.5e-105) || ~(((z <= 1.65e-128) || (~((z <= 4e-116)) && (z <= 2.05e-28))))) tmp = (y - (x / z)) / a; else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.5e-105], N[Not[Or[LessEqual[z, 1.65e-128], And[N[Not[LessEqual[z, 4e-116]], $MachinePrecision], LessEqual[z, 2.05e-28]]]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-105} \lor \neg \left(z \leq 1.65 \cdot 10^{-128} \lor \neg \left(z \leq 4 \cdot 10^{-116}\right) \land z \leq 2.05 \cdot 10^{-28}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -9.5000000000000002e-105 or 1.65e-128 < z < 4e-116 or 2.0500000000000001e-28 < z Initial program 78.2%
*-commutative78.2%
Simplified78.2%
div-sub78.2%
associate-/l*86.7%
Applied egg-rr86.7%
Taylor expanded in t around 0 77.8%
distribute-lft-out--77.8%
*-commutative77.8%
associate-/r*79.0%
div-sub79.0%
mul-1-neg79.0%
Simplified79.0%
if -9.5000000000000002e-105 < z < 1.65e-128 or 4e-116 < z < 2.0500000000000001e-28Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 78.2%
Final simplification78.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))))
(if (<= z 3.7e+102)
(/ (- x (* y z)) t_1)
(if (or (<= z 1.75e+198) (not (<= z 1e+267)))
(/ (- y (/ x z)) a)
(* y (/ (- z) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double tmp;
if (z <= 3.7e+102) {
tmp = (x - (y * z)) / t_1;
} else if ((z <= 1.75e+198) || !(z <= 1e+267)) {
tmp = (y - (x / z)) / a;
} else {
tmp = y * (-z / 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 = t - (z * a)
if (z <= 3.7d+102) then
tmp = (x - (y * z)) / t_1
else if ((z <= 1.75d+198) .or. (.not. (z <= 1d+267))) then
tmp = (y - (x / z)) / a
else
tmp = y * (-z / 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 = t - (z * a);
double tmp;
if (z <= 3.7e+102) {
tmp = (x - (y * z)) / t_1;
} else if ((z <= 1.75e+198) || !(z <= 1e+267)) {
tmp = (y - (x / z)) / a;
} else {
tmp = y * (-z / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) tmp = 0 if z <= 3.7e+102: tmp = (x - (y * z)) / t_1 elif (z <= 1.75e+198) or not (z <= 1e+267): tmp = (y - (x / z)) / a else: tmp = y * (-z / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) tmp = 0.0 if (z <= 3.7e+102) tmp = Float64(Float64(x - Float64(y * z)) / t_1); elseif ((z <= 1.75e+198) || !(z <= 1e+267)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(y * Float64(Float64(-z) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); tmp = 0.0; if (z <= 3.7e+102) tmp = (x - (y * z)) / t_1; elseif ((z <= 1.75e+198) || ~((z <= 1e+267))) tmp = (y - (x / z)) / a; else tmp = y * (-z / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 3.7e+102], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[Or[LessEqual[z, 1.75e+198], N[Not[LessEqual[z, 1e+267]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(y * N[((-z) / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
\mathbf{if}\;z \leq 3.7 \cdot 10^{+102}:\\
\;\;\;\;\frac{x - y \cdot z}{t\_1}\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+198} \lor \neg \left(z \leq 10^{+267}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-z}{t\_1}\\
\end{array}
\end{array}
if z < 3.70000000000000023e102Initial program 93.2%
if 3.70000000000000023e102 < z < 1.75000000000000006e198 or 9.9999999999999997e266 < z Initial program 55.1%
*-commutative55.1%
Simplified55.1%
div-sub55.1%
associate-/l*63.8%
Applied egg-rr63.8%
Taylor expanded in t around 0 88.5%
distribute-lft-out--88.5%
*-commutative88.5%
associate-/r*96.5%
div-sub96.5%
mul-1-neg96.5%
Simplified96.5%
if 1.75000000000000006e198 < z < 9.9999999999999997e266Initial program 76.2%
*-commutative76.2%
Simplified76.2%
div-sub76.2%
associate-/l*99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 68.1%
mul-1-neg68.1%
*-commutative68.1%
associate-*r/91.5%
distribute-rgt-neg-in91.5%
distribute-neg-frac91.5%
*-commutative91.5%
Simplified91.5%
Final simplification93.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.2e+27) (not (<= z 8.8e-29))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.2e+27) || !(z <= 8.8e-29)) {
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 <= (-9.2d+27)) .or. (.not. (z <= 8.8d-29))) 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 <= -9.2e+27) || !(z <= 8.8e-29)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.2e+27) or not (z <= 8.8e-29): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.2e+27) || !(z <= 8.8e-29)) 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 <= -9.2e+27) || ~((z <= 8.8e-29))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.2e+27], N[Not[LessEqual[z, 8.8e-29]], $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 -9.2 \cdot 10^{+27} \lor \neg \left(z \leq 8.8 \cdot 10^{-29}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -9.2000000000000002e27 or 8.79999999999999961e-29 < z Initial program 73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in z around inf 63.4%
if -9.2000000000000002e27 < z < 8.79999999999999961e-29Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 64.0%
*-commutative64.0%
Simplified64.0%
Final simplification63.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7e+28) (not (<= z 8.2e-29))) (/ y a) (/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7e+28) || !(z <= 8.2e-29)) {
tmp = y / a;
} else {
tmp = (x - (y * z)) / 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 <= (-7d+28)) .or. (.not. (z <= 8.2d-29))) then
tmp = y / a
else
tmp = (x - (y * z)) / 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 <= -7e+28) || !(z <= 8.2e-29)) {
tmp = y / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7e+28) or not (z <= 8.2e-29): tmp = y / a else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7e+28) || !(z <= 8.2e-29)) tmp = Float64(y / a); else tmp = Float64(Float64(x - Float64(y * z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7e+28) || ~((z <= 8.2e-29))) tmp = y / a; else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7e+28], N[Not[LessEqual[z, 8.2e-29]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+28} \lor \neg \left(z \leq 8.2 \cdot 10^{-29}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -6.9999999999999999e28 or 8.1999999999999996e-29 < z Initial program 73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in z around inf 63.4%
if -6.9999999999999999e28 < z < 8.1999999999999996e-29Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 69.3%
Final simplification66.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7e-105) (not (<= z 6.7e-128))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7e-105) || !(z <= 6.7e-128)) {
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 <= (-7d-105)) .or. (.not. (z <= 6.7d-128))) 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 <= -7e-105) || !(z <= 6.7e-128)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7e-105) or not (z <= 6.7e-128): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7e-105) || !(z <= 6.7e-128)) 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 <= -7e-105) || ~((z <= 6.7e-128))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7e-105], N[Not[LessEqual[z, 6.7e-128]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-105} \lor \neg \left(z \leq 6.7 \cdot 10^{-128}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -7e-105 or 6.70000000000000027e-128 < z Initial program 80.6%
*-commutative80.6%
Simplified80.6%
Taylor expanded in z around inf 56.2%
if -7e-105 < z < 6.70000000000000027e-128Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 59.4%
Final simplification57.3%
(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 87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in z around 0 29.5%
Final simplification29.5%
(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 2024034
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))
(/ (- x (* y z)) (- t (* a z))))