
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- y (/ x z))))
(if (<= z -9.5e+84)
(/ t_1 a)
(if (<= z 1.32e+196)
(+ (/ (* z y) (- (* z a) t)) (/ x (- t (* z a))))
(* t_1 (/ 1.0 a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y - (x / z);
double tmp;
if (z <= -9.5e+84) {
tmp = t_1 / a;
} else if (z <= 1.32e+196) {
tmp = ((z * y) / ((z * a) - t)) + (x / (t - (z * a)));
} else {
tmp = t_1 * (1.0 / 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 = y - (x / z)
if (z <= (-9.5d+84)) then
tmp = t_1 / a
else if (z <= 1.32d+196) then
tmp = ((z * y) / ((z * a) - t)) + (x / (t - (z * a)))
else
tmp = t_1 * (1.0d0 / a)
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);
double tmp;
if (z <= -9.5e+84) {
tmp = t_1 / a;
} else if (z <= 1.32e+196) {
tmp = ((z * y) / ((z * a) - t)) + (x / (t - (z * a)));
} else {
tmp = t_1 * (1.0 / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y - (x / z) tmp = 0 if z <= -9.5e+84: tmp = t_1 / a elif z <= 1.32e+196: tmp = ((z * y) / ((z * a) - t)) + (x / (t - (z * a))) else: tmp = t_1 * (1.0 / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(y - Float64(x / z)) tmp = 0.0 if (z <= -9.5e+84) tmp = Float64(t_1 / a); elseif (z <= 1.32e+196) tmp = Float64(Float64(Float64(z * y) / Float64(Float64(z * a) - t)) + Float64(x / Float64(t - Float64(z * a)))); else tmp = Float64(t_1 * Float64(1.0 / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y - (x / z); tmp = 0.0; if (z <= -9.5e+84) tmp = t_1 / a; elseif (z <= 1.32e+196) tmp = ((z * y) / ((z * a) - t)) + (x / (t - (z * a))); else tmp = t_1 * (1.0 / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.5e+84], N[(t$95$1 / a), $MachinePrecision], If[LessEqual[z, 1.32e+196], N[(N[(N[(z * y), $MachinePrecision] / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \frac{x}{z}\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+84}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+196}:\\
\;\;\;\;\frac{z \cdot y}{z \cdot a - t} + \frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{1}{a}\\
\end{array}
\end{array}
if z < -9.49999999999999979e84Initial program 58.3%
*-commutative58.3%
Simplified58.3%
Taylor expanded in x around 0 58.3%
Taylor expanded in a around inf 89.4%
mul-1-neg89.4%
unsub-neg89.4%
Simplified89.4%
if -9.49999999999999979e84 < z < 1.32e196Initial program 95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in x around 0 95.8%
if 1.32e196 < z Initial program 36.0%
*-commutative36.0%
Simplified36.0%
Taylor expanded in x around 0 36.0%
Taylor expanded in a around inf 88.2%
mul-1-neg88.2%
unsub-neg88.2%
Simplified88.2%
div-inv88.3%
Applied egg-rr88.3%
Final simplification94.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5200000000.0)
(/ y a)
(if (<= z -2.8e-105)
(/ x t)
(if (<= z -1.52e-136)
(/ x (* z (- a)))
(if (<= z 9.4e-117)
(/ x t)
(if (<= z 4e-82)
(* y (/ z (- t)))
(if (<= z 7.2e-44) (/ x t) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5200000000.0) {
tmp = y / a;
} else if (z <= -2.8e-105) {
tmp = x / t;
} else if (z <= -1.52e-136) {
tmp = x / (z * -a);
} else if (z <= 9.4e-117) {
tmp = x / t;
} else if (z <= 4e-82) {
tmp = y * (z / -t);
} else if (z <= 7.2e-44) {
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 <= (-5200000000.0d0)) then
tmp = y / a
else if (z <= (-2.8d-105)) then
tmp = x / t
else if (z <= (-1.52d-136)) then
tmp = x / (z * -a)
else if (z <= 9.4d-117) then
tmp = x / t
else if (z <= 4d-82) then
tmp = y * (z / -t)
else if (z <= 7.2d-44) 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 <= -5200000000.0) {
tmp = y / a;
} else if (z <= -2.8e-105) {
tmp = x / t;
} else if (z <= -1.52e-136) {
tmp = x / (z * -a);
} else if (z <= 9.4e-117) {
tmp = x / t;
} else if (z <= 4e-82) {
tmp = y * (z / -t);
} else if (z <= 7.2e-44) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5200000000.0: tmp = y / a elif z <= -2.8e-105: tmp = x / t elif z <= -1.52e-136: tmp = x / (z * -a) elif z <= 9.4e-117: tmp = x / t elif z <= 4e-82: tmp = y * (z / -t) elif z <= 7.2e-44: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5200000000.0) tmp = Float64(y / a); elseif (z <= -2.8e-105) tmp = Float64(x / t); elseif (z <= -1.52e-136) tmp = Float64(x / Float64(z * Float64(-a))); elseif (z <= 9.4e-117) tmp = Float64(x / t); elseif (z <= 4e-82) tmp = Float64(y * Float64(z / Float64(-t))); elseif (z <= 7.2e-44) 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 <= -5200000000.0) tmp = y / a; elseif (z <= -2.8e-105) tmp = x / t; elseif (z <= -1.52e-136) tmp = x / (z * -a); elseif (z <= 9.4e-117) tmp = x / t; elseif (z <= 4e-82) tmp = y * (z / -t); elseif (z <= 7.2e-44) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5200000000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, -2.8e-105], N[(x / t), $MachinePrecision], If[LessEqual[z, -1.52e-136], N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.4e-117], N[(x / t), $MachinePrecision], If[LessEqual[z, 4e-82], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-44], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5200000000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-105}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq -1.52 \cdot 10^{-136}:\\
\;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\
\mathbf{elif}\;z \leq 9.4 \cdot 10^{-117}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-82}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -5.2e9 or 7.1999999999999998e-44 < z Initial program 73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in z around inf 54.2%
if -5.2e9 < z < -2.8e-105 or -1.51999999999999999e-136 < z < 9.40000000000000017e-117 or 4e-82 < z < 7.1999999999999998e-44Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 65.0%
if -2.8e-105 < z < -1.51999999999999999e-136Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in a around inf 33.8%
mul-1-neg33.8%
unsub-neg33.8%
Simplified33.8%
Taylor expanded in y around 0 57.2%
associate-*r/57.2%
neg-mul-157.2%
*-commutative57.2%
Simplified57.2%
if 9.40000000000000017e-117 < z < 4e-82Initial program 98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in t around inf 72.8%
div-sub72.8%
Applied egg-rr72.8%
Taylor expanded in x around 0 73.4%
mul-1-neg73.4%
associate-*r/74.1%
distribute-rgt-neg-in74.1%
distribute-neg-frac74.1%
Simplified74.1%
Final simplification59.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1400000000000.0)
(/ y a)
(if (<= z -2.8e-105)
(/ x t)
(if (<= z -1.52e-136)
(/ x (* z (- a)))
(if (<= z 7.2e-117)
(/ x t)
(if (<= z 1.4e-40) (/ (* z y) (- t)) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1400000000000.0) {
tmp = y / a;
} else if (z <= -2.8e-105) {
tmp = x / t;
} else if (z <= -1.52e-136) {
tmp = x / (z * -a);
} else if (z <= 7.2e-117) {
tmp = x / t;
} else if (z <= 1.4e-40) {
tmp = (z * y) / -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 <= (-1400000000000.0d0)) then
tmp = y / a
else if (z <= (-2.8d-105)) then
tmp = x / t
else if (z <= (-1.52d-136)) then
tmp = x / (z * -a)
else if (z <= 7.2d-117) then
tmp = x / t
else if (z <= 1.4d-40) then
tmp = (z * y) / -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 <= -1400000000000.0) {
tmp = y / a;
} else if (z <= -2.8e-105) {
tmp = x / t;
} else if (z <= -1.52e-136) {
tmp = x / (z * -a);
} else if (z <= 7.2e-117) {
tmp = x / t;
} else if (z <= 1.4e-40) {
tmp = (z * y) / -t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1400000000000.0: tmp = y / a elif z <= -2.8e-105: tmp = x / t elif z <= -1.52e-136: tmp = x / (z * -a) elif z <= 7.2e-117: tmp = x / t elif z <= 1.4e-40: tmp = (z * y) / -t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1400000000000.0) tmp = Float64(y / a); elseif (z <= -2.8e-105) tmp = Float64(x / t); elseif (z <= -1.52e-136) tmp = Float64(x / Float64(z * Float64(-a))); elseif (z <= 7.2e-117) tmp = Float64(x / t); elseif (z <= 1.4e-40) tmp = Float64(Float64(z * y) / Float64(-t)); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1400000000000.0) tmp = y / a; elseif (z <= -2.8e-105) tmp = x / t; elseif (z <= -1.52e-136) tmp = x / (z * -a); elseif (z <= 7.2e-117) tmp = x / t; elseif (z <= 1.4e-40) tmp = (z * y) / -t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1400000000000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, -2.8e-105], N[(x / t), $MachinePrecision], If[LessEqual[z, -1.52e-136], N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-117], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.4e-40], N[(N[(z * y), $MachinePrecision] / (-t)), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1400000000000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-105}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq -1.52 \cdot 10^{-136}:\\
\;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-117}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-40}:\\
\;\;\;\;\frac{z \cdot y}{-t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.4e12 or 1.4e-40 < z Initial program 72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in z around inf 54.6%
if -1.4e12 < z < -2.8e-105 or -1.51999999999999999e-136 < z < 7.2000000000000001e-117Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 66.8%
if -2.8e-105 < z < -1.51999999999999999e-136Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in a around inf 33.8%
mul-1-neg33.8%
unsub-neg33.8%
Simplified33.8%
Taylor expanded in y around 0 57.2%
associate-*r/57.2%
neg-mul-157.2%
*-commutative57.2%
Simplified57.2%
if 7.2000000000000001e-117 < z < 1.4e-40Initial program 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in t around inf 67.7%
Taylor expanded in x around 0 49.3%
neg-mul-149.3%
distribute-neg-frac249.3%
Simplified49.3%
Final simplification59.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -9e+151)
(/ y a)
(if (<= z -7.8e+118)
(/ (/ x a) (- z))
(if (<= z -1.02e+15)
(/ y a)
(if (<= z 4.4e-117)
(/ x t)
(if (<= z 1.35e-40) (/ (* z y) (- t)) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9e+151) {
tmp = y / a;
} else if (z <= -7.8e+118) {
tmp = (x / a) / -z;
} else if (z <= -1.02e+15) {
tmp = y / a;
} else if (z <= 4.4e-117) {
tmp = x / t;
} else if (z <= 1.35e-40) {
tmp = (z * y) / -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 <= (-9d+151)) then
tmp = y / a
else if (z <= (-7.8d+118)) then
tmp = (x / a) / -z
else if (z <= (-1.02d+15)) then
tmp = y / a
else if (z <= 4.4d-117) then
tmp = x / t
else if (z <= 1.35d-40) then
tmp = (z * y) / -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 <= -9e+151) {
tmp = y / a;
} else if (z <= -7.8e+118) {
tmp = (x / a) / -z;
} else if (z <= -1.02e+15) {
tmp = y / a;
} else if (z <= 4.4e-117) {
tmp = x / t;
} else if (z <= 1.35e-40) {
tmp = (z * y) / -t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9e+151: tmp = y / a elif z <= -7.8e+118: tmp = (x / a) / -z elif z <= -1.02e+15: tmp = y / a elif z <= 4.4e-117: tmp = x / t elif z <= 1.35e-40: tmp = (z * y) / -t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9e+151) tmp = Float64(y / a); elseif (z <= -7.8e+118) tmp = Float64(Float64(x / a) / Float64(-z)); elseif (z <= -1.02e+15) tmp = Float64(y / a); elseif (z <= 4.4e-117) tmp = Float64(x / t); elseif (z <= 1.35e-40) tmp = Float64(Float64(z * y) / Float64(-t)); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9e+151) tmp = y / a; elseif (z <= -7.8e+118) tmp = (x / a) / -z; elseif (z <= -1.02e+15) tmp = y / a; elseif (z <= 4.4e-117) tmp = x / t; elseif (z <= 1.35e-40) tmp = (z * y) / -t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9e+151], N[(y / a), $MachinePrecision], If[LessEqual[z, -7.8e+118], N[(N[(x / a), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, -1.02e+15], N[(y / a), $MachinePrecision], If[LessEqual[z, 4.4e-117], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.35e-40], N[(N[(z * y), $MachinePrecision] / (-t)), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+151}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{+118}:\\
\;\;\;\;\frac{\frac{x}{a}}{-z}\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{+15}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-117}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-40}:\\
\;\;\;\;\frac{z \cdot y}{-t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -8.9999999999999997e151 or -7.8e118 < z < -1.02e15 or 1.35e-40 < z Initial program 71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in z around inf 57.1%
if -8.9999999999999997e151 < z < -7.8e118Initial program 88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in x around 0 88.0%
Taylor expanded in a around inf 77.4%
mul-1-neg77.4%
unsub-neg77.4%
Simplified77.4%
Taylor expanded in y around 0 63.9%
associate-*r/63.9%
neg-mul-163.9%
*-commutative63.9%
Simplified63.9%
Taylor expanded in x around 0 63.9%
mul-1-neg63.9%
associate-/r*75.4%
distribute-neg-frac275.4%
Simplified75.4%
if -1.02e15 < z < 4.4000000000000002e-117Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 62.1%
if 4.4000000000000002e-117 < z < 1.35e-40Initial program 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in t around inf 67.7%
Taylor expanded in x around 0 49.3%
neg-mul-149.3%
distribute-neg-frac249.3%
Simplified49.3%
Final simplification59.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= z -4.5e+153)
(/ y a)
(if (<= z 9.4e-117)
t_1
(if (<= z 3e-91) (* y (/ z (- t))) (if (<= z 2.7e+138) t_1 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (z <= -4.5e+153) {
tmp = y / a;
} else if (z <= 9.4e-117) {
tmp = t_1;
} else if (z <= 3e-91) {
tmp = y * (z / -t);
} else if (z <= 2.7e+138) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x / (t - (z * a))
if (z <= (-4.5d+153)) then
tmp = y / a
else if (z <= 9.4d-117) then
tmp = t_1
else if (z <= 3d-91) then
tmp = y * (z / -t)
else if (z <= 2.7d+138) then
tmp = t_1
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (z <= -4.5e+153) {
tmp = y / a;
} else if (z <= 9.4e-117) {
tmp = t_1;
} else if (z <= 3e-91) {
tmp = y * (z / -t);
} else if (z <= 2.7e+138) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) tmp = 0 if z <= -4.5e+153: tmp = y / a elif z <= 9.4e-117: tmp = t_1 elif z <= 3e-91: tmp = y * (z / -t) elif z <= 2.7e+138: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (z <= -4.5e+153) tmp = Float64(y / a); elseif (z <= 9.4e-117) tmp = t_1; elseif (z <= 3e-91) tmp = Float64(y * Float64(z / Float64(-t))); elseif (z <= 2.7e+138) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (t - (z * a)); tmp = 0.0; if (z <= -4.5e+153) tmp = y / a; elseif (z <= 9.4e-117) tmp = t_1; elseif (z <= 3e-91) tmp = y * (z / -t); elseif (z <= 2.7e+138) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+153], N[(y / a), $MachinePrecision], If[LessEqual[z, 9.4e-117], t$95$1, If[LessEqual[z, 3e-91], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e+138], t$95$1, N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 9.4 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-91}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -4.5000000000000001e153 or 2.70000000000000009e138 < z Initial program 55.8%
*-commutative55.8%
Simplified55.8%
Taylor expanded in z around inf 71.5%
if -4.5000000000000001e153 < z < 9.40000000000000017e-117 or 3.0000000000000002e-91 < z < 2.70000000000000009e138Initial program 95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in x around inf 69.9%
*-commutative69.9%
Simplified69.9%
if 9.40000000000000017e-117 < z < 3.0000000000000002e-91Initial program 98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in t around inf 84.2%
div-sub84.2%
Applied egg-rr84.2%
Taylor expanded in x around 0 84.2%
mul-1-neg84.2%
associate-*r/85.0%
distribute-rgt-neg-in85.0%
distribute-neg-frac85.0%
Simplified85.0%
Final simplification70.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= z -3.9e+152)
(/ y a)
(if (<= z 7.5e-233)
t_1
(if (<= z 1.22e-40)
(/ (- x (* z y)) t)
(if (<= z 3.2e+130) t_1 (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (z <= -3.9e+152) {
tmp = y / a;
} else if (z <= 7.5e-233) {
tmp = t_1;
} else if (z <= 1.22e-40) {
tmp = (x - (z * y)) / t;
} else if (z <= 3.2e+130) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x / (t - (z * a))
if (z <= (-3.9d+152)) then
tmp = y / a
else if (z <= 7.5d-233) then
tmp = t_1
else if (z <= 1.22d-40) then
tmp = (x - (z * y)) / t
else if (z <= 3.2d+130) then
tmp = t_1
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (z <= -3.9e+152) {
tmp = y / a;
} else if (z <= 7.5e-233) {
tmp = t_1;
} else if (z <= 1.22e-40) {
tmp = (x - (z * y)) / t;
} else if (z <= 3.2e+130) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) tmp = 0 if z <= -3.9e+152: tmp = y / a elif z <= 7.5e-233: tmp = t_1 elif z <= 1.22e-40: tmp = (x - (z * y)) / t elif z <= 3.2e+130: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (z <= -3.9e+152) tmp = Float64(y / a); elseif (z <= 7.5e-233) tmp = t_1; elseif (z <= 1.22e-40) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 3.2e+130) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (t - (z * a)); tmp = 0.0; if (z <= -3.9e+152) tmp = y / a; elseif (z <= 7.5e-233) tmp = t_1; elseif (z <= 1.22e-40) tmp = (x - (z * y)) / t; elseif (z <= 3.2e+130) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.9e+152], N[(y / a), $MachinePrecision], If[LessEqual[z, 7.5e-233], t$95$1, If[LessEqual[z, 1.22e-40], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.2e+130], t$95$1, N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{+152}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-233}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{-40}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.90000000000000011e152 or 3.2e130 < z Initial program 55.8%
*-commutative55.8%
Simplified55.8%
Taylor expanded in z around inf 71.5%
if -3.90000000000000011e152 < z < 7.49999999999999974e-233 or 1.22e-40 < z < 3.2e130Initial program 94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in x around inf 69.5%
*-commutative69.5%
Simplified69.5%
if 7.49999999999999974e-233 < z < 1.22e-40Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 77.5%
Final simplification71.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2700000000.0)
(/ y a)
(if (<= z 9.4e-117)
(/ x t)
(if (<= z 5e-82) (* y (/ z (- t))) (if (<= z 1.8e-41) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2700000000.0) {
tmp = y / a;
} else if (z <= 9.4e-117) {
tmp = x / t;
} else if (z <= 5e-82) {
tmp = y * (z / -t);
} else if (z <= 1.8e-41) {
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 <= (-2700000000.0d0)) then
tmp = y / a
else if (z <= 9.4d-117) then
tmp = x / t
else if (z <= 5d-82) then
tmp = y * (z / -t)
else if (z <= 1.8d-41) 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 <= -2700000000.0) {
tmp = y / a;
} else if (z <= 9.4e-117) {
tmp = x / t;
} else if (z <= 5e-82) {
tmp = y * (z / -t);
} else if (z <= 1.8e-41) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2700000000.0: tmp = y / a elif z <= 9.4e-117: tmp = x / t elif z <= 5e-82: tmp = y * (z / -t) elif z <= 1.8e-41: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2700000000.0) tmp = Float64(y / a); elseif (z <= 9.4e-117) tmp = Float64(x / t); elseif (z <= 5e-82) tmp = Float64(y * Float64(z / Float64(-t))); elseif (z <= 1.8e-41) 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 <= -2700000000.0) tmp = y / a; elseif (z <= 9.4e-117) tmp = x / t; elseif (z <= 5e-82) tmp = y * (z / -t); elseif (z <= 1.8e-41) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2700000000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, 9.4e-117], N[(x / t), $MachinePrecision], If[LessEqual[z, 5e-82], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-41], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2700000000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 9.4 \cdot 10^{-117}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-82}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-41}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.7e9 or 1.8e-41 < z Initial program 73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in z around inf 54.2%
if -2.7e9 < z < 9.40000000000000017e-117 or 4.9999999999999998e-82 < z < 1.8e-41Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 60.8%
if 9.40000000000000017e-117 < z < 4.9999999999999998e-82Initial program 98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in t around inf 72.8%
div-sub72.8%
Applied egg-rr72.8%
Taylor expanded in x around 0 73.4%
mul-1-neg73.4%
associate-*r/74.1%
distribute-rgt-neg-in74.1%
distribute-neg-frac74.1%
Simplified74.1%
Final simplification57.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -1.25e+78)
t_1
(if (<= z 3.8e-228)
(/ x (- t (* z a)))
(if (<= z 1.65e-40) (/ (- x (* z y)) t) 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 <= -1.25e+78) {
tmp = t_1;
} else if (z <= 3.8e-228) {
tmp = x / (t - (z * a));
} else if (z <= 1.65e-40) {
tmp = (x - (z * y)) / t;
} 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 <= (-1.25d+78)) then
tmp = t_1
else if (z <= 3.8d-228) then
tmp = x / (t - (z * a))
else if (z <= 1.65d-40) then
tmp = (x - (z * y)) / t
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 <= -1.25e+78) {
tmp = t_1;
} else if (z <= 3.8e-228) {
tmp = x / (t - (z * a));
} else if (z <= 1.65e-40) {
tmp = (x - (z * y)) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if z <= -1.25e+78: tmp = t_1 elif z <= 3.8e-228: tmp = x / (t - (z * a)) elif z <= 1.65e-40: tmp = (x - (z * y)) / t 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 <= -1.25e+78) tmp = t_1; elseif (z <= 3.8e-228) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 1.65e-40) tmp = Float64(Float64(x - Float64(z * y)) / t); 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 <= -1.25e+78) tmp = t_1; elseif (z <= 3.8e-228) tmp = x / (t - (z * a)); elseif (z <= 1.65e-40) tmp = (x - (z * y)) / t; 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, -1.25e+78], t$95$1, If[LessEqual[z, 3.8e-228], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-40], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-228}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-40}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.24999999999999996e78 or 1.64999999999999996e-40 < z Initial program 70.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in x around 0 70.2%
Taylor expanded in a around inf 76.8%
mul-1-neg76.8%
unsub-neg76.8%
Simplified76.8%
if -1.24999999999999996e78 < z < 3.7999999999999999e-228Initial program 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in x around inf 77.8%
*-commutative77.8%
Simplified77.8%
if 3.7999999999999999e-228 < z < 1.64999999999999996e-40Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 77.5%
Final simplification77.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- y (/ x z))))
(if (<= z -2.9e+82)
(/ t_1 a)
(if (<= z 1.32e+196) (/ (- x (* z y)) (- t (* z a))) (* t_1 (/ 1.0 a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y - (x / z);
double tmp;
if (z <= -2.9e+82) {
tmp = t_1 / a;
} else if (z <= 1.32e+196) {
tmp = (x - (z * y)) / (t - (z * a));
} else {
tmp = t_1 * (1.0 / 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 = y - (x / z)
if (z <= (-2.9d+82)) then
tmp = t_1 / a
else if (z <= 1.32d+196) then
tmp = (x - (z * y)) / (t - (z * a))
else
tmp = t_1 * (1.0d0 / a)
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);
double tmp;
if (z <= -2.9e+82) {
tmp = t_1 / a;
} else if (z <= 1.32e+196) {
tmp = (x - (z * y)) / (t - (z * a));
} else {
tmp = t_1 * (1.0 / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y - (x / z) tmp = 0 if z <= -2.9e+82: tmp = t_1 / a elif z <= 1.32e+196: tmp = (x - (z * y)) / (t - (z * a)) else: tmp = t_1 * (1.0 / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(y - Float64(x / z)) tmp = 0.0 if (z <= -2.9e+82) tmp = Float64(t_1 / a); elseif (z <= 1.32e+196) tmp = Float64(Float64(x - Float64(z * y)) / Float64(t - Float64(z * a))); else tmp = Float64(t_1 * Float64(1.0 / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y - (x / z); tmp = 0.0; if (z <= -2.9e+82) tmp = t_1 / a; elseif (z <= 1.32e+196) tmp = (x - (z * y)) / (t - (z * a)); else tmp = t_1 * (1.0 / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+82], N[(t$95$1 / a), $MachinePrecision], If[LessEqual[z, 1.32e+196], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \frac{x}{z}\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+82}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+196}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{1}{a}\\
\end{array}
\end{array}
if z < -2.9000000000000001e82Initial program 58.3%
*-commutative58.3%
Simplified58.3%
Taylor expanded in x around 0 58.3%
Taylor expanded in a around inf 89.4%
mul-1-neg89.4%
unsub-neg89.4%
Simplified89.4%
if -2.9000000000000001e82 < z < 1.32e196Initial program 95.8%
if 1.32e196 < z Initial program 36.0%
*-commutative36.0%
Simplified36.0%
Taylor expanded in x around 0 36.0%
Taylor expanded in a around inf 88.2%
mul-1-neg88.2%
unsub-neg88.2%
Simplified88.2%
div-inv88.3%
Applied egg-rr88.3%
Final simplification94.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -7.4e-29) (not (<= x 1.6e+21))) (/ x (- t (* z a))) (/ y (- a (/ t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -7.4e-29) || !(x <= 1.6e+21)) {
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 <= (-7.4d-29)) .or. (.not. (x <= 1.6d+21))) 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 <= -7.4e-29) || !(x <= 1.6e+21)) {
tmp = x / (t - (z * a));
} else {
tmp = y / (a - (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -7.4e-29) or not (x <= 1.6e+21): 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 <= -7.4e-29) || !(x <= 1.6e+21)) 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 <= -7.4e-29) || ~((x <= 1.6e+21))) 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, -7.4e-29], N[Not[LessEqual[x, 1.6e+21]], $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 -7.4 \cdot 10^{-29} \lor \neg \left(x \leq 1.6 \cdot 10^{+21}\right):\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\end{array}
\end{array}
if x < -7.3999999999999995e-29 or 1.6e21 < x Initial program 88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in x around inf 77.1%
*-commutative77.1%
Simplified77.1%
if -7.3999999999999995e-29 < x < 1.6e21Initial program 84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in z around inf 77.5%
Taylor expanded in x around 0 79.3%
associate-*r/79.3%
neg-mul-179.3%
Simplified79.3%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -36000000000000.0) (not (<= z 1.1e-40))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -36000000000000.0) || !(z <= 1.1e-40)) {
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 <= (-36000000000000.0d0)) .or. (.not. (z <= 1.1d-40))) 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 <= -36000000000000.0) || !(z <= 1.1e-40)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -36000000000000.0) or not (z <= 1.1e-40): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -36000000000000.0) || !(z <= 1.1e-40)) 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 <= -36000000000000.0) || ~((z <= 1.1e-40))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -36000000000000.0], N[Not[LessEqual[z, 1.1e-40]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -36000000000000 \lor \neg \left(z \leq 1.1 \cdot 10^{-40}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -3.6e13 or 1.10000000000000004e-40 < z Initial program 73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in z around inf 54.2%
if -3.6e13 < z < 1.10000000000000004e-40Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 57.6%
Final simplification55.9%
(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.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in z around 0 38.7%
Final simplification38.7%
(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 2024077
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:alt
(if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))
(/ (- x (* y z)) (- t (* a z))))