
(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 -2e-289)
(- (/ x t_1) (/ (* y z) t_1))
(if (<= t_2 0.0)
(+ (/ y a) (/ (- (/ y (/ (pow a 2.0) t)) (/ x a)) z))
(if (<= t_2 5e+273) t_2 (/ (- y (/ x z)) 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 <= -2e-289) {
tmp = (x / t_1) - ((y * z) / t_1);
} else if (t_2 <= 0.0) {
tmp = (y / a) + (((y / (pow(a, 2.0) / t)) - (x / a)) / z);
} else if (t_2 <= 5e+273) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t - (z * a)
t_2 = (x - (y * z)) / t_1
if (t_2 <= (-2d-289)) then
tmp = (x / t_1) - ((y * z) / t_1)
else if (t_2 <= 0.0d0) then
tmp = (y / a) + (((y / ((a ** 2.0d0) / t)) - (x / a)) / z)
else if (t_2 <= 5d+273) then
tmp = t_2
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 t_1 = t - (z * a);
double t_2 = (x - (y * z)) / t_1;
double tmp;
if (t_2 <= -2e-289) {
tmp = (x / t_1) - ((y * z) / t_1);
} else if (t_2 <= 0.0) {
tmp = (y / a) + (((y / (Math.pow(a, 2.0) / t)) - (x / a)) / z);
} else if (t_2 <= 5e+273) {
tmp = t_2;
} else {
tmp = (y - (x / z)) / 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 <= -2e-289: tmp = (x / t_1) - ((y * z) / t_1) elif t_2 <= 0.0: tmp = (y / a) + (((y / (math.pow(a, 2.0) / t)) - (x / a)) / z) elif t_2 <= 5e+273: tmp = t_2 else: tmp = (y - (x / z)) / 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 <= -2e-289) tmp = Float64(Float64(x / t_1) - Float64(Float64(y * z) / t_1)); elseif (t_2 <= 0.0) tmp = Float64(Float64(y / a) + Float64(Float64(Float64(y / Float64((a ^ 2.0) / t)) - Float64(x / a)) / z)); elseif (t_2 <= 5e+273) tmp = t_2; else tmp = Float64(Float64(y - Float64(x / z)) / 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 <= -2e-289) tmp = (x / t_1) - ((y * z) / t_1); elseif (t_2 <= 0.0) tmp = (y / a) + (((y / ((a ^ 2.0) / t)) - (x / a)) / z); elseif (t_2 <= 5e+273) tmp = t_2; else tmp = (y - (x / z)) / 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, -2e-289], N[(N[(x / t$95$1), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(y / a), $MachinePrecision] + N[(N[(N[(y / N[(N[Power[a, 2.0], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] - N[(x / a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+273], t$95$2, N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / 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 -2 \cdot 10^{-289}:\\
\;\;\;\;\frac{x}{t_1} - \frac{y \cdot z}{t_1}\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{y}{a} + \frac{\frac{y}{\frac{{a}^{2}}{t}} - \frac{x}{a}}{z}\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+273}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -2e-289Initial program 92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in x around 0 92.8%
if -2e-289 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 54.1%
*-commutative54.1%
Simplified54.1%
Taylor expanded in z around inf 62.4%
+-commutative62.4%
associate--l+62.4%
associate-/r*71.5%
associate-*r/71.5%
associate-/r*71.5%
associate-*r/71.5%
div-sub71.5%
distribute-lft-out--71.5%
associate-*r/71.5%
mul-1-neg71.5%
unsub-neg71.5%
Simplified81.1%
if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 4.99999999999999961e273Initial program 99.8%
if 4.99999999999999961e273 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 34.4%
*-commutative34.4%
Simplified34.4%
Taylor expanded in x around 0 34.4%
Taylor expanded in a around inf 90.9%
mul-1-neg90.9%
unsub-neg90.9%
Simplified90.9%
Final simplification93.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* y z)) (- t (* z a)))))
(if (<= t_1 -2e-289)
t_1
(if (<= t_1 0.0)
(/ (/ (- (* y z) x) a) z)
(if (<= t_1 5e+273) t_1 (/ (- y (/ x z)) 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 <= -2e-289) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (((y * z) - x) / a) / z;
} else if (t_1 <= 5e+273) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x - (y * z)) / (t - (z * a))
if (t_1 <= (-2d-289)) then
tmp = t_1
else if (t_1 <= 0.0d0) then
tmp = (((y * z) - x) / a) / z
else if (t_1 <= 5d+273) then
tmp = t_1
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 t_1 = (x - (y * z)) / (t - (z * a));
double tmp;
if (t_1 <= -2e-289) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (((y * z) - x) / a) / z;
} else if (t_1 <= 5e+273) {
tmp = t_1;
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (y * z)) / (t - (z * a)) tmp = 0 if t_1 <= -2e-289: tmp = t_1 elif t_1 <= 0.0: tmp = (((y * z) - x) / a) / z elif t_1 <= 5e+273: tmp = t_1 else: tmp = (y - (x / z)) / 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 <= -2e-289) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(Float64(y * z) - x) / a) / z); elseif (t_1 <= 5e+273) tmp = t_1; else tmp = Float64(Float64(y - Float64(x / z)) / 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 <= -2e-289) tmp = t_1; elseif (t_1 <= 0.0) tmp = (((y * z) - x) / a) / z; elseif (t_1 <= 5e+273) tmp = t_1; else tmp = (y - (x / z)) / 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, -2e-289], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / a), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 5e+273], t$95$1, N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-289}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{\frac{y \cdot z - x}{a}}{z}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+273}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -2e-289 or 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 4.99999999999999961e273Initial program 96.1%
if -2e-289 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 54.1%
*-commutative54.1%
Simplified54.1%
clear-num51.7%
associate-/r/54.1%
sub-neg54.1%
+-commutative54.1%
*-commutative54.1%
distribute-rgt-neg-in54.1%
fma-def54.1%
Applied egg-rr54.1%
Taylor expanded in a around inf 32.6%
*-commutative32.6%
Simplified32.6%
associate-*l/32.6%
*-commutative32.6%
neg-mul-132.6%
associate-/r*81.0%
*-commutative81.0%
Applied egg-rr81.0%
if 4.99999999999999961e273 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 34.4%
*-commutative34.4%
Simplified34.4%
Taylor expanded in x around 0 34.4%
Taylor expanded in a around inf 90.9%
mul-1-neg90.9%
unsub-neg90.9%
Simplified90.9%
Final simplification93.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ (- x (* y z)) t_1)))
(if (<= t_2 -2e-289)
(- (/ x t_1) (/ (* y z) t_1))
(if (<= t_2 0.0)
(/ (/ (- (* y z) x) a) z)
(if (<= t_2 5e+273) t_2 (/ (- y (/ x z)) 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 <= -2e-289) {
tmp = (x / t_1) - ((y * z) / t_1);
} else if (t_2 <= 0.0) {
tmp = (((y * z) - x) / a) / z;
} else if (t_2 <= 5e+273) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t - (z * a)
t_2 = (x - (y * z)) / t_1
if (t_2 <= (-2d-289)) then
tmp = (x / t_1) - ((y * z) / t_1)
else if (t_2 <= 0.0d0) then
tmp = (((y * z) - x) / a) / z
else if (t_2 <= 5d+273) then
tmp = t_2
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 t_1 = t - (z * a);
double t_2 = (x - (y * z)) / t_1;
double tmp;
if (t_2 <= -2e-289) {
tmp = (x / t_1) - ((y * z) / t_1);
} else if (t_2 <= 0.0) {
tmp = (((y * z) - x) / a) / z;
} else if (t_2 <= 5e+273) {
tmp = t_2;
} else {
tmp = (y - (x / z)) / 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 <= -2e-289: tmp = (x / t_1) - ((y * z) / t_1) elif t_2 <= 0.0: tmp = (((y * z) - x) / a) / z elif t_2 <= 5e+273: tmp = t_2 else: tmp = (y - (x / z)) / 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 <= -2e-289) tmp = Float64(Float64(x / t_1) - Float64(Float64(y * z) / t_1)); elseif (t_2 <= 0.0) tmp = Float64(Float64(Float64(Float64(y * z) - x) / a) / z); elseif (t_2 <= 5e+273) tmp = t_2; else tmp = Float64(Float64(y - Float64(x / z)) / 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 <= -2e-289) tmp = (x / t_1) - ((y * z) / t_1); elseif (t_2 <= 0.0) tmp = (((y * z) - x) / a) / z; elseif (t_2 <= 5e+273) tmp = t_2; else tmp = (y - (x / z)) / 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, -2e-289], N[(N[(x / t$95$1), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / a), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$2, 5e+273], t$95$2, N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / 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 -2 \cdot 10^{-289}:\\
\;\;\;\;\frac{x}{t_1} - \frac{y \cdot z}{t_1}\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{\frac{y \cdot z - x}{a}}{z}\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+273}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -2e-289Initial program 92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in x around 0 92.8%
if -2e-289 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 0.0Initial program 54.1%
*-commutative54.1%
Simplified54.1%
clear-num51.7%
associate-/r/54.1%
sub-neg54.1%
+-commutative54.1%
*-commutative54.1%
distribute-rgt-neg-in54.1%
fma-def54.1%
Applied egg-rr54.1%
Taylor expanded in a around inf 32.6%
*-commutative32.6%
Simplified32.6%
associate-*l/32.6%
*-commutative32.6%
neg-mul-132.6%
associate-/r*81.0%
*-commutative81.0%
Applied egg-rr81.0%
if 0.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 4.99999999999999961e273Initial program 99.8%
if 4.99999999999999961e273 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 34.4%
*-commutative34.4%
Simplified34.4%
Taylor expanded in x around 0 34.4%
Taylor expanded in a around inf 90.9%
mul-1-neg90.9%
unsub-neg90.9%
Simplified90.9%
Final simplification93.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -12000.0)
(/ y a)
(if (<= z -6e-37)
(/ (* y (- z)) t)
(if (<= z 6.2e+19) (/ x (- t (* z a))) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -12000.0) {
tmp = y / a;
} else if (z <= -6e-37) {
tmp = (y * -z) / t;
} else if (z <= 6.2e+19) {
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 (z <= (-12000.0d0)) then
tmp = y / a
else if (z <= (-6d-37)) then
tmp = (y * -z) / t
else if (z <= 6.2d+19) 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 (z <= -12000.0) {
tmp = y / a;
} else if (z <= -6e-37) {
tmp = (y * -z) / t;
} else if (z <= 6.2e+19) {
tmp = x / (t - (z * a));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -12000.0: tmp = y / a elif z <= -6e-37: tmp = (y * -z) / t elif z <= 6.2e+19: tmp = x / (t - (z * a)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -12000.0) tmp = Float64(y / a); elseif (z <= -6e-37) tmp = Float64(Float64(y * Float64(-z)) / t); elseif (z <= 6.2e+19) 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 (z <= -12000.0) tmp = y / a; elseif (z <= -6e-37) tmp = (y * -z) / t; elseif (z <= 6.2e+19) tmp = x / (t - (z * a)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -12000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, -6e-37], N[(N[(y * (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 6.2e+19], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -12000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-37}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{t}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+19}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -12000 or 6.2e19 < z Initial program 70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in z around inf 65.9%
if -12000 < z < -6e-37Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 79.0%
Taylor expanded in x around 0 72.2%
mul-1-neg72.2%
*-commutative72.2%
distribute-rgt-neg-in72.2%
Simplified72.2%
if -6e-37 < z < 6.2e19Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 78.4%
*-commutative78.4%
Simplified78.4%
Final simplification72.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1160000.0)
(/ y a)
(if (<= z -3.3e-82)
(/ (- x (* y z)) t)
(if (<= z 2.2e+20) (/ x (- t (* z a))) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1160000.0) {
tmp = y / a;
} else if (z <= -3.3e-82) {
tmp = (x - (y * z)) / t;
} else if (z <= 2.2e+20) {
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 (z <= (-1160000.0d0)) then
tmp = y / a
else if (z <= (-3.3d-82)) then
tmp = (x - (y * z)) / t
else if (z <= 2.2d+20) 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 (z <= -1160000.0) {
tmp = y / a;
} else if (z <= -3.3e-82) {
tmp = (x - (y * z)) / t;
} else if (z <= 2.2e+20) {
tmp = x / (t - (z * a));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1160000.0: tmp = y / a elif z <= -3.3e-82: tmp = (x - (y * z)) / t elif z <= 2.2e+20: tmp = x / (t - (z * a)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1160000.0) tmp = Float64(y / a); elseif (z <= -3.3e-82) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 2.2e+20) 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 (z <= -1160000.0) tmp = y / a; elseif (z <= -3.3e-82) tmp = (x - (y * z)) / t; elseif (z <= 2.2e+20) tmp = x / (t - (z * a)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1160000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.3e-82], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 2.2e+20], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1160000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-82}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+20}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.16e6 or 2.2e20 < z Initial program 70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in z around inf 65.9%
if -1.16e6 < z < -3.30000000000000022e-82Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 75.4%
if -3.30000000000000022e-82 < z < 2.2e20Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 79.8%
*-commutative79.8%
Simplified79.8%
Final simplification72.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -4.5e-14)
t_1
(if (<= z -3.5e-81)
(/ (- x (* y z)) t)
(if (<= z 5.4) (/ x (- t (* z a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -4.5e-14) {
tmp = t_1;
} else if (z <= -3.5e-81) {
tmp = (x - (y * z)) / t;
} else if (z <= 5.4) {
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 - (x / z)) / a
if (z <= (-4.5d-14)) then
tmp = t_1
else if (z <= (-3.5d-81)) then
tmp = (x - (y * z)) / t
else if (z <= 5.4d0) 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 - (x / z)) / a;
double tmp;
if (z <= -4.5e-14) {
tmp = t_1;
} else if (z <= -3.5e-81) {
tmp = (x - (y * z)) / t;
} else if (z <= 5.4) {
tmp = x / (t - (z * a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if z <= -4.5e-14: tmp = t_1 elif z <= -3.5e-81: tmp = (x - (y * z)) / t elif z <= 5.4: tmp = x / (t - (z * a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -4.5e-14) tmp = t_1; elseif (z <= -3.5e-81) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 5.4) 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 - (x / z)) / a; tmp = 0.0; if (z <= -4.5e-14) tmp = t_1; elseif (z <= -3.5e-81) tmp = (x - (y * z)) / t; elseif (z <= 5.4) 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[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -4.5e-14], t$95$1, If[LessEqual[z, -3.5e-81], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 5.4], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-81}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 5.4:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.4999999999999998e-14 or 5.4000000000000004 < z Initial program 72.3%
*-commutative72.3%
Simplified72.3%
Taylor expanded in x around 0 72.3%
Taylor expanded in a around inf 76.3%
mul-1-neg76.3%
unsub-neg76.3%
Simplified76.3%
if -4.4999999999999998e-14 < z < -3.49999999999999986e-81Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 85.7%
if -3.49999999999999986e-81 < z < 5.4000000000000004Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 80.2%
*-commutative80.2%
Simplified80.2%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -880000.0) (/ y a) (if (<= z -1.2e-40) (* (/ y t) (- z)) (if (<= z 23500.0) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -880000.0) {
tmp = y / a;
} else if (z <= -1.2e-40) {
tmp = (y / t) * -z;
} else if (z <= 23500.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 <= (-880000.0d0)) then
tmp = y / a
else if (z <= (-1.2d-40)) then
tmp = (y / t) * -z
else if (z <= 23500.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 <= -880000.0) {
tmp = y / a;
} else if (z <= -1.2e-40) {
tmp = (y / t) * -z;
} else if (z <= 23500.0) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -880000.0: tmp = y / a elif z <= -1.2e-40: tmp = (y / t) * -z elif z <= 23500.0: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -880000.0) tmp = Float64(y / a); elseif (z <= -1.2e-40) tmp = Float64(Float64(y / t) * Float64(-z)); elseif (z <= 23500.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 <= -880000.0) tmp = y / a; elseif (z <= -1.2e-40) tmp = (y / t) * -z; elseif (z <= 23500.0) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -880000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.2e-40], N[(N[(y / t), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[z, 23500.0], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -880000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-40}:\\
\;\;\;\;\frac{y}{t} \cdot \left(-z\right)\\
\mathbf{elif}\;z \leq 23500:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -8.8e5 or 23500 < z Initial program 71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in z around inf 64.9%
if -8.8e5 < z < -1.19999999999999996e-40Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 79.0%
Taylor expanded in x around 0 72.2%
mul-1-neg72.2%
associate-/l*72.0%
associate-/r/71.9%
distribute-rgt-neg-in71.9%
Simplified71.9%
if -1.19999999999999996e-40 < z < 23500Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 59.0%
Final simplification62.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -255000.0) (/ y a) (if (<= z -2.7e-37) (/ (- y) (/ t z)) (if (<= z 3.2) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -255000.0) {
tmp = y / a;
} else if (z <= -2.7e-37) {
tmp = -y / (t / z);
} else if (z <= 3.2) {
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 <= (-255000.0d0)) then
tmp = y / a
else if (z <= (-2.7d-37)) then
tmp = -y / (t / z)
else if (z <= 3.2d0) 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 <= -255000.0) {
tmp = y / a;
} else if (z <= -2.7e-37) {
tmp = -y / (t / z);
} else if (z <= 3.2) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -255000.0: tmp = y / a elif z <= -2.7e-37: tmp = -y / (t / z) elif z <= 3.2: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -255000.0) tmp = Float64(y / a); elseif (z <= -2.7e-37) tmp = Float64(Float64(-y) / Float64(t / z)); elseif (z <= 3.2) 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 <= -255000.0) tmp = y / a; elseif (z <= -2.7e-37) tmp = -y / (t / z); elseif (z <= 3.2) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -255000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, -2.7e-37], N[((-y) / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -255000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-37}:\\
\;\;\;\;\frac{-y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 3.2:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -255000 or 3.2000000000000002 < z Initial program 71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in z around inf 64.9%
if -255000 < z < -2.70000000000000016e-37Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 79.0%
Taylor expanded in x around 0 72.2%
mul-1-neg72.2%
associate-/l*72.0%
distribute-neg-frac72.0%
Simplified72.0%
if -2.70000000000000016e-37 < z < 3.2000000000000002Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 59.0%
Final simplification62.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -64000.0)
(/ y a)
(if (<= z -2.6e-38)
(/ (* y (- z)) t)
(if (<= z 110000000.0) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -64000.0) {
tmp = y / a;
} else if (z <= -2.6e-38) {
tmp = (y * -z) / t;
} else if (z <= 110000000.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 <= (-64000.0d0)) then
tmp = y / a
else if (z <= (-2.6d-38)) then
tmp = (y * -z) / t
else if (z <= 110000000.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 <= -64000.0) {
tmp = y / a;
} else if (z <= -2.6e-38) {
tmp = (y * -z) / t;
} else if (z <= 110000000.0) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -64000.0: tmp = y / a elif z <= -2.6e-38: tmp = (y * -z) / t elif z <= 110000000.0: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -64000.0) tmp = Float64(y / a); elseif (z <= -2.6e-38) tmp = Float64(Float64(y * Float64(-z)) / t); elseif (z <= 110000000.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 <= -64000.0) tmp = y / a; elseif (z <= -2.6e-38) tmp = (y * -z) / t; elseif (z <= 110000000.0) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -64000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, -2.6e-38], N[(N[(y * (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 110000000.0], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -64000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-38}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{t}\\
\mathbf{elif}\;z \leq 110000000:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -64000 or 1.1e8 < z Initial program 71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in z around inf 64.9%
if -64000 < z < -2.60000000000000011e-38Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 79.0%
Taylor expanded in x around 0 72.2%
mul-1-neg72.2%
*-commutative72.2%
distribute-rgt-neg-in72.2%
Simplified72.2%
if -2.60000000000000011e-38 < z < 1.1e8Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 59.0%
Final simplification62.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4e-38) (not (<= z 2600000.0))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e-38) || !(z <= 2600000.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 <= (-4d-38)) .or. (.not. (z <= 2600000.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 <= -4e-38) || !(z <= 2600000.0)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4e-38) or not (z <= 2600000.0): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4e-38) || !(z <= 2600000.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 <= -4e-38) || ~((z <= 2600000.0))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4e-38], N[Not[LessEqual[z, 2600000.0]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-38} \lor \neg \left(z \leq 2600000\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -3.9999999999999998e-38 or 2.6e6 < z Initial program 73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in z around inf 60.1%
if -3.9999999999999998e-38 < z < 2.6e6Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 59.0%
Final simplification59.6%
(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 86.0%
*-commutative86.0%
Simplified86.0%
Taylor expanded in z around 0 35.5%
Final simplification35.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 2024018
(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))))