
(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 9 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 (<= z -3.3e+179) (/ y (- a (/ t z))) (if (<= z 1.55e+109) (/ (- x (* z y)) (- t (* z a))) (/ (- y (/ x z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.3e+179) {
tmp = y / (a - (t / z));
} else if (z <= 1.55e+109) {
tmp = (x - (z * y)) / (t - (z * a));
} 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 (z <= (-3.3d+179)) then
tmp = y / (a - (t / z))
else if (z <= 1.55d+109) then
tmp = (x - (z * y)) / (t - (z * a))
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 (z <= -3.3e+179) {
tmp = y / (a - (t / z));
} else if (z <= 1.55e+109) {
tmp = (x - (z * y)) / (t - (z * a));
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.3e+179: tmp = y / (a - (t / z)) elif z <= 1.55e+109: tmp = (x - (z * y)) / (t - (z * a)) else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.3e+179) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (z <= 1.55e+109) tmp = Float64(Float64(x - Float64(z * y)) / Float64(t - Float64(z * a))); 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 (z <= -3.3e+179) tmp = y / (a - (t / z)); elseif (z <= 1.55e+109) tmp = (x - (z * y)) / (t - (z * a)); else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.3e+179], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+109], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+179}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+109}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < -3.29999999999999978e179Initial program 51.1%
*-commutative51.1%
Simplified51.1%
Taylor expanded in z around inf 51.1%
Taylor expanded in x around 0 95.5%
mul-1-neg95.5%
distribute-neg-frac295.5%
sub-neg95.5%
+-commutative95.5%
distribute-neg-in95.5%
remove-double-neg95.5%
unsub-neg95.5%
Simplified95.5%
if -3.29999999999999978e179 < z < 1.54999999999999996e109Initial program 95.0%
if 1.54999999999999996e109 < z Initial program 40.8%
*-commutative40.8%
Simplified40.8%
Taylor expanded in y around -inf 57.2%
Simplified54.0%
Taylor expanded in a around inf 83.7%
associate-*r/83.7%
associate-*r*83.7%
neg-mul-183.7%
sub-neg83.7%
associate-/r*72.9%
metadata-eval72.9%
Simplified72.9%
Taylor expanded in y around 0 86.4%
mul-1-neg86.4%
unsub-neg86.4%
Simplified86.4%
Final simplification93.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.2e+179)
(/ y a)
(if (<= z -6.4e+147)
(/ (/ x z) (- a))
(if (<= z -4e+25)
(/ y a)
(if (<= z -3.9e-54)
(/ (* z y) (- t))
(if (<= z 7.4e-93) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e+179) {
tmp = y / a;
} else if (z <= -6.4e+147) {
tmp = (x / z) / -a;
} else if (z <= -4e+25) {
tmp = y / a;
} else if (z <= -3.9e-54) {
tmp = (z * y) / -t;
} else if (z <= 7.4e-93) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.2d+179)) then
tmp = y / a
else if (z <= (-6.4d+147)) then
tmp = (x / z) / -a
else if (z <= (-4d+25)) then
tmp = y / a
else if (z <= (-3.9d-54)) then
tmp = (z * y) / -t
else if (z <= 7.4d-93) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e+179) {
tmp = y / a;
} else if (z <= -6.4e+147) {
tmp = (x / z) / -a;
} else if (z <= -4e+25) {
tmp = y / a;
} else if (z <= -3.9e-54) {
tmp = (z * y) / -t;
} else if (z <= 7.4e-93) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.2e+179: tmp = y / a elif z <= -6.4e+147: tmp = (x / z) / -a elif z <= -4e+25: tmp = y / a elif z <= -3.9e-54: tmp = (z * y) / -t elif z <= 7.4e-93: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.2e+179) tmp = Float64(y / a); elseif (z <= -6.4e+147) tmp = Float64(Float64(x / z) / Float64(-a)); elseif (z <= -4e+25) tmp = Float64(y / a); elseif (z <= -3.9e-54) tmp = Float64(Float64(z * y) / Float64(-t)); elseif (z <= 7.4e-93) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.2e+179) tmp = y / a; elseif (z <= -6.4e+147) tmp = (x / z) / -a; elseif (z <= -4e+25) tmp = y / a; elseif (z <= -3.9e-54) tmp = (z * y) / -t; elseif (z <= 7.4e-93) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e+179], N[(y / a), $MachinePrecision], If[LessEqual[z, -6.4e+147], N[(N[(x / z), $MachinePrecision] / (-a)), $MachinePrecision], If[LessEqual[z, -4e+25], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.9e-54], N[(N[(z * y), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[z, 7.4e-93], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+179}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{+147}:\\
\;\;\;\;\frac{\frac{x}{z}}{-a}\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+25}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{-54}:\\
\;\;\;\;\frac{z \cdot y}{-t}\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-93}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.2000000000000002e179 or -6.39999999999999958e147 < z < -4.00000000000000036e25 or 7.40000000000000005e-93 < z Initial program 67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in z around inf 58.6%
if -3.2000000000000002e179 < z < -6.39999999999999958e147Initial program 71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in y around -inf 71.2%
Simplified61.5%
Taylor expanded in a around inf 32.3%
associate-*r/32.3%
associate-*r*32.3%
neg-mul-132.3%
sub-neg32.3%
associate-/r*32.2%
metadata-eval32.2%
Simplified32.2%
Taylor expanded in y around 0 51.8%
associate-*r/51.8%
mul-1-neg51.8%
Simplified51.8%
if -4.00000000000000036e25 < z < -3.9e-54Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around 0 61.4%
mul-1-neg61.4%
associate-/l*61.4%
distribute-rgt-neg-in61.4%
distribute-neg-frac261.4%
cancel-sign-sub-inv61.4%
*-commutative61.4%
+-commutative61.4%
*-commutative61.4%
neg-mul-161.4%
associate-*r*61.4%
mul-1-neg61.4%
distribute-rgt-neg-in61.4%
fma-undefine61.4%
neg-sub061.4%
fma-undefine61.4%
distribute-rgt-neg-in61.4%
mul-1-neg61.4%
associate-*r*61.4%
neg-mul-161.4%
*-commutative61.4%
associate--r+61.4%
Simplified61.4%
Taylor expanded in z around 0 54.9%
associate-*r/54.9%
neg-mul-154.9%
Simplified54.9%
Taylor expanded in y around 0 54.9%
associate-*r/54.9%
*-commutative54.9%
neg-mul-154.9%
distribute-rgt-neg-in54.9%
Simplified54.9%
if -3.9e-54 < z < 7.40000000000000005e-93Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.0%
Final simplification57.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.6e+179)
(/ y a)
(if (<= z -5e+117)
(* y (/ z (- t)))
(if (<= z -4e+25)
(/ y a)
(if (<= z -1.65e-54)
(/ (* z y) (- t))
(if (<= z 7.4e-93) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e+179) {
tmp = y / a;
} else if (z <= -5e+117) {
tmp = y * (z / -t);
} else if (z <= -4e+25) {
tmp = y / a;
} else if (z <= -1.65e-54) {
tmp = (z * y) / -t;
} else if (z <= 7.4e-93) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.6d+179)) then
tmp = y / a
else if (z <= (-5d+117)) then
tmp = y * (z / -t)
else if (z <= (-4d+25)) then
tmp = y / a
else if (z <= (-1.65d-54)) then
tmp = (z * y) / -t
else if (z <= 7.4d-93) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e+179) {
tmp = y / a;
} else if (z <= -5e+117) {
tmp = y * (z / -t);
} else if (z <= -4e+25) {
tmp = y / a;
} else if (z <= -1.65e-54) {
tmp = (z * y) / -t;
} else if (z <= 7.4e-93) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.6e+179: tmp = y / a elif z <= -5e+117: tmp = y * (z / -t) elif z <= -4e+25: tmp = y / a elif z <= -1.65e-54: tmp = (z * y) / -t elif z <= 7.4e-93: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.6e+179) tmp = Float64(y / a); elseif (z <= -5e+117) tmp = Float64(y * Float64(z / Float64(-t))); elseif (z <= -4e+25) tmp = Float64(y / a); elseif (z <= -1.65e-54) tmp = Float64(Float64(z * y) / Float64(-t)); elseif (z <= 7.4e-93) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.6e+179) tmp = y / a; elseif (z <= -5e+117) tmp = y * (z / -t); elseif (z <= -4e+25) tmp = y / a; elseif (z <= -1.65e-54) tmp = (z * y) / -t; elseif (z <= 7.4e-93) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.6e+179], N[(y / a), $MachinePrecision], If[LessEqual[z, -5e+117], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4e+25], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.65e-54], N[(N[(z * y), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[z, 7.4e-93], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+179}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -5 \cdot 10^{+117}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+25}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-54}:\\
\;\;\;\;\frac{z \cdot y}{-t}\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-93}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.5999999999999998e179 or -4.99999999999999983e117 < z < -4.00000000000000036e25 or 7.40000000000000005e-93 < z Initial program 68.1%
*-commutative68.1%
Simplified68.1%
Taylor expanded in z around inf 59.7%
if -3.5999999999999998e179 < z < -4.99999999999999983e117Initial program 66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in x around 0 30.9%
mul-1-neg30.9%
associate-/l*50.8%
distribute-rgt-neg-in50.8%
distribute-neg-frac250.8%
cancel-sign-sub-inv50.8%
*-commutative50.8%
+-commutative50.8%
*-commutative50.8%
neg-mul-150.8%
associate-*r*50.8%
mul-1-neg50.8%
distribute-rgt-neg-in50.8%
fma-undefine50.8%
neg-sub050.8%
fma-undefine50.8%
distribute-rgt-neg-in50.8%
mul-1-neg50.8%
associate-*r*50.8%
neg-mul-150.8%
*-commutative50.8%
associate--r+50.8%
Simplified50.8%
Taylor expanded in z around 0 43.4%
associate-*r/43.4%
neg-mul-143.4%
Simplified43.4%
if -4.00000000000000036e25 < z < -1.64999999999999996e-54Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around 0 61.4%
mul-1-neg61.4%
associate-/l*61.4%
distribute-rgt-neg-in61.4%
distribute-neg-frac261.4%
cancel-sign-sub-inv61.4%
*-commutative61.4%
+-commutative61.4%
*-commutative61.4%
neg-mul-161.4%
associate-*r*61.4%
mul-1-neg61.4%
distribute-rgt-neg-in61.4%
fma-undefine61.4%
neg-sub061.4%
fma-undefine61.4%
distribute-rgt-neg-in61.4%
mul-1-neg61.4%
associate-*r*61.4%
neg-mul-161.4%
*-commutative61.4%
associate--r+61.4%
Simplified61.4%
Taylor expanded in z around 0 54.9%
associate-*r/54.9%
neg-mul-154.9%
Simplified54.9%
Taylor expanded in y around 0 54.9%
associate-*r/54.9%
*-commutative54.9%
neg-mul-154.9%
distribute-rgt-neg-in54.9%
Simplified54.9%
if -1.64999999999999996e-54 < z < 7.40000000000000005e-93Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.0%
Final simplification57.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z (- t)))))
(if (<= z -3.6e+179)
(/ y a)
(if (<= z -1.9e+119)
t_1
(if (<= z -4e+25)
(/ y a)
(if (<= z -1.05e-54) t_1 (if (<= z 5.5e-93) (/ x t) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / -t);
double tmp;
if (z <= -3.6e+179) {
tmp = y / a;
} else if (z <= -1.9e+119) {
tmp = t_1;
} else if (z <= -4e+25) {
tmp = y / a;
} else if (z <= -1.05e-54) {
tmp = t_1;
} else if (z <= 5.5e-93) {
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 = y * (z / -t)
if (z <= (-3.6d+179)) then
tmp = y / a
else if (z <= (-1.9d+119)) then
tmp = t_1
else if (z <= (-4d+25)) then
tmp = y / a
else if (z <= (-1.05d-54)) then
tmp = t_1
else if (z <= 5.5d-93) 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 = y * (z / -t);
double tmp;
if (z <= -3.6e+179) {
tmp = y / a;
} else if (z <= -1.9e+119) {
tmp = t_1;
} else if (z <= -4e+25) {
tmp = y / a;
} else if (z <= -1.05e-54) {
tmp = t_1;
} else if (z <= 5.5e-93) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / -t) tmp = 0 if z <= -3.6e+179: tmp = y / a elif z <= -1.9e+119: tmp = t_1 elif z <= -4e+25: tmp = y / a elif z <= -1.05e-54: tmp = t_1 elif z <= 5.5e-93: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / Float64(-t))) tmp = 0.0 if (z <= -3.6e+179) tmp = Float64(y / a); elseif (z <= -1.9e+119) tmp = t_1; elseif (z <= -4e+25) tmp = Float64(y / a); elseif (z <= -1.05e-54) tmp = t_1; elseif (z <= 5.5e-93) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / -t); tmp = 0.0; if (z <= -3.6e+179) tmp = y / a; elseif (z <= -1.9e+119) tmp = t_1; elseif (z <= -4e+25) tmp = y / a; elseif (z <= -1.05e-54) tmp = t_1; elseif (z <= 5.5e-93) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e+179], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.9e+119], t$95$1, If[LessEqual[z, -4e+25], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.05e-54], t$95$1, If[LessEqual[z, 5.5e-93], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{-t}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+179}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+25}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-93}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.5999999999999998e179 or -1.89999999999999995e119 < z < -4.00000000000000036e25 or 5.49999999999999968e-93 < z Initial program 68.1%
*-commutative68.1%
Simplified68.1%
Taylor expanded in z around inf 59.7%
if -3.5999999999999998e179 < z < -1.89999999999999995e119 or -4.00000000000000036e25 < z < -1.05e-54Initial program 89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in x around 0 51.7%
mul-1-neg51.7%
associate-/l*58.0%
distribute-rgt-neg-in58.0%
distribute-neg-frac258.0%
cancel-sign-sub-inv58.0%
*-commutative58.0%
+-commutative58.0%
*-commutative58.0%
neg-mul-158.0%
associate-*r*58.0%
mul-1-neg58.0%
distribute-rgt-neg-in58.0%
fma-undefine58.0%
neg-sub058.0%
fma-undefine58.0%
distribute-rgt-neg-in58.0%
mul-1-neg58.0%
associate-*r*58.0%
neg-mul-158.0%
*-commutative58.0%
associate--r+58.0%
Simplified58.0%
Taylor expanded in z around 0 51.3%
associate-*r/51.3%
neg-mul-151.3%
Simplified51.3%
if -1.05e-54 < z < 5.49999999999999968e-93Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.0%
Final simplification57.2%
(FPCore (x y z t a)
:precision binary64
(if (or (<= a -6500000.0)
(and (not (<= a -2.9e-33))
(or (<= a -4.2e-77) (not (<= a 1.45e-105)))))
(/ (- y (/ x z)) a)
(/ (- x (* z y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6500000.0) || (!(a <= -2.9e-33) && ((a <= -4.2e-77) || !(a <= 1.45e-105)))) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-6500000.0d0)) .or. (.not. (a <= (-2.9d-33))) .and. (a <= (-4.2d-77)) .or. (.not. (a <= 1.45d-105))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (z * y)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6500000.0) || (!(a <= -2.9e-33) && ((a <= -4.2e-77) || !(a <= 1.45e-105)))) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6500000.0) or (not (a <= -2.9e-33) and ((a <= -4.2e-77) or not (a <= 1.45e-105))): tmp = (y - (x / z)) / a else: tmp = (x - (z * y)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6500000.0) || (!(a <= -2.9e-33) && ((a <= -4.2e-77) || !(a <= 1.45e-105)))) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(z * y)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -6500000.0) || (~((a <= -2.9e-33)) && ((a <= -4.2e-77) || ~((a <= 1.45e-105))))) tmp = (y - (x / z)) / a; else tmp = (x - (z * y)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6500000.0], And[N[Not[LessEqual[a, -2.9e-33]], $MachinePrecision], Or[LessEqual[a, -4.2e-77], N[Not[LessEqual[a, 1.45e-105]], $MachinePrecision]]]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6500000 \lor \neg \left(a \leq -2.9 \cdot 10^{-33}\right) \land \left(a \leq -4.2 \cdot 10^{-77} \lor \neg \left(a \leq 1.45 \cdot 10^{-105}\right)\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\end{array}
\end{array}
if a < -6.5e6 or -2.90000000000000003e-33 < a < -4.20000000000000031e-77 or 1.45000000000000002e-105 < a Initial program 73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in y around -inf 71.4%
Simplified72.5%
Taylor expanded in a around inf 74.7%
associate-*r/74.7%
associate-*r*74.7%
neg-mul-174.7%
sub-neg74.7%
associate-/r*72.0%
metadata-eval72.0%
Simplified72.0%
Taylor expanded in y around 0 82.7%
mul-1-neg82.7%
unsub-neg82.7%
Simplified82.7%
if -6.5e6 < a < -2.90000000000000003e-33 or -4.20000000000000031e-77 < a < 1.45000000000000002e-105Initial program 96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in t around inf 89.6%
Final simplification85.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (- t (* z a)))))
(if (<= y -2.9e+103)
(/ y a)
(if (<= y 4.2e+21)
t_1
(if (<= y 2.4e+53)
(/ y a)
(if (<= y 2.8e+171) t_1 (* y (/ z (- t)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (t - (z * a));
double tmp;
if (y <= -2.9e+103) {
tmp = y / a;
} else if (y <= 4.2e+21) {
tmp = t_1;
} else if (y <= 2.4e+53) {
tmp = y / a;
} else if (y <= 2.8e+171) {
tmp = t_1;
} else {
tmp = y * (z / -t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x / (t - (z * a))
if (y <= (-2.9d+103)) then
tmp = y / a
else if (y <= 4.2d+21) then
tmp = t_1
else if (y <= 2.4d+53) then
tmp = y / a
else if (y <= 2.8d+171) then
tmp = t_1
else
tmp = y * (z / -t)
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 (y <= -2.9e+103) {
tmp = y / a;
} else if (y <= 4.2e+21) {
tmp = t_1;
} else if (y <= 2.4e+53) {
tmp = y / a;
} else if (y <= 2.8e+171) {
tmp = t_1;
} else {
tmp = y * (z / -t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (t - (z * a)) tmp = 0 if y <= -2.9e+103: tmp = y / a elif y <= 4.2e+21: tmp = t_1 elif y <= 2.4e+53: tmp = y / a elif y <= 2.8e+171: tmp = t_1 else: tmp = y * (z / -t) return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (y <= -2.9e+103) tmp = Float64(y / a); elseif (y <= 4.2e+21) tmp = t_1; elseif (y <= 2.4e+53) tmp = Float64(y / a); elseif (y <= 2.8e+171) tmp = t_1; else tmp = Float64(y * Float64(z / Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (t - (z * a)); tmp = 0.0; if (y <= -2.9e+103) tmp = y / a; elseif (y <= 4.2e+21) tmp = t_1; elseif (y <= 2.4e+53) tmp = y / a; elseif (y <= 2.8e+171) tmp = t_1; else tmp = y * (z / -t); 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[y, -2.9e+103], N[(y / a), $MachinePrecision], If[LessEqual[y, 4.2e+21], t$95$1, If[LessEqual[y, 2.4e+53], N[(y / a), $MachinePrecision], If[LessEqual[y, 2.8e+171], t$95$1, N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{+103}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+53}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\end{array}
\end{array}
if y < -2.8999999999999998e103 or 4.2e21 < y < 2.4e53Initial program 69.0%
*-commutative69.0%
Simplified69.0%
Taylor expanded in z around inf 64.6%
if -2.8999999999999998e103 < y < 4.2e21 or 2.4e53 < y < 2.80000000000000004e171Initial program 91.6%
*-commutative91.6%
Simplified91.6%
Taylor expanded in x around inf 71.2%
*-commutative71.2%
Simplified71.2%
if 2.80000000000000004e171 < y Initial program 61.8%
*-commutative61.8%
Simplified61.8%
Taylor expanded in x around 0 49.1%
mul-1-neg49.1%
associate-/l*58.0%
distribute-rgt-neg-in58.0%
distribute-neg-frac258.0%
cancel-sign-sub-inv58.0%
*-commutative58.0%
+-commutative58.0%
*-commutative58.0%
neg-mul-158.0%
associate-*r*58.0%
mul-1-neg58.0%
distribute-rgt-neg-in58.0%
fma-undefine58.0%
neg-sub058.0%
fma-undefine58.0%
distribute-rgt-neg-in58.0%
mul-1-neg58.0%
associate-*r*58.0%
neg-mul-158.0%
*-commutative58.0%
associate--r+58.0%
Simplified58.0%
Taylor expanded in z around 0 49.3%
associate-*r/49.3%
neg-mul-149.3%
Simplified49.3%
Final simplification67.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -1.65e-25) (not (<= x 2e-19))) (/ x (- t (* z a))) (/ y (- a (/ t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.65e-25) || !(x <= 2e-19)) {
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 <= (-1.65d-25)) .or. (.not. (x <= 2d-19))) 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 <= -1.65e-25) || !(x <= 2e-19)) {
tmp = x / (t - (z * a));
} else {
tmp = y / (a - (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -1.65e-25) or not (x <= 2e-19): 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 <= -1.65e-25) || !(x <= 2e-19)) 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 <= -1.65e-25) || ~((x <= 2e-19))) 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, -1.65e-25], N[Not[LessEqual[x, 2e-19]], $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 -1.65 \cdot 10^{-25} \lor \neg \left(x \leq 2 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\end{array}
\end{array}
if x < -1.6499999999999999e-25 or 2e-19 < x Initial program 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in x around inf 69.5%
*-commutative69.5%
Simplified69.5%
if -1.6499999999999999e-25 < x < 2e-19Initial program 82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in z around inf 77.2%
Taylor expanded in x around 0 78.6%
mul-1-neg78.6%
distribute-neg-frac278.6%
sub-neg78.6%
+-commutative78.6%
distribute-neg-in78.6%
remove-double-neg78.6%
unsub-neg78.6%
Simplified78.6%
Final simplification73.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -43000000.0) (not (<= z 7.4e-93))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -43000000.0) || !(z <= 7.4e-93)) {
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 <= (-43000000.0d0)) .or. (.not. (z <= 7.4d-93))) 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 <= -43000000.0) || !(z <= 7.4e-93)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -43000000.0) or not (z <= 7.4e-93): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -43000000.0) || !(z <= 7.4e-93)) 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 <= -43000000.0) || ~((z <= 7.4e-93))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -43000000.0], N[Not[LessEqual[z, 7.4e-93]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -43000000 \lor \neg \left(z \leq 7.4 \cdot 10^{-93}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -4.3e7 or 7.40000000000000005e-93 < z Initial program 70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in z around inf 53.2%
if -4.3e7 < z < 7.40000000000000005e-93Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 52.0%
Final simplification52.7%
(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 83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in z around 0 32.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 2024110
(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))))