
(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 12 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 (* y z)) t_1)))
(if (<= t_2 -4e-303)
t_2
(if (<= t_2 0.0)
(/ (/ (fma y (- z) x) a) (- z))
(if (<= t_2 1e+305)
t_2
(if (<= t_2 INFINITY)
(* y (+ (/ z (- (* z a) t)) (/ x (* y t_1))))
(/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x - (y * z)) / t_1;
double tmp;
if (t_2 <= -4e-303) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (fma(y, -z, x) / a) / -z;
} else if (t_2 <= 1e+305) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
} 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 - Float64(y * z)) / t_1) tmp = 0.0 if (t_2 <= -4e-303) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(fma(y, Float64(-z), x) / a) / Float64(-z)); elseif (t_2 <= 1e+305) tmp = t_2; elseif (t_2 <= Inf) tmp = Float64(y * Float64(Float64(z / Float64(Float64(z * a) - t)) + Float64(x / Float64(y * t_1)))); 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 - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-303], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(N[(y * (-z) + x), $MachinePrecision] / a), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[t$95$2, 1e+305], t$95$2, If[LessEqual[t$95$2, Infinity], N[(y * N[(N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(x / N[(y * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x - y \cdot z}{t\_1}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y, -z, x\right)}{a}}{-z}\\
\mathbf{elif}\;t\_2 \leq 10^{+305}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -3.99999999999999972e-303 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 9.9999999999999994e304Initial program 98.7%
if -3.99999999999999972e-303 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 59.2%
*-commutative59.2%
Simplified59.2%
Taylor expanded in t around 0 32.0%
mul-1-neg32.0%
associate-/r*75.0%
sub-neg75.0%
distribute-rgt-neg-out75.0%
+-commutative75.0%
fma-define75.0%
Simplified75.0%
if 9.9999999999999994e304 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in y around inf 99.7%
Simplified99.7%
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 simplification95.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ (- x (* y z)) t_1)))
(if (<= t_2 -4e-303)
t_2
(if (<= t_2 0.0)
(/ (- y (/ x z)) a)
(if (<= t_2 1e+305)
t_2
(if (<= t_2 INFINITY)
(* y (+ (/ z (- (* z a) t)) (/ x (* y t_1))))
(/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (x - (y * z)) / t_1;
double tmp;
if (t_2 <= -4e-303) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_2 <= 1e+305) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
} 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 - (y * z)) / t_1;
double tmp;
if (t_2 <= -4e-303) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (y - (x / z)) / a;
} else if (t_2 <= 1e+305) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = (x - (y * z)) / t_1 tmp = 0 if t_2 <= -4e-303: tmp = t_2 elif t_2 <= 0.0: tmp = (y - (x / z)) / a elif t_2 <= 1e+305: tmp = t_2 elif t_2 <= math.inf: tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1))) 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 - Float64(y * z)) / t_1) tmp = 0.0 if (t_2 <= -4e-303) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (t_2 <= 1e+305) tmp = t_2; elseif (t_2 <= Inf) tmp = Float64(y * Float64(Float64(z / Float64(Float64(z * a) - t)) + Float64(x / Float64(y * t_1)))); 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 - (y * z)) / t_1; tmp = 0.0; if (t_2 <= -4e-303) tmp = t_2; elseif (t_2 <= 0.0) tmp = (y - (x / z)) / a; elseif (t_2 <= 1e+305) tmp = t_2; elseif (t_2 <= Inf) tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1))); 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 - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-303], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$2, 1e+305], t$95$2, If[LessEqual[t$95$2, Infinity], N[(y * N[(N[(z / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(x / N[(y * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{x - y \cdot z}{t\_1}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;t\_2 \leq 10^{+305}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -3.99999999999999972e-303 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 9.9999999999999994e304Initial program 98.7%
if -3.99999999999999972e-303 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 59.2%
*-commutative59.2%
Simplified59.2%
Taylor expanded in z around inf 59.2%
Taylor expanded in t around 0 72.7%
mul-1-neg72.7%
distribute-neg-frac272.7%
Simplified72.7%
if 9.9999999999999994e304 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in y around inf 99.7%
Simplified99.7%
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 simplification94.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= z -3.7e+139)
(/ y a)
(if (<= z 9.5e+53)
t_1
(if (<= z 7e+110)
(/ y a)
(if (<= z 1.65e+133)
t_1
(if (<= z 2.05e+197) (* y (/ z (- t))) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (z <= -3.7e+139) {
tmp = y / a;
} else if (z <= 9.5e+53) {
tmp = t_1;
} else if (z <= 7e+110) {
tmp = y / a;
} else if (z <= 1.65e+133) {
tmp = t_1;
} else if (z <= 2.05e+197) {
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) :: t_1
real(8) :: tmp
t_1 = x / (t - (z * a))
if (z <= (-3.7d+139)) then
tmp = y / a
else if (z <= 9.5d+53) then
tmp = t_1
else if (z <= 7d+110) then
tmp = y / a
else if (z <= 1.65d+133) then
tmp = t_1
else if (z <= 2.05d+197) 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 t_1 = x / (t - (z * a));
double tmp;
if (z <= -3.7e+139) {
tmp = y / a;
} else if (z <= 9.5e+53) {
tmp = t_1;
} else if (z <= 7e+110) {
tmp = y / a;
} else if (z <= 1.65e+133) {
tmp = t_1;
} else if (z <= 2.05e+197) {
tmp = y * (z / -t);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) tmp = 0 if z <= -3.7e+139: tmp = y / a elif z <= 9.5e+53: tmp = t_1 elif z <= 7e+110: tmp = y / a elif z <= 1.65e+133: tmp = t_1 elif z <= 2.05e+197: tmp = y * (z / -t) else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (z <= -3.7e+139) tmp = Float64(y / a); elseif (z <= 9.5e+53) tmp = t_1; elseif (z <= 7e+110) tmp = Float64(y / a); elseif (z <= 1.65e+133) tmp = t_1; elseif (z <= 2.05e+197) 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) t_1 = x / (t - (z * a)); tmp = 0.0; if (z <= -3.7e+139) tmp = y / a; elseif (z <= 9.5e+53) tmp = t_1; elseif (z <= 7e+110) tmp = y / a; elseif (z <= 1.65e+133) tmp = t_1; elseif (z <= 2.05e+197) tmp = y * (z / -t); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e+139], N[(y / a), $MachinePrecision], If[LessEqual[z, 9.5e+53], t$95$1, If[LessEqual[z, 7e+110], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.65e+133], t$95$1, If[LessEqual[z, 2.05e+197], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+110}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+197}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.69999999999999992e139 or 9.5000000000000006e53 < z < 6.9999999999999998e110 or 2.05000000000000015e197 < z Initial program 65.2%
*-commutative65.2%
Simplified65.2%
Taylor expanded in z around inf 73.1%
if -3.69999999999999992e139 < z < 9.5000000000000006e53 or 6.9999999999999998e110 < z < 1.65e133Initial program 95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in x around inf 67.0%
*-commutative67.0%
Simplified67.0%
if 1.65e133 < z < 2.05000000000000015e197Initial program 63.7%
*-commutative63.7%
Simplified63.7%
Taylor expanded in x around 0 56.1%
mul-1-neg56.1%
associate-/l*63.3%
distribute-rgt-neg-in63.3%
distribute-neg-frac263.3%
cancel-sign-sub-inv63.3%
*-commutative63.3%
+-commutative63.3%
distribute-rgt-neg-out63.3%
distribute-lft-neg-in63.3%
*-commutative63.3%
fma-undefine63.3%
neg-sub063.3%
fma-undefine63.3%
distribute-rgt-neg-in63.3%
mul-1-neg63.3%
associate-*r*63.3%
neg-mul-163.3%
*-commutative63.3%
associate--r+63.3%
neg-sub063.3%
distribute-rgt-neg-out63.3%
remove-double-neg63.3%
Simplified63.3%
Taylor expanded in z around 0 55.1%
associate-*r/55.1%
mul-1-neg55.1%
Simplified55.1%
Final simplification68.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.8e+139)
(/ y a)
(if (<= z -1.65e-54)
(* (- z) (/ y t))
(if (<= z 1.7e-103)
(/ x t)
(if (<= z 1.55e-49)
(/ (* y z) (- t))
(if (<= z 2.3e+29) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e+139) {
tmp = y / a;
} else if (z <= -1.65e-54) {
tmp = -z * (y / t);
} else if (z <= 1.7e-103) {
tmp = x / t;
} else if (z <= 1.55e-49) {
tmp = (y * z) / -t;
} else if (z <= 2.3e+29) {
tmp = x / 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.8d+139)) then
tmp = y / a
else if (z <= (-1.65d-54)) then
tmp = -z * (y / t)
else if (z <= 1.7d-103) then
tmp = x / t
else if (z <= 1.55d-49) then
tmp = (y * z) / -t
else if (z <= 2.3d+29) then
tmp = x / 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.8e+139) {
tmp = y / a;
} else if (z <= -1.65e-54) {
tmp = -z * (y / t);
} else if (z <= 1.7e-103) {
tmp = x / t;
} else if (z <= 1.55e-49) {
tmp = (y * z) / -t;
} else if (z <= 2.3e+29) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.8e+139: tmp = y / a elif z <= -1.65e-54: tmp = -z * (y / t) elif z <= 1.7e-103: tmp = x / t elif z <= 1.55e-49: tmp = (y * z) / -t elif z <= 2.3e+29: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.8e+139) tmp = Float64(y / a); elseif (z <= -1.65e-54) tmp = Float64(Float64(-z) * Float64(y / t)); elseif (z <= 1.7e-103) tmp = Float64(x / t); elseif (z <= 1.55e-49) tmp = Float64(Float64(y * z) / Float64(-t)); elseif (z <= 2.3e+29) tmp = Float64(x / 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.8e+139) tmp = y / a; elseif (z <= -1.65e-54) tmp = -z * (y / t); elseif (z <= 1.7e-103) tmp = x / t; elseif (z <= 1.55e-49) tmp = (y * z) / -t; elseif (z <= 2.3e+29) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e+139], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.65e-54], N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-103], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.55e-49], N[(N[(y * z), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[z, 2.3e+29], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+139}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-54}:\\
\;\;\;\;\left(-z\right) \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-103}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-49}:\\
\;\;\;\;\frac{y \cdot z}{-t}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+29}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.79999999999999999e139 or 2.3000000000000001e29 < z Initial program 67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in z around inf 62.9%
if -3.79999999999999999e139 < z < -1.64999999999999996e-54Initial program 86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in x around 0 46.2%
mul-1-neg46.2%
associate-/l*54.0%
distribute-rgt-neg-in54.0%
distribute-neg-frac254.0%
cancel-sign-sub-inv54.0%
*-commutative54.0%
+-commutative54.0%
distribute-rgt-neg-out54.0%
distribute-lft-neg-in54.0%
*-commutative54.0%
fma-undefine54.0%
neg-sub054.0%
fma-undefine54.0%
distribute-rgt-neg-in54.0%
mul-1-neg54.0%
associate-*r*54.0%
neg-mul-154.0%
*-commutative54.0%
associate--r+54.0%
neg-sub054.0%
distribute-rgt-neg-out54.0%
remove-double-neg54.0%
Simplified54.0%
Taylor expanded in z around 0 34.2%
associate-*r/34.2%
associate-*r*34.2%
mul-1-neg34.2%
Simplified34.2%
Taylor expanded in y around 0 34.2%
mul-1-neg34.2%
*-commutative34.2%
associate-*r/42.0%
*-commutative42.0%
distribute-rgt-neg-in42.0%
Simplified42.0%
if -1.64999999999999996e-54 < z < 1.70000000000000001e-103 or 1.55e-49 < z < 2.3000000000000001e29Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 64.1%
if 1.70000000000000001e-103 < z < 1.55e-49Initial program 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x around 0 65.3%
mul-1-neg65.3%
associate-/l*56.1%
distribute-rgt-neg-in56.1%
distribute-neg-frac256.1%
cancel-sign-sub-inv56.1%
*-commutative56.1%
+-commutative56.1%
distribute-rgt-neg-out56.1%
distribute-lft-neg-in56.1%
*-commutative56.1%
fma-undefine56.1%
neg-sub056.1%
fma-undefine56.1%
distribute-rgt-neg-in56.1%
mul-1-neg56.1%
associate-*r*56.1%
neg-mul-156.1%
*-commutative56.1%
associate--r+56.1%
neg-sub056.1%
distribute-rgt-neg-out56.1%
remove-double-neg56.1%
Simplified56.1%
Taylor expanded in z around 0 58.4%
associate-*r/58.4%
associate-*r*58.4%
mul-1-neg58.4%
Simplified58.4%
Final simplification59.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.7e+139)
(/ y a)
(if (<= z -1.3e-55)
(* z (/ (- y) t))
(if (<= z 2.3e-111)
(/ x t)
(if (<= z 1.15e-34)
(/ (/ x a) (- z))
(if (<= z 6e+38) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.7e+139) {
tmp = y / a;
} else if (z <= -1.3e-55) {
tmp = z * (-y / t);
} else if (z <= 2.3e-111) {
tmp = x / t;
} else if (z <= 1.15e-34) {
tmp = (x / a) / -z;
} else if (z <= 6e+38) {
tmp = x / 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.7d+139)) then
tmp = y / a
else if (z <= (-1.3d-55)) then
tmp = z * (-y / t)
else if (z <= 2.3d-111) then
tmp = x / t
else if (z <= 1.15d-34) then
tmp = (x / a) / -z
else if (z <= 6d+38) then
tmp = x / 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.7e+139) {
tmp = y / a;
} else if (z <= -1.3e-55) {
tmp = z * (-y / t);
} else if (z <= 2.3e-111) {
tmp = x / t;
} else if (z <= 1.15e-34) {
tmp = (x / a) / -z;
} else if (z <= 6e+38) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.7e+139: tmp = y / a elif z <= -1.3e-55: tmp = z * (-y / t) elif z <= 2.3e-111: tmp = x / t elif z <= 1.15e-34: tmp = (x / a) / -z elif z <= 6e+38: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.7e+139) tmp = Float64(y / a); elseif (z <= -1.3e-55) tmp = Float64(z * Float64(Float64(-y) / t)); elseif (z <= 2.3e-111) tmp = Float64(x / t); elseif (z <= 1.15e-34) tmp = Float64(Float64(x / a) / Float64(-z)); elseif (z <= 6e+38) tmp = Float64(x / 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.7e+139) tmp = y / a; elseif (z <= -1.3e-55) tmp = z * (-y / t); elseif (z <= 2.3e-111) tmp = x / t; elseif (z <= 1.15e-34) tmp = (x / a) / -z; elseif (z <= 6e+38) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.7e+139], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.3e-55], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e-111], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.15e-34], N[(N[(x / a), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, 6e+38], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-55}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-111}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-34}:\\
\;\;\;\;\frac{\frac{x}{a}}{-z}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+38}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.69999999999999992e139 or 6.0000000000000002e38 < z Initial program 67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in z around inf 62.9%
if -3.69999999999999992e139 < z < -1.2999999999999999e-55Initial program 86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in x around 0 46.2%
mul-1-neg46.2%
associate-/l*54.0%
distribute-rgt-neg-in54.0%
distribute-neg-frac254.0%
cancel-sign-sub-inv54.0%
*-commutative54.0%
+-commutative54.0%
distribute-rgt-neg-out54.0%
distribute-lft-neg-in54.0%
*-commutative54.0%
fma-undefine54.0%
neg-sub054.0%
fma-undefine54.0%
distribute-rgt-neg-in54.0%
mul-1-neg54.0%
associate-*r*54.0%
neg-mul-154.0%
*-commutative54.0%
associate--r+54.0%
neg-sub054.0%
distribute-rgt-neg-out54.0%
remove-double-neg54.0%
Simplified54.0%
Taylor expanded in z around 0 34.2%
associate-*r/34.2%
associate-*r*34.2%
mul-1-neg34.2%
Simplified34.2%
Taylor expanded in y around 0 34.2%
mul-1-neg34.2%
*-commutative34.2%
associate-*r/42.0%
*-commutative42.0%
distribute-rgt-neg-in42.0%
Simplified42.0%
if -1.2999999999999999e-55 < z < 2.3e-111 or 1.15000000000000006e-34 < z < 6.0000000000000002e38Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 66.0%
if 2.3e-111 < z < 1.15000000000000006e-34Initial program 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in t around 0 56.2%
mul-1-neg56.2%
associate-/r*56.3%
sub-neg56.3%
distribute-rgt-neg-out56.3%
+-commutative56.3%
fma-define56.3%
Simplified56.3%
Taylor expanded in y around 0 51.2%
Final simplification59.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.7e+139)
(/ y a)
(if (<= z -5.2e-55)
(* y (/ z (- t)))
(if (<= z 9.5e-112)
(/ x t)
(if (<= z 8.8e-34)
(/ (/ x a) (- z))
(if (<= z 2.4e+29) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.7e+139) {
tmp = y / a;
} else if (z <= -5.2e-55) {
tmp = y * (z / -t);
} else if (z <= 9.5e-112) {
tmp = x / t;
} else if (z <= 8.8e-34) {
tmp = (x / a) / -z;
} else if (z <= 2.4e+29) {
tmp = x / 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.7d+139)) then
tmp = y / a
else if (z <= (-5.2d-55)) then
tmp = y * (z / -t)
else if (z <= 9.5d-112) then
tmp = x / t
else if (z <= 8.8d-34) then
tmp = (x / a) / -z
else if (z <= 2.4d+29) then
tmp = x / 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.7e+139) {
tmp = y / a;
} else if (z <= -5.2e-55) {
tmp = y * (z / -t);
} else if (z <= 9.5e-112) {
tmp = x / t;
} else if (z <= 8.8e-34) {
tmp = (x / a) / -z;
} else if (z <= 2.4e+29) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.7e+139: tmp = y / a elif z <= -5.2e-55: tmp = y * (z / -t) elif z <= 9.5e-112: tmp = x / t elif z <= 8.8e-34: tmp = (x / a) / -z elif z <= 2.4e+29: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.7e+139) tmp = Float64(y / a); elseif (z <= -5.2e-55) tmp = Float64(y * Float64(z / Float64(-t))); elseif (z <= 9.5e-112) tmp = Float64(x / t); elseif (z <= 8.8e-34) tmp = Float64(Float64(x / a) / Float64(-z)); elseif (z <= 2.4e+29) tmp = Float64(x / 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.7e+139) tmp = y / a; elseif (z <= -5.2e-55) tmp = y * (z / -t); elseif (z <= 9.5e-112) tmp = x / t; elseif (z <= 8.8e-34) tmp = (x / a) / -z; elseif (z <= 2.4e+29) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.7e+139], N[(y / a), $MachinePrecision], If[LessEqual[z, -5.2e-55], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-112], N[(x / t), $MachinePrecision], If[LessEqual[z, 8.8e-34], N[(N[(x / a), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, 2.4e+29], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-55}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-112}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-34}:\\
\;\;\;\;\frac{\frac{x}{a}}{-z}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+29}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.69999999999999992e139 or 2.4000000000000001e29 < z Initial program 67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in z around inf 62.9%
if -3.69999999999999992e139 < z < -5.1999999999999998e-55Initial program 86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in x around 0 46.2%
mul-1-neg46.2%
associate-/l*54.0%
distribute-rgt-neg-in54.0%
distribute-neg-frac254.0%
cancel-sign-sub-inv54.0%
*-commutative54.0%
+-commutative54.0%
distribute-rgt-neg-out54.0%
distribute-lft-neg-in54.0%
*-commutative54.0%
fma-undefine54.0%
neg-sub054.0%
fma-undefine54.0%
distribute-rgt-neg-in54.0%
mul-1-neg54.0%
associate-*r*54.0%
neg-mul-154.0%
*-commutative54.0%
associate--r+54.0%
neg-sub054.0%
distribute-rgt-neg-out54.0%
remove-double-neg54.0%
Simplified54.0%
Taylor expanded in z around 0 40.0%
associate-*r/40.0%
mul-1-neg40.0%
Simplified40.0%
if -5.1999999999999998e-55 < z < 9.50000000000000056e-112 or 8.7999999999999995e-34 < z < 2.4000000000000001e29Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 66.0%
if 9.50000000000000056e-112 < z < 8.7999999999999995e-34Initial program 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in t around 0 56.2%
mul-1-neg56.2%
associate-/r*56.3%
sub-neg56.3%
distribute-rgt-neg-out56.3%
+-commutative56.3%
fma-define56.3%
Simplified56.3%
Taylor expanded in y around 0 51.2%
Final simplification58.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.55e+47)
(/ y a)
(if (<= a 5.4e-36)
(/ (- x (* y z)) t)
(if (or (<= a 3e+101) (not (<= a 1.2e+160)))
(/ x (- t (* z a)))
(/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.55e+47) {
tmp = y / a;
} else if (a <= 5.4e-36) {
tmp = (x - (y * z)) / t;
} else if ((a <= 3e+101) || !(a <= 1.2e+160)) {
tmp = x / (t - (z * a));
} 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 (a <= (-1.55d+47)) then
tmp = y / a
else if (a <= 5.4d-36) then
tmp = (x - (y * z)) / t
else if ((a <= 3d+101) .or. (.not. (a <= 1.2d+160))) then
tmp = x / (t - (z * a))
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 (a <= -1.55e+47) {
tmp = y / a;
} else if (a <= 5.4e-36) {
tmp = (x - (y * z)) / t;
} else if ((a <= 3e+101) || !(a <= 1.2e+160)) {
tmp = x / (t - (z * a));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.55e+47: tmp = y / a elif a <= 5.4e-36: tmp = (x - (y * z)) / t elif (a <= 3e+101) or not (a <= 1.2e+160): tmp = x / (t - (z * a)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.55e+47) tmp = Float64(y / a); elseif (a <= 5.4e-36) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif ((a <= 3e+101) || !(a <= 1.2e+160)) tmp = Float64(x / Float64(t - Float64(z * a))); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.55e+47) tmp = y / a; elseif (a <= 5.4e-36) tmp = (x - (y * z)) / t; elseif ((a <= 3e+101) || ~((a <= 1.2e+160))) tmp = x / (t - (z * a)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.55e+47], N[(y / a), $MachinePrecision], If[LessEqual[a, 5.4e-36], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[a, 3e+101], N[Not[LessEqual[a, 1.2e+160]], $MachinePrecision]], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{+47}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{-36}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;a \leq 3 \cdot 10^{+101} \lor \neg \left(a \leq 1.2 \cdot 10^{+160}\right):\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if a < -1.55e47 or 2.99999999999999993e101 < a < 1.2000000000000001e160Initial program 68.0%
*-commutative68.0%
Simplified68.0%
Taylor expanded in z around inf 59.8%
if -1.55e47 < a < 5.40000000000000015e-36Initial program 94.2%
*-commutative94.2%
Simplified94.2%
Taylor expanded in t around inf 76.2%
if 5.40000000000000015e-36 < a < 2.99999999999999993e101 or 1.2000000000000001e160 < a Initial program 84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in x around inf 63.9%
*-commutative63.9%
Simplified63.9%
Final simplification69.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.7e+139)
(/ y a)
(if (<= z 5.2e-111)
(/ x t)
(if (<= z 8e-35)
(/ (/ x a) (- z))
(if (<= z 1.25e+35) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.7e+139) {
tmp = y / a;
} else if (z <= 5.2e-111) {
tmp = x / t;
} else if (z <= 8e-35) {
tmp = (x / a) / -z;
} else if (z <= 1.25e+35) {
tmp = x / 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.7d+139)) then
tmp = y / a
else if (z <= 5.2d-111) then
tmp = x / t
else if (z <= 8d-35) then
tmp = (x / a) / -z
else if (z <= 1.25d+35) then
tmp = x / 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.7e+139) {
tmp = y / a;
} else if (z <= 5.2e-111) {
tmp = x / t;
} else if (z <= 8e-35) {
tmp = (x / a) / -z;
} else if (z <= 1.25e+35) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.7e+139: tmp = y / a elif z <= 5.2e-111: tmp = x / t elif z <= 8e-35: tmp = (x / a) / -z elif z <= 1.25e+35: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.7e+139) tmp = Float64(y / a); elseif (z <= 5.2e-111) tmp = Float64(x / t); elseif (z <= 8e-35) tmp = Float64(Float64(x / a) / Float64(-z)); elseif (z <= 1.25e+35) tmp = Float64(x / 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.7e+139) tmp = y / a; elseif (z <= 5.2e-111) tmp = x / t; elseif (z <= 8e-35) tmp = (x / a) / -z; elseif (z <= 1.25e+35) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.7e+139], N[(y / a), $MachinePrecision], If[LessEqual[z, 5.2e-111], N[(x / t), $MachinePrecision], If[LessEqual[z, 8e-35], N[(N[(x / a), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, 1.25e+35], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+139}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-111}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-35}:\\
\;\;\;\;\frac{\frac{x}{a}}{-z}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.69999999999999992e139 or 1.25000000000000005e35 < z Initial program 67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in z around inf 62.9%
if -3.69999999999999992e139 < z < 5.19999999999999965e-111 or 8.00000000000000006e-35 < z < 1.25000000000000005e35Initial program 95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in z around 0 52.1%
if 5.19999999999999965e-111 < z < 8.00000000000000006e-35Initial program 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in t around 0 56.2%
mul-1-neg56.2%
associate-/r*56.3%
sub-neg56.3%
distribute-rgt-neg-out56.3%
+-commutative56.3%
fma-define56.3%
Simplified56.3%
Taylor expanded in y around 0 51.2%
Final simplification56.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e+164) (not (<= z 2.3e+195))) (/ (- y (/ x z)) a) (/ (- x (* y z)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e+164) || !(z <= 2.3e+195)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / (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 <= (-7.2d+164)) .or. (.not. (z <= 2.3d+195))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (y * z)) / (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 <= -7.2e+164) || !(z <= 2.3e+195)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e+164) or not (z <= 2.3e+195): tmp = (y - (x / z)) / a else: tmp = (x - (y * z)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e+164) || !(z <= 2.3e+195)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.2e+164) || ~((z <= 2.3e+195))) tmp = (y - (x / z)) / a; else tmp = (x - (y * z)) / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e+164], N[Not[LessEqual[z, 2.3e+195]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+164} \lor \neg \left(z \leq 2.3 \cdot 10^{+195}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -7.19999999999999981e164 or 2.3000000000000001e195 < z Initial program 58.2%
*-commutative58.2%
Simplified58.2%
Taylor expanded in z around inf 58.2%
Taylor expanded in t around 0 85.5%
mul-1-neg85.5%
distribute-neg-frac285.5%
Simplified85.5%
if -7.19999999999999981e164 < z < 2.3000000000000001e195Initial program 92.4%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.8e+46) (not (<= a 7e-11))) (/ (- y (/ x z)) a) (/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.8e+46) || !(a <= 7e-11)) {
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 ((a <= (-3.8d+46)) .or. (.not. (a <= 7d-11))) 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 ((a <= -3.8e+46) || !(a <= 7e-11)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.8e+46) or not (a <= 7e-11): tmp = (y - (x / z)) / a else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.8e+46) || !(a <= 7e-11)) 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 ((a <= -3.8e+46) || ~((a <= 7e-11))) 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[a, -3.8e+46], N[Not[LessEqual[a, 7e-11]], $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}\;a \leq -3.8 \cdot 10^{+46} \lor \neg \left(a \leq 7 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if a < -3.7999999999999999e46 or 7.00000000000000038e-11 < a Initial program 74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in z around inf 69.2%
Taylor expanded in t around 0 78.2%
mul-1-neg78.2%
distribute-neg-frac278.2%
Simplified78.2%
if -3.7999999999999999e46 < a < 7.00000000000000038e-11Initial program 93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in t around inf 75.7%
Final simplification76.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.7e+139) (not (<= z 1.1e+30))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e+139) || !(z <= 1.1e+30)) {
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 <= (-3.7d+139)) .or. (.not. (z <= 1.1d+30))) 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 <= -3.7e+139) || !(z <= 1.1e+30)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.7e+139) or not (z <= 1.1e+30): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.7e+139) || !(z <= 1.1e+30)) 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 <= -3.7e+139) || ~((z <= 1.1e+30))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.7e+139], N[Not[LessEqual[z, 1.1e+30]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+139} \lor \neg \left(z \leq 1.1 \cdot 10^{+30}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -3.69999999999999992e139 or 1.1e30 < z Initial program 67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in z around inf 62.9%
if -3.69999999999999992e139 < z < 1.1e30Initial program 95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in z around 0 49.1%
Final simplification54.1%
(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 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in z around 0 35.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 2024101
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:alt
(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))))