
(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 (if (or (<= z -9.2e+108) (not (<= z 9.8e+175))) (/ (- y (/ x z)) a) (/ (- x (* z y)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.2e+108) || !(z <= 9.8e+175)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / (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+108)) .or. (.not. (z <= 9.8d+175))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (z * y)) / (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+108) || !(z <= 9.8e+175)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.2e+108) or not (z <= 9.8e+175): tmp = (y - (x / z)) / a else: tmp = (x - (z * y)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.2e+108) || !(z <= 9.8e+175)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(z * y)) / 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+108) || ~((z <= 9.8e+175))) tmp = (y - (x / z)) / a; else tmp = (x - (z * y)) / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.2e+108], N[Not[LessEqual[z, 9.8e+175]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+108} \lor \neg \left(z \leq 9.8 \cdot 10^{+175}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -9.1999999999999996e108 or 9.80000000000000002e175 < z Initial program 60.3%
*-commutative60.3%
Simplified60.3%
Taylor expanded in x around 0 60.3%
Taylor expanded in a around inf 89.4%
mul-1-neg89.4%
unsub-neg89.4%
Simplified89.4%
if -9.1999999999999996e108 < z < 9.80000000000000002e175Initial program 97.9%
Final simplification96.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -7e+73)
(/ y a)
(if (<= z -7e-82)
(/ (/ (- x) a) z)
(if (<= z 8e-199)
(/ x t)
(if (<= z 3.05e-167)
(/ (* z (- y)) t)
(if (<= z 3.7e-122)
(/ x t)
(if (<= z 7.7e-66)
(/ (- x) (* z a))
(if (<= z 2.45e+33) (/ x t) (/ y a)))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e+73) {
tmp = y / a;
} else if (z <= -7e-82) {
tmp = (-x / a) / z;
} else if (z <= 8e-199) {
tmp = x / t;
} else if (z <= 3.05e-167) {
tmp = (z * -y) / t;
} else if (z <= 3.7e-122) {
tmp = x / t;
} else if (z <= 7.7e-66) {
tmp = -x / (z * a);
} else if (z <= 2.45e+33) {
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 <= (-7d+73)) then
tmp = y / a
else if (z <= (-7d-82)) then
tmp = (-x / a) / z
else if (z <= 8d-199) then
tmp = x / t
else if (z <= 3.05d-167) then
tmp = (z * -y) / t
else if (z <= 3.7d-122) then
tmp = x / t
else if (z <= 7.7d-66) then
tmp = -x / (z * a)
else if (z <= 2.45d+33) 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 <= -7e+73) {
tmp = y / a;
} else if (z <= -7e-82) {
tmp = (-x / a) / z;
} else if (z <= 8e-199) {
tmp = x / t;
} else if (z <= 3.05e-167) {
tmp = (z * -y) / t;
} else if (z <= 3.7e-122) {
tmp = x / t;
} else if (z <= 7.7e-66) {
tmp = -x / (z * a);
} else if (z <= 2.45e+33) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7e+73: tmp = y / a elif z <= -7e-82: tmp = (-x / a) / z elif z <= 8e-199: tmp = x / t elif z <= 3.05e-167: tmp = (z * -y) / t elif z <= 3.7e-122: tmp = x / t elif z <= 7.7e-66: tmp = -x / (z * a) elif z <= 2.45e+33: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7e+73) tmp = Float64(y / a); elseif (z <= -7e-82) tmp = Float64(Float64(Float64(-x) / a) / z); elseif (z <= 8e-199) tmp = Float64(x / t); elseif (z <= 3.05e-167) tmp = Float64(Float64(z * Float64(-y)) / t); elseif (z <= 3.7e-122) tmp = Float64(x / t); elseif (z <= 7.7e-66) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 2.45e+33) 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 <= -7e+73) tmp = y / a; elseif (z <= -7e-82) tmp = (-x / a) / z; elseif (z <= 8e-199) tmp = x / t; elseif (z <= 3.05e-167) tmp = (z * -y) / t; elseif (z <= 3.7e-122) tmp = x / t; elseif (z <= 7.7e-66) tmp = -x / (z * a); elseif (z <= 2.45e+33) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e+73], N[(y / a), $MachinePrecision], If[LessEqual[z, -7e-82], N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 8e-199], N[(x / t), $MachinePrecision], If[LessEqual[z, 3.05e-167], N[(N[(z * (-y)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.7e-122], N[(x / t), $MachinePrecision], If[LessEqual[z, 7.7e-66], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e+33], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+73}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-82}:\\
\;\;\;\;\frac{\frac{-x}{a}}{z}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-199}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 3.05 \cdot 10^{-167}:\\
\;\;\;\;\frac{z \cdot \left(-y\right)}{t}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-122}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 7.7 \cdot 10^{-66}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+33}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -7.00000000000000004e73 or 2.45000000000000007e33 < z Initial program 72.7%
*-commutative72.7%
Simplified72.7%
Taylor expanded in z around inf 62.7%
if -7.00000000000000004e73 < z < -6.9999999999999997e-82Initial program 96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in x around inf 63.0%
*-commutative63.0%
Simplified63.0%
Taylor expanded in t around 0 48.4%
associate-*r/48.4%
neg-mul-148.4%
*-commutative48.4%
associate-/r*48.4%
neg-mul-148.4%
associate-*r/48.4%
mul-1-neg48.4%
Simplified48.4%
Taylor expanded in x around 0 48.4%
mul-1-neg48.4%
associate-/r*51.2%
distribute-neg-frac51.2%
Simplified51.2%
if -6.9999999999999997e-82 < z < 7.99999999999999986e-199 or 3.0499999999999999e-167 < z < 3.6999999999999997e-122 or 7.7000000000000001e-66 < z < 2.45000000000000007e33Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 58.3%
if 7.99999999999999986e-199 < z < 3.0499999999999999e-167Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 54.9%
Taylor expanded in x around 0 49.5%
associate-*r/49.5%
associate-*r*49.5%
mul-1-neg49.5%
Simplified49.5%
if 3.6999999999999997e-122 < z < 7.7000000000000001e-66Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 62.2%
*-commutative62.2%
Simplified62.2%
Taylor expanded in t around 0 61.4%
associate-*r/61.4%
neg-mul-161.4%
*-commutative61.4%
Simplified61.4%
Final simplification58.6%
(FPCore (x y z t a)
:precision binary64
(if (or (<= t -1.8e+53)
(not
(or (<= t -44000.0)
(and (not (<= t -3.3e-32)) (<= t 75000000000000.0)))))
(- (/ x t) (* z (/ y t)))
(/ (- y (/ x z)) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.8e+53) || !((t <= -44000.0) || (!(t <= -3.3e-32) && (t <= 75000000000000.0)))) {
tmp = (x / t) - (z * (y / t));
} else {
tmp = (y - (x / 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 ((t <= (-1.8d+53)) .or. (.not. (t <= (-44000.0d0)) .or. (.not. (t <= (-3.3d-32))) .and. (t <= 75000000000000.0d0))) then
tmp = (x / t) - (z * (y / t))
else
tmp = (y - (x / 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 ((t <= -1.8e+53) || !((t <= -44000.0) || (!(t <= -3.3e-32) && (t <= 75000000000000.0)))) {
tmp = (x / t) - (z * (y / t));
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.8e+53) or not ((t <= -44000.0) or (not (t <= -3.3e-32) and (t <= 75000000000000.0))): tmp = (x / t) - (z * (y / t)) else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.8e+53) || !((t <= -44000.0) || (!(t <= -3.3e-32) && (t <= 75000000000000.0)))) tmp = Float64(Float64(x / t) - Float64(z * Float64(y / t))); else tmp = Float64(Float64(y - Float64(x / z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.8e+53) || ~(((t <= -44000.0) || (~((t <= -3.3e-32)) && (t <= 75000000000000.0))))) tmp = (x / t) - (z * (y / t)); else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.8e+53], N[Not[Or[LessEqual[t, -44000.0], And[N[Not[LessEqual[t, -3.3e-32]], $MachinePrecision], LessEqual[t, 75000000000000.0]]]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+53} \lor \neg \left(t \leq -44000 \lor \neg \left(t \leq -3.3 \cdot 10^{-32}\right) \land t \leq 75000000000000\right):\\
\;\;\;\;\frac{x}{t} - z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if t < -1.8e53 or -44000 < t < -3.30000000000000025e-32 or 7.5e13 < t Initial program 88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in x around 0 88.8%
Taylor expanded in a around 0 80.2%
+-commutative80.2%
neg-mul-180.2%
sub-neg80.2%
associate-/l*75.8%
Simplified75.8%
associate-/r/82.0%
Applied egg-rr82.0%
if -1.8e53 < t < -44000 or -3.30000000000000025e-32 < t < 7.5e13Initial program 90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in x around 0 90.2%
Taylor expanded in a around inf 75.4%
mul-1-neg75.4%
unsub-neg75.4%
Simplified75.4%
Final simplification78.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (/ x t) (* z (/ y t)))))
(if (<= t -6.8e+49)
t_1
(if (<= t -1650000.0)
(/ (- y (/ x z)) a)
(if (or (<= t -2.25e-32) (not (<= t 8e+17)))
t_1
(- (/ y a) (/ x (* z a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x / t) - (z * (y / t));
double tmp;
if (t <= -6.8e+49) {
tmp = t_1;
} else if (t <= -1650000.0) {
tmp = (y - (x / z)) / a;
} else if ((t <= -2.25e-32) || !(t <= 8e+17)) {
tmp = t_1;
} else {
tmp = (y / a) - (x / (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) :: t_1
real(8) :: tmp
t_1 = (x / t) - (z * (y / t))
if (t <= (-6.8d+49)) then
tmp = t_1
else if (t <= (-1650000.0d0)) then
tmp = (y - (x / z)) / a
else if ((t <= (-2.25d-32)) .or. (.not. (t <= 8d+17))) then
tmp = t_1
else
tmp = (y / a) - (x / (z * 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 * (y / t));
double tmp;
if (t <= -6.8e+49) {
tmp = t_1;
} else if (t <= -1650000.0) {
tmp = (y - (x / z)) / a;
} else if ((t <= -2.25e-32) || !(t <= 8e+17)) {
tmp = t_1;
} else {
tmp = (y / a) - (x / (z * a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x / t) - (z * (y / t)) tmp = 0 if t <= -6.8e+49: tmp = t_1 elif t <= -1650000.0: tmp = (y - (x / z)) / a elif (t <= -2.25e-32) or not (t <= 8e+17): tmp = t_1 else: tmp = (y / a) - (x / (z * a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x / t) - Float64(z * Float64(y / t))) tmp = 0.0 if (t <= -6.8e+49) tmp = t_1; elseif (t <= -1650000.0) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif ((t <= -2.25e-32) || !(t <= 8e+17)) tmp = t_1; else tmp = Float64(Float64(y / a) - Float64(x / Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x / t) - (z * (y / t)); tmp = 0.0; if (t <= -6.8e+49) tmp = t_1; elseif (t <= -1650000.0) tmp = (y - (x / z)) / a; elseif ((t <= -2.25e-32) || ~((t <= 8e+17))) tmp = t_1; else tmp = (y / a) - (x / (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.8e+49], t$95$1, If[LessEqual[t, -1650000.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[Or[LessEqual[t, -2.25e-32], N[Not[LessEqual[t, 8e+17]], $MachinePrecision]], t$95$1, N[(N[(y / a), $MachinePrecision] - N[(x / N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t} - z \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -6.8 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1650000:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;t \leq -2.25 \cdot 10^{-32} \lor \neg \left(t \leq 8 \cdot 10^{+17}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} - \frac{x}{z \cdot a}\\
\end{array}
\end{array}
if t < -6.8000000000000001e49 or -1.65e6 < t < -2.25000000000000002e-32 or 8e17 < t Initial program 88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in x around 0 88.8%
Taylor expanded in a around 0 80.2%
+-commutative80.2%
neg-mul-180.2%
sub-neg80.2%
associate-/l*75.8%
Simplified75.8%
associate-/r/82.0%
Applied egg-rr82.0%
if -6.8000000000000001e49 < t < -1.65e6Initial program 77.8%
*-commutative77.8%
Simplified77.8%
Taylor expanded in x around 0 77.8%
Taylor expanded in a around inf 89.0%
mul-1-neg89.0%
unsub-neg89.0%
Simplified89.0%
if -2.25000000000000002e-32 < t < 8e17Initial program 91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in x around 0 91.0%
Taylor expanded in t around 0 76.5%
+-commutative76.5%
mul-1-neg76.5%
unsub-neg76.5%
*-commutative76.5%
Simplified76.5%
Final simplification79.2%
(FPCore (x y z t a)
:precision binary64
(if (or (<= t -8.5e+49)
(not
(or (<= t -48000000.0) (and (not (<= t -2.4e-32)) (<= t 8e+15)))))
(/ (- x (* z y)) t)
(/ (- y (/ x z)) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.5e+49) || !((t <= -48000000.0) || (!(t <= -2.4e-32) && (t <= 8e+15)))) {
tmp = (x - (z * y)) / t;
} else {
tmp = (y - (x / 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 ((t <= (-8.5d+49)) .or. (.not. (t <= (-48000000.0d0)) .or. (.not. (t <= (-2.4d-32))) .and. (t <= 8d+15))) then
tmp = (x - (z * y)) / t
else
tmp = (y - (x / 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 ((t <= -8.5e+49) || !((t <= -48000000.0) || (!(t <= -2.4e-32) && (t <= 8e+15)))) {
tmp = (x - (z * y)) / t;
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8.5e+49) or not ((t <= -48000000.0) or (not (t <= -2.4e-32) and (t <= 8e+15))): tmp = (x - (z * y)) / t else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8.5e+49) || !((t <= -48000000.0) || (!(t <= -2.4e-32) && (t <= 8e+15)))) tmp = Float64(Float64(x - Float64(z * y)) / t); else tmp = Float64(Float64(y - Float64(x / z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -8.5e+49) || ~(((t <= -48000000.0) || (~((t <= -2.4e-32)) && (t <= 8e+15))))) tmp = (x - (z * y)) / t; else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8.5e+49], N[Not[Or[LessEqual[t, -48000000.0], And[N[Not[LessEqual[t, -2.4e-32]], $MachinePrecision], LessEqual[t, 8e+15]]]], $MachinePrecision]], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+49} \lor \neg \left(t \leq -48000000 \lor \neg \left(t \leq -2.4 \cdot 10^{-32}\right) \land t \leq 8 \cdot 10^{+15}\right):\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if t < -8.4999999999999996e49 or -4.8e7 < t < -2.4000000000000001e-32 or 8e15 < t Initial program 88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in t around inf 80.2%
if -8.4999999999999996e49 < t < -4.8e7 or -2.4000000000000001e-32 < t < 8e15Initial program 90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in x around 0 90.2%
Taylor expanded in a around inf 75.4%
mul-1-neg75.4%
unsub-neg75.4%
Simplified75.4%
Final simplification77.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x) (* z a))))
(if (<= z -5.8e+72)
(/ y a)
(if (<= z -1.6e-82)
t_1
(if (<= z 3e-120)
(/ x t)
(if (<= z 5e-66) t_1 (if (<= z 2.45e+33) (/ x t) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -x / (z * a);
double tmp;
if (z <= -5.8e+72) {
tmp = y / a;
} else if (z <= -1.6e-82) {
tmp = t_1;
} else if (z <= 3e-120) {
tmp = x / t;
} else if (z <= 5e-66) {
tmp = t_1;
} else if (z <= 2.45e+33) {
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) :: t_1
real(8) :: tmp
t_1 = -x / (z * a)
if (z <= (-5.8d+72)) then
tmp = y / a
else if (z <= (-1.6d-82)) then
tmp = t_1
else if (z <= 3d-120) then
tmp = x / t
else if (z <= 5d-66) then
tmp = t_1
else if (z <= 2.45d+33) 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 t_1 = -x / (z * a);
double tmp;
if (z <= -5.8e+72) {
tmp = y / a;
} else if (z <= -1.6e-82) {
tmp = t_1;
} else if (z <= 3e-120) {
tmp = x / t;
} else if (z <= 5e-66) {
tmp = t_1;
} else if (z <= 2.45e+33) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -x / (z * a) tmp = 0 if z <= -5.8e+72: tmp = y / a elif z <= -1.6e-82: tmp = t_1 elif z <= 3e-120: tmp = x / t elif z <= 5e-66: tmp = t_1 elif z <= 2.45e+33: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-x) / Float64(z * a)) tmp = 0.0 if (z <= -5.8e+72) tmp = Float64(y / a); elseif (z <= -1.6e-82) tmp = t_1; elseif (z <= 3e-120) tmp = Float64(x / t); elseif (z <= 5e-66) tmp = t_1; elseif (z <= 2.45e+33) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -x / (z * a); tmp = 0.0; if (z <= -5.8e+72) tmp = y / a; elseif (z <= -1.6e-82) tmp = t_1; elseif (z <= 3e-120) tmp = x / t; elseif (z <= 5e-66) tmp = t_1; elseif (z <= 2.45e+33) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e+72], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.6e-82], t$95$1, If[LessEqual[z, 3e-120], N[(x / t), $MachinePrecision], If[LessEqual[z, 5e-66], t$95$1, If[LessEqual[z, 2.45e+33], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-x}{z \cdot a}\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+72}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-82}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-120}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+33}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -5.80000000000000034e72 or 2.45000000000000007e33 < z Initial program 72.7%
*-commutative72.7%
Simplified72.7%
Taylor expanded in z around inf 62.7%
if -5.80000000000000034e72 < z < -1.6000000000000001e-82 or 3.00000000000000011e-120 < z < 4.99999999999999962e-66Initial program 97.6%
*-commutative97.6%
Simplified97.6%
Taylor expanded in x around inf 62.8%
*-commutative62.8%
Simplified62.8%
Taylor expanded in t around 0 51.4%
associate-*r/51.4%
neg-mul-151.4%
*-commutative51.4%
Simplified51.4%
if -1.6000000000000001e-82 < z < 3.00000000000000011e-120 or 4.99999999999999962e-66 < z < 2.45000000000000007e33Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 53.9%
Final simplification56.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.2e+80)
(/ y a)
(if (<= z -1.9e-82)
(/ (/ (- x) a) z)
(if (<= z 4.2e-120)
(/ x t)
(if (<= z 2.55e-64)
(/ (- x) (* z a))
(if (<= z 6.8e+33) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e+80) {
tmp = y / a;
} else if (z <= -1.9e-82) {
tmp = (-x / a) / z;
} else if (z <= 4.2e-120) {
tmp = x / t;
} else if (z <= 2.55e-64) {
tmp = -x / (z * a);
} else if (z <= 6.8e+33) {
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 <= (-8.2d+80)) then
tmp = y / a
else if (z <= (-1.9d-82)) then
tmp = (-x / a) / z
else if (z <= 4.2d-120) then
tmp = x / t
else if (z <= 2.55d-64) then
tmp = -x / (z * a)
else if (z <= 6.8d+33) 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 <= -8.2e+80) {
tmp = y / a;
} else if (z <= -1.9e-82) {
tmp = (-x / a) / z;
} else if (z <= 4.2e-120) {
tmp = x / t;
} else if (z <= 2.55e-64) {
tmp = -x / (z * a);
} else if (z <= 6.8e+33) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.2e+80: tmp = y / a elif z <= -1.9e-82: tmp = (-x / a) / z elif z <= 4.2e-120: tmp = x / t elif z <= 2.55e-64: tmp = -x / (z * a) elif z <= 6.8e+33: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.2e+80) tmp = Float64(y / a); elseif (z <= -1.9e-82) tmp = Float64(Float64(Float64(-x) / a) / z); elseif (z <= 4.2e-120) tmp = Float64(x / t); elseif (z <= 2.55e-64) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 6.8e+33) 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 <= -8.2e+80) tmp = y / a; elseif (z <= -1.9e-82) tmp = (-x / a) / z; elseif (z <= 4.2e-120) tmp = x / t; elseif (z <= 2.55e-64) tmp = -x / (z * a); elseif (z <= 6.8e+33) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.2e+80], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.9e-82], N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 4.2e-120], N[(x / t), $MachinePrecision], If[LessEqual[z, 2.55e-64], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+33], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+80}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-82}:\\
\;\;\;\;\frac{\frac{-x}{a}}{z}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-120}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-64}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+33}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -8.20000000000000003e80 or 6.7999999999999999e33 < z Initial program 72.7%
*-commutative72.7%
Simplified72.7%
Taylor expanded in z around inf 62.7%
if -8.20000000000000003e80 < z < -1.9000000000000001e-82Initial program 96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in x around inf 63.0%
*-commutative63.0%
Simplified63.0%
Taylor expanded in t around 0 48.4%
associate-*r/48.4%
neg-mul-148.4%
*-commutative48.4%
associate-/r*48.4%
neg-mul-148.4%
associate-*r/48.4%
mul-1-neg48.4%
Simplified48.4%
Taylor expanded in x around 0 48.4%
mul-1-neg48.4%
associate-/r*51.2%
distribute-neg-frac51.2%
Simplified51.2%
if -1.9000000000000001e-82 < z < 4.2000000000000001e-120 or 2.54999999999999992e-64 < z < 6.7999999999999999e33Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 53.9%
if 4.2000000000000001e-120 < z < 2.54999999999999992e-64Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 62.2%
*-commutative62.2%
Simplified62.2%
Taylor expanded in t around 0 61.4%
associate-*r/61.4%
neg-mul-161.4%
*-commutative61.4%
Simplified61.4%
Final simplification57.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* z y)) t)))
(if (<= y -4.6e+142)
t_1
(if (<= y -3.3e+109)
(/ y a)
(if (<= y 6.3e-21) (/ x (- t (* z a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (z * y)) / t;
double tmp;
if (y <= -4.6e+142) {
tmp = t_1;
} else if (y <= -3.3e+109) {
tmp = y / a;
} else if (y <= 6.3e-21) {
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 = (x - (z * y)) / t
if (y <= (-4.6d+142)) then
tmp = t_1
else if (y <= (-3.3d+109)) then
tmp = y / a
else if (y <= 6.3d-21) 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 = (x - (z * y)) / t;
double tmp;
if (y <= -4.6e+142) {
tmp = t_1;
} else if (y <= -3.3e+109) {
tmp = y / a;
} else if (y <= 6.3e-21) {
tmp = x / (t - (z * a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (z * y)) / t tmp = 0 if y <= -4.6e+142: tmp = t_1 elif y <= -3.3e+109: tmp = y / a elif y <= 6.3e-21: tmp = x / (t - (z * a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(z * y)) / t) tmp = 0.0 if (y <= -4.6e+142) tmp = t_1; elseif (y <= -3.3e+109) tmp = Float64(y / a); elseif (y <= 6.3e-21) 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 = (x - (z * y)) / t; tmp = 0.0; if (y <= -4.6e+142) tmp = t_1; elseif (y <= -3.3e+109) tmp = y / a; elseif (y <= 6.3e-21) 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[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[y, -4.6e+142], t$95$1, If[LessEqual[y, -3.3e+109], N[(y / a), $MachinePrecision], If[LessEqual[y, 6.3e-21], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - z \cdot y}{t}\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{+142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{+109}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;y \leq 6.3 \cdot 10^{-21}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.60000000000000004e142 or 6.3e-21 < y Initial program 86.8%
*-commutative86.8%
Simplified86.8%
Taylor expanded in t around inf 58.1%
if -4.60000000000000004e142 < y < -3.2999999999999999e109Initial program 50.4%
*-commutative50.4%
Simplified50.4%
Taylor expanded in z around inf 88.7%
if -3.2999999999999999e109 < y < 6.3e-21Initial program 94.0%
*-commutative94.0%
Simplified94.0%
Taylor expanded in x around inf 73.3%
*-commutative73.3%
Simplified73.3%
Final simplification67.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.2e+82) (not (<= z 1.08e+43))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e+82) || !(z <= 1.08e+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 <= (-1.2d+82)) .or. (.not. (z <= 1.08d+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 <= -1.2e+82) || !(z <= 1.08e+43)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.2e+82) or not (z <= 1.08e+43): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.2e+82) || !(z <= 1.08e+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 <= -1.2e+82) || ~((z <= 1.08e+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, -1.2e+82], N[Not[LessEqual[z, 1.08e+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 -1.2 \cdot 10^{+82} \lor \neg \left(z \leq 1.08 \cdot 10^{+43}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -1.19999999999999999e82 or 1.08e43 < z Initial program 72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in z around inf 63.4%
if -1.19999999999999999e82 < z < 1.08e43Initial program 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in x around inf 67.3%
*-commutative67.3%
Simplified67.3%
Final simplification65.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2800000000.0) (not (<= z 4.5e+36))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2800000000.0) || !(z <= 4.5e+36)) {
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 <= (-2800000000.0d0)) .or. (.not. (z <= 4.5d+36))) 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 <= -2800000000.0) || !(z <= 4.5e+36)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2800000000.0) or not (z <= 4.5e+36): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2800000000.0) || !(z <= 4.5e+36)) 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 <= -2800000000.0) || ~((z <= 4.5e+36))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2800000000.0], N[Not[LessEqual[z, 4.5e+36]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2800000000 \lor \neg \left(z \leq 4.5 \cdot 10^{+36}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -2.8e9 or 4.49999999999999997e36 < z Initial program 75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in z around inf 57.7%
if -2.8e9 < z < 4.49999999999999997e36Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 48.2%
Final simplification52.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 89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in z around 0 32.2%
Final simplification32.2%
(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 2023320
(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))))