
(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 (* y z)) t_1)))
(if (<= t_2 (- INFINITY))
(* y (+ (/ z (- (* z a) t)) (/ x (* y t_1))))
(if (<= t_2 -5e-312)
t_2
(if (<= t_2 0.0)
(/ -1.0 (* a (/ (- (/ t a) z) (- (* y z) x))))
(if (<= t_2 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 - (y * z)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
} else if (t_2 <= -5e-312) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = -1.0 / (a * (((t / a) - z) / ((y * z) - x)));
} else if (t_2 <= ((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 - (y * z)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1)));
} else if (t_2 <= -5e-312) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = -1.0 / (a * (((t / a) - z) / ((y * z) - x)));
} else if (t_2 <= 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 - (y * z)) / t_1 tmp = 0 if t_2 <= -math.inf: tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1))) elif t_2 <= -5e-312: tmp = t_2 elif t_2 <= 0.0: tmp = -1.0 / (a * (((t / a) - z) / ((y * z) - x))) elif t_2 <= 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 - Float64(y * z)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(y * Float64(Float64(z / Float64(Float64(z * a) - t)) + Float64(x / Float64(y * t_1)))); elseif (t_2 <= -5e-312) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(-1.0 / Float64(a * Float64(Float64(Float64(t / a) - z) / Float64(Float64(y * z) - x)))); elseif (t_2 <= 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 - (y * z)) / t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = y * ((z / ((z * a) - t)) + (x / (y * t_1))); elseif (t_2 <= -5e-312) tmp = t_2; elseif (t_2 <= 0.0) tmp = -1.0 / (a * (((t / a) - z) / ((y * z) - x))); elseif (t_2 <= 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 - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, 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], If[LessEqual[t$95$2, -5e-312], t$95$2, If[LessEqual[t$95$2, 0.0], N[(-1.0 / N[(a * N[(N[(N[(t / a), $MachinePrecision] - z), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$2, 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 -\infty:\\
\;\;\;\;y \cdot \left(\frac{z}{z \cdot a - t} + \frac{x}{y \cdot t\_1}\right)\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-312}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{-1}{a \cdot \frac{\frac{t}{a} - z}{y \cdot z - x}}\\
\mathbf{elif}\;t\_2 \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.0Initial program 49.3%
*-commutative49.3%
Simplified49.3%
Taylor expanded in y around inf 99.3%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -5.0000000000022e-312 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 97.7%
if -5.0000000000022e-312 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 55.1%
*-commutative55.1%
Simplified55.1%
Taylor expanded in a around inf 55.1%
clear-num55.1%
inv-pow55.1%
Applied egg-rr55.1%
unpow-155.1%
associate-/l*99.7%
*-commutative99.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 simplification98.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_1 (- INFINITY))
(/ (- y (/ x z)) a)
(if (<= t_1 -5e-312)
t_1
(if (<= t_1 0.0)
(/ -1.0 (* a (/ (- (/ t a) z) (- (* y z) x))))
(if (<= t_1 INFINITY) t_1 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y - (x / z)) / a;
} else if (t_1 <= -5e-312) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = -1.0 / (a * (((t / a) - z) / ((y * z) - x)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = 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 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y - (x / z)) / a;
} else if (t_1 <= -5e-312) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = -1.0 / (a * (((t / a) - z) / ((y * z) - x)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (y * z)) / (t - (z * a)) tmp = 0 if t_1 <= -math.inf: tmp = (y - (x / z)) / a elif t_1 <= -5e-312: tmp = t_1 elif t_1 <= 0.0: tmp = -1.0 / (a * (((t / a) - z) / ((y * z) - x))) elif t_1 <= math.inf: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (t_1 <= -5e-312) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(-1.0 / Float64(a * Float64(Float64(Float64(t / a) - z) / Float64(Float64(y * z) - x)))); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (y * z)) / (t - (z * a)); tmp = 0.0; if (t_1 <= -Inf) tmp = (y - (x / z)) / a; elseif (t_1 <= -5e-312) tmp = t_1; elseif (t_1 <= 0.0) tmp = -1.0 / (a * (((t / a) - z) / ((y * z) - x))); elseif (t_1 <= Inf) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$1, -5e-312], t$95$1, If[LessEqual[t$95$1, 0.0], N[(-1.0 / N[(a * N[(N[(N[(t / a), $MachinePrecision] - z), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-312}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{-1}{a \cdot \frac{\frac{t}{a} - z}{y \cdot z - x}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -inf.0Initial program 49.3%
*-commutative49.3%
Simplified49.3%
Taylor expanded in z around inf 49.3%
Taylor expanded in t around 0 84.6%
associate-*r/84.6%
mul-1-neg84.6%
sub-neg84.6%
+-commutative84.6%
distribute-neg-in84.6%
remove-double-neg84.6%
unsub-neg84.6%
Simplified84.6%
if -inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -5.0000000000022e-312 or -0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 97.7%
if -5.0000000000022e-312 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -0.0Initial program 55.1%
*-commutative55.1%
Simplified55.1%
Taylor expanded in a around inf 55.1%
clear-num55.1%
inv-pow55.1%
Applied egg-rr55.1%
unpow-155.1%
associate-/l*99.7%
*-commutative99.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 simplification97.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.45e+27)
(/ (- y (/ x z)) a)
(if (<= z -4.6e-172)
(/ (- x (* y z)) t)
(if (<= z 3500.0) (/ 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.45e+27) {
tmp = (y - (x / z)) / a;
} else if (z <= -4.6e-172) {
tmp = (x - (y * z)) / t;
} else if (z <= 3500.0) {
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.45d+27)) then
tmp = (y - (x / z)) / a
else if (z <= (-4.6d-172)) then
tmp = (x - (y * z)) / t
else if (z <= 3500.0d0) 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.45e+27) {
tmp = (y - (x / z)) / a;
} else if (z <= -4.6e-172) {
tmp = (x - (y * z)) / t;
} else if (z <= 3500.0) {
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.45e+27: tmp = (y - (x / z)) / a elif z <= -4.6e-172: tmp = (x - (y * z)) / t elif z <= 3500.0: 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.45e+27) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (z <= -4.6e-172) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 3500.0) 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.45e+27) tmp = (y - (x / z)) / a; elseif (z <= -4.6e-172) tmp = (x - (y * z)) / t; elseif (z <= 3500.0) 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.45e+27], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, -4.6e-172], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3500.0], 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.45 \cdot 10^{+27}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{-172}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 3500:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\end{array}
\end{array}
if z < -1.4500000000000001e27Initial program 70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in z around inf 69.9%
Taylor expanded in t around 0 80.3%
associate-*r/80.3%
mul-1-neg80.3%
sub-neg80.3%
+-commutative80.3%
distribute-neg-in80.3%
remove-double-neg80.3%
unsub-neg80.3%
Simplified80.3%
if -1.4500000000000001e27 < z < -4.5999999999999999e-172Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 76.8%
*-commutative76.8%
Simplified76.8%
if -4.5999999999999999e-172 < z < 3500Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 82.0%
if 3500 < z Initial program 64.1%
*-commutative64.1%
Simplified64.1%
Taylor expanded in x around 0 43.0%
mul-1-neg43.0%
associate-/l*53.9%
distribute-rgt-neg-in53.9%
sub-neg53.9%
mul-1-neg53.9%
+-commutative53.9%
mul-1-neg53.9%
distribute-rgt-neg-in53.9%
fma-undefine53.9%
distribute-neg-frac253.9%
neg-sub053.9%
fma-undefine53.9%
distribute-rgt-neg-in53.9%
mul-1-neg53.9%
associate-*r*53.9%
neg-mul-153.9%
*-commutative53.9%
associate--r+53.9%
neg-sub053.9%
distribute-rgt-neg-out53.9%
remove-double-neg53.9%
*-commutative53.9%
Simplified53.9%
Taylor expanded in z around inf 53.9%
associate-*r/53.9%
neg-mul-153.9%
Simplified53.9%
Taylor expanded in y around 0 73.3%
mul-1-neg73.3%
sub-neg73.3%
Simplified73.3%
Final simplification78.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a (/ t z)))))
(if (<= z -2.8e+15)
t_1
(if (<= z -1.3e-171)
(/ (- x (* y z)) t)
(if (<= z 3500.0) (/ x (- t (* z a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - (t / z));
double tmp;
if (z <= -2.8e+15) {
tmp = t_1;
} else if (z <= -1.3e-171) {
tmp = (x - (y * z)) / t;
} else if (z <= 3500.0) {
tmp = x / (t - (z * a));
} else {
tmp = 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 = y / (a - (t / z))
if (z <= (-2.8d+15)) then
tmp = t_1
else if (z <= (-1.3d-171)) then
tmp = (x - (y * z)) / t
else if (z <= 3500.0d0) then
tmp = x / (t - (z * a))
else
tmp = 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 = y / (a - (t / z));
double tmp;
if (z <= -2.8e+15) {
tmp = t_1;
} else if (z <= -1.3e-171) {
tmp = (x - (y * z)) / t;
} else if (z <= 3500.0) {
tmp = x / (t - (z * a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - (t / z)) tmp = 0 if z <= -2.8e+15: tmp = t_1 elif z <= -1.3e-171: tmp = (x - (y * z)) / t elif z <= 3500.0: tmp = x / (t - (z * a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - Float64(t / z))) tmp = 0.0 if (z <= -2.8e+15) tmp = t_1; elseif (z <= -1.3e-171) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 3500.0) tmp = Float64(x / Float64(t - Float64(z * a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - (t / z)); tmp = 0.0; if (z <= -2.8e+15) tmp = t_1; elseif (z <= -1.3e-171) tmp = (x - (y * z)) / t; elseif (z <= 3500.0) tmp = x / (t - (z * a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e+15], t$95$1, If[LessEqual[z, -1.3e-171], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3500.0], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-171}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 3500:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.8e15 or 3500 < z Initial program 67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in x around 0 49.3%
mul-1-neg49.3%
associate-/l*58.5%
distribute-rgt-neg-in58.5%
sub-neg58.5%
mul-1-neg58.5%
+-commutative58.5%
mul-1-neg58.5%
distribute-rgt-neg-in58.5%
fma-undefine58.5%
distribute-neg-frac258.5%
neg-sub058.5%
fma-undefine58.5%
distribute-rgt-neg-in58.5%
mul-1-neg58.5%
associate-*r*58.5%
neg-mul-158.5%
*-commutative58.5%
associate--r+58.5%
neg-sub058.5%
distribute-rgt-neg-out58.5%
remove-double-neg58.5%
*-commutative58.5%
Simplified58.5%
Taylor expanded in z around inf 58.5%
associate-*r/58.5%
neg-mul-158.5%
Simplified58.5%
Taylor expanded in y around 0 75.4%
mul-1-neg75.4%
sub-neg75.4%
Simplified75.4%
if -2.8e15 < z < -1.30000000000000002e-171Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 77.2%
*-commutative77.2%
Simplified77.2%
if -1.30000000000000002e-171 < z < 3500Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 82.0%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3e+116) (not (<= z 1.25e+80))) (/ (- 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 <= -3e+116) || !(z <= 1.25e+80)) {
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 <= (-3d+116)) .or. (.not. (z <= 1.25d+80))) 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 <= -3e+116) || !(z <= 1.25e+80)) {
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 <= -3e+116) or not (z <= 1.25e+80): 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 <= -3e+116) || !(z <= 1.25e+80)) 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 <= -3e+116) || ~((z <= 1.25e+80))) 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, -3e+116], N[Not[LessEqual[z, 1.25e+80]], $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 -3 \cdot 10^{+116} \lor \neg \left(z \leq 1.25 \cdot 10^{+80}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -2.9999999999999999e116 or 1.2499999999999999e80 < z Initial program 55.4%
*-commutative55.4%
Simplified55.4%
Taylor expanded in z around inf 55.4%
Taylor expanded in t around 0 81.0%
associate-*r/81.0%
mul-1-neg81.0%
sub-neg81.0%
+-commutative81.0%
distribute-neg-in81.0%
remove-double-neg81.0%
unsub-neg81.0%
Simplified81.0%
if -2.9999999999999999e116 < z < 1.2499999999999999e80Initial program 97.7%
Final simplification92.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.4e+34) (/ y a) (if (<= z -3.1e-130) (/ (- (* y z)) t) (if (<= z 7800.0) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.4e+34) {
tmp = y / a;
} else if (z <= -3.1e-130) {
tmp = -(y * z) / t;
} else if (z <= 7800.0) {
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 <= (-4.4d+34)) then
tmp = y / a
else if (z <= (-3.1d-130)) then
tmp = -(y * z) / t
else if (z <= 7800.0d0) 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 <= -4.4e+34) {
tmp = y / a;
} else if (z <= -3.1e-130) {
tmp = -(y * z) / t;
} else if (z <= 7800.0) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.4e+34: tmp = y / a elif z <= -3.1e-130: tmp = -(y * z) / t elif z <= 7800.0: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.4e+34) tmp = Float64(y / a); elseif (z <= -3.1e-130) tmp = Float64(Float64(-Float64(y * z)) / t); elseif (z <= 7800.0) 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 <= -4.4e+34) tmp = y / a; elseif (z <= -3.1e-130) tmp = -(y * z) / t; elseif (z <= 7800.0) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.4e+34], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.1e-130], N[((-N[(y * z), $MachinePrecision]) / t), $MachinePrecision], If[LessEqual[z, 7800.0], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+34}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-130}:\\
\;\;\;\;\frac{-y \cdot z}{t}\\
\mathbf{elif}\;z \leq 7800:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -4.4000000000000005e34 or 7800 < z Initial program 65.4%
*-commutative65.4%
Simplified65.4%
Taylor expanded in z around inf 59.3%
if -4.4000000000000005e34 < z < -3.10000000000000011e-130Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 62.6%
mul-1-neg62.6%
associate-/l*57.0%
distribute-rgt-neg-in57.0%
sub-neg57.0%
mul-1-neg57.0%
+-commutative57.0%
mul-1-neg57.0%
distribute-rgt-neg-in57.0%
fma-undefine57.0%
distribute-neg-frac257.0%
neg-sub057.0%
fma-undefine57.0%
distribute-rgt-neg-in57.0%
mul-1-neg57.0%
associate-*r*57.0%
neg-mul-157.0%
*-commutative57.0%
associate--r+57.0%
neg-sub057.0%
distribute-rgt-neg-out57.0%
remove-double-neg57.0%
*-commutative57.0%
Simplified57.0%
Taylor expanded in a around 0 43.7%
neg-mul-143.7%
Simplified43.7%
associate-*r/49.3%
*-commutative49.3%
frac-2neg49.3%
distribute-rgt-neg-in49.3%
remove-double-neg49.3%
Applied egg-rr49.3%
if -3.10000000000000011e-130 < z < 7800Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 62.4%
Final simplification59.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.9e+37) (/ y a) (if (<= z -3.1e-130) (* y (/ (- z) t)) (if (<= z 4050.0) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.9e+37) {
tmp = y / a;
} else if (z <= -3.1e-130) {
tmp = y * (-z / t);
} else if (z <= 4050.0) {
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.9d+37)) then
tmp = y / a
else if (z <= (-3.1d-130)) then
tmp = y * (-z / t)
else if (z <= 4050.0d0) 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.9e+37) {
tmp = y / a;
} else if (z <= -3.1e-130) {
tmp = y * (-z / t);
} else if (z <= 4050.0) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.9e+37: tmp = y / a elif z <= -3.1e-130: tmp = y * (-z / t) elif z <= 4050.0: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.9e+37) tmp = Float64(y / a); elseif (z <= -3.1e-130) tmp = Float64(y * Float64(Float64(-z) / t)); elseif (z <= 4050.0) 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.9e+37) tmp = y / a; elseif (z <= -3.1e-130) tmp = y * (-z / t); elseif (z <= 4050.0) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.9e+37], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.1e-130], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4050.0], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+37}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-130}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq 4050:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.8999999999999999e37 or 4050 < z Initial program 65.4%
*-commutative65.4%
Simplified65.4%
Taylor expanded in z around inf 59.3%
if -3.8999999999999999e37 < z < -3.10000000000000011e-130Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 62.6%
mul-1-neg62.6%
associate-/l*57.0%
distribute-rgt-neg-in57.0%
sub-neg57.0%
mul-1-neg57.0%
+-commutative57.0%
mul-1-neg57.0%
distribute-rgt-neg-in57.0%
fma-undefine57.0%
distribute-neg-frac257.0%
neg-sub057.0%
fma-undefine57.0%
distribute-rgt-neg-in57.0%
mul-1-neg57.0%
associate-*r*57.0%
neg-mul-157.0%
*-commutative57.0%
associate--r+57.0%
neg-sub057.0%
distribute-rgt-neg-out57.0%
remove-double-neg57.0%
*-commutative57.0%
Simplified57.0%
Taylor expanded in a around 0 43.7%
neg-mul-143.7%
Simplified43.7%
if -3.10000000000000011e-130 < z < 4050Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 62.4%
Final simplification58.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -2.9e-37) (not (<= x 3.6e-78))) (/ x (- t (* z a))) (/ y (- a (/ t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -2.9e-37) || !(x <= 3.6e-78)) {
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 ((x <= (-2.9d-37)) .or. (.not. (x <= 3.6d-78))) 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 ((x <= -2.9e-37) || !(x <= 3.6e-78)) {
tmp = x / (t - (z * a));
} else {
tmp = y / (a - (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -2.9e-37) or not (x <= 3.6e-78): tmp = x / (t - (z * a)) else: tmp = y / (a - (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -2.9e-37) || !(x <= 3.6e-78)) 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 ((x <= -2.9e-37) || ~((x <= 3.6e-78))) tmp = x / (t - (z * a)); else tmp = y / (a - (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -2.9e-37], N[Not[LessEqual[x, 3.6e-78]], $MachinePrecision]], 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}\;x \leq -2.9 \cdot 10^{-37} \lor \neg \left(x \leq 3.6 \cdot 10^{-78}\right):\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\end{array}
\end{array}
if x < -2.90000000000000005e-37 or 3.6000000000000002e-78 < x Initial program 88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in x around inf 72.7%
if -2.90000000000000005e-37 < x < 3.6000000000000002e-78Initial program 80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in x around 0 66.6%
mul-1-neg66.6%
associate-/l*69.3%
distribute-rgt-neg-in69.3%
sub-neg69.3%
mul-1-neg69.3%
+-commutative69.3%
mul-1-neg69.3%
distribute-rgt-neg-in69.3%
fma-undefine69.3%
distribute-neg-frac269.3%
neg-sub069.3%
fma-undefine69.3%
distribute-rgt-neg-in69.3%
mul-1-neg69.3%
associate-*r*69.3%
neg-mul-169.3%
*-commutative69.3%
associate--r+69.3%
neg-sub069.3%
distribute-rgt-neg-out69.3%
remove-double-neg69.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in z around inf 68.4%
associate-*r/68.4%
neg-mul-168.4%
Simplified68.4%
Taylor expanded in y around 0 81.5%
mul-1-neg81.5%
sub-neg81.5%
Simplified81.5%
Final simplification76.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.9e+73) (not (<= z 1.05e+43))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.9e+73) || !(z <= 1.05e+43)) {
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 <= (-2.9d+73)) .or. (.not. (z <= 1.05d+43))) 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 <= -2.9e+73) || !(z <= 1.05e+43)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.9e+73) or not (z <= 1.05e+43): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.9e+73) || !(z <= 1.05e+43)) 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 <= -2.9e+73) || ~((z <= 1.05e+43))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.9e+73], N[Not[LessEqual[z, 1.05e+43]], $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 -2.9 \cdot 10^{+73} \lor \neg \left(z \leq 1.05 \cdot 10^{+43}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -2.9000000000000002e73 or 1.05000000000000001e43 < z Initial program 61.4%
*-commutative61.4%
Simplified61.4%
Taylor expanded in z around inf 62.6%
if -2.9000000000000002e73 < z < 1.05000000000000001e43Initial program 98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in x around inf 69.7%
Final simplification67.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.8e+15) (not (<= z 7800.0))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.8e+15) || !(z <= 7800.0)) {
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.8d+15)) .or. (.not. (z <= 7800.0d0))) 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.8e+15) || !(z <= 7800.0)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.8e+15) or not (z <= 7800.0): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.8e+15) || !(z <= 7800.0)) 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.8e+15) || ~((z <= 7800.0))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.8e+15], N[Not[LessEqual[z, 7800.0]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+15} \lor \neg \left(z \leq 7800\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -1.8e15 or 7800 < z Initial program 67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in z around inf 57.0%
if -1.8e15 < z < 7800Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 55.9%
Final simplification56.4%
(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.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in z around 0 36.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 2024157
(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))))