
(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 8 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)) a)))
(if (<= z -3.6e+84)
t_1
(if (<= z 3.3e+111) (/ (- x (* z y)) (- 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 <= -3.6e+84) {
tmp = t_1;
} else if (z <= 3.3e+111) {
tmp = (x - (z * y)) / (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 <= (-3.6d+84)) then
tmp = t_1
else if (z <= 3.3d+111) then
tmp = (x - (z * y)) / (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 <= -3.6e+84) {
tmp = t_1;
} else if (z <= 3.3e+111) {
tmp = (x - (z * y)) / (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 <= -3.6e+84: tmp = t_1 elif z <= 3.3e+111: tmp = (x - (z * y)) / (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 <= -3.6e+84) tmp = t_1; elseif (z <= 3.3e+111) tmp = Float64(Float64(x - Float64(z * y)) / 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 <= -3.6e+84) tmp = t_1; elseif (z <= 3.3e+111) tmp = (x - (z * y)) / (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, -3.6e+84], t$95$1, If[LessEqual[z, 3.3e+111], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / 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 -3.6 \cdot 10^{+84}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+111}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.5999999999999999e84 or 3.3000000000000001e111 < z Initial program 48.7%
Taylor expanded in t around 0
associate-*r/N/A
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
div-subN/A
sub-negN/A
distribute-lft-inN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
remove-double-negN/A
remove-double-negN/A
neg-mul-1N/A
remove-double-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6484.9%
Simplified84.9%
if -3.5999999999999999e84 < z < 3.3000000000000001e111Initial program 97.6%
Final simplification93.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -3.4e+18)
t_1
(if (<= z -6e-62)
(/ y (/ (- (* z a) t) z))
(if (<= z 8.8e-51)
(/ x (- t (* z a)))
(if (<= z 1.25e+20) (/ (* z (- (/ 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 <= -3.4e+18) {
tmp = t_1;
} else if (z <= -6e-62) {
tmp = y / (((z * a) - t) / z);
} else if (z <= 8.8e-51) {
tmp = x / (t - (z * a));
} else if (z <= 1.25e+20) {
tmp = (z * ((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 <= (-3.4d+18)) then
tmp = t_1
else if (z <= (-6d-62)) then
tmp = y / (((z * a) - t) / z)
else if (z <= 8.8d-51) then
tmp = x / (t - (z * a))
else if (z <= 1.25d+20) then
tmp = (z * ((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 <= -3.4e+18) {
tmp = t_1;
} else if (z <= -6e-62) {
tmp = y / (((z * a) - t) / z);
} else if (z <= 8.8e-51) {
tmp = x / (t - (z * a));
} else if (z <= 1.25e+20) {
tmp = (z * ((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 <= -3.4e+18: tmp = t_1 elif z <= -6e-62: tmp = y / (((z * a) - t) / z) elif z <= 8.8e-51: tmp = x / (t - (z * a)) elif z <= 1.25e+20: tmp = (z * ((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 <= -3.4e+18) tmp = t_1; elseif (z <= -6e-62) tmp = Float64(y / Float64(Float64(Float64(z * a) - t) / z)); elseif (z <= 8.8e-51) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 1.25e+20) tmp = Float64(Float64(z * Float64(Float64(x / 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 <= -3.4e+18) tmp = t_1; elseif (z <= -6e-62) tmp = y / (((z * a) - t) / z); elseif (z <= 8.8e-51) tmp = x / (t - (z * a)); elseif (z <= 1.25e+20) tmp = (z * ((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, -3.4e+18], t$95$1, If[LessEqual[z, -6e-62], N[(y / N[(N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e-51], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+20], N[(N[(z * N[(N[(x / z), $MachinePrecision] - 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 -3.4 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-62}:\\
\;\;\;\;\frac{y}{\frac{z \cdot a - t}{z}}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-51}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+20}:\\
\;\;\;\;\frac{z \cdot \left(\frac{x}{z} - y\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.4e18 or 1.25e20 < z Initial program 58.6%
Taylor expanded in t around 0
associate-*r/N/A
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
div-subN/A
sub-negN/A
distribute-lft-inN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
remove-double-negN/A
remove-double-negN/A
neg-mul-1N/A
remove-double-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6482.1%
Simplified82.1%
if -3.4e18 < z < -6.0000000000000002e-62Initial program 99.3%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6499.2%
Applied egg-rr99.2%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6467.7%
Simplified67.7%
sub0-negN/A
clear-numN/A
un-div-invN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-fracN/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6467.9%
Applied egg-rr67.9%
if -6.0000000000000002e-62 < z < 8.8000000000000001e-51Initial program 99.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6482.1%
Simplified82.1%
if 8.8000000000000001e-51 < z < 1.25e20Initial program 99.7%
Taylor expanded in t around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6475.4%
Simplified75.4%
Taylor expanded in z around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6475.4%
Simplified75.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -33000000.0)
t_1
(if (<= z -7.2e-62)
(/ y (/ (- (* z a) t) z))
(if (<= z 9e-53)
(/ x (- t (* z a)))
(if (<= z 9.8e+16) (/ (- 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 <= -33000000.0) {
tmp = t_1;
} else if (z <= -7.2e-62) {
tmp = y / (((z * a) - t) / z);
} else if (z <= 9e-53) {
tmp = x / (t - (z * a));
} else if (z <= 9.8e+16) {
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 <= (-33000000.0d0)) then
tmp = t_1
else if (z <= (-7.2d-62)) then
tmp = y / (((z * a) - t) / z)
else if (z <= 9d-53) then
tmp = x / (t - (z * a))
else if (z <= 9.8d+16) 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 <= -33000000.0) {
tmp = t_1;
} else if (z <= -7.2e-62) {
tmp = y / (((z * a) - t) / z);
} else if (z <= 9e-53) {
tmp = x / (t - (z * a));
} else if (z <= 9.8e+16) {
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 <= -33000000.0: tmp = t_1 elif z <= -7.2e-62: tmp = y / (((z * a) - t) / z) elif z <= 9e-53: tmp = x / (t - (z * a)) elif z <= 9.8e+16: 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 <= -33000000.0) tmp = t_1; elseif (z <= -7.2e-62) tmp = Float64(y / Float64(Float64(Float64(z * a) - t) / z)); elseif (z <= 9e-53) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 9.8e+16) 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 <= -33000000.0) tmp = t_1; elseif (z <= -7.2e-62) tmp = y / (((z * a) - t) / z); elseif (z <= 9e-53) tmp = x / (t - (z * a)); elseif (z <= 9.8e+16) 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, -33000000.0], t$95$1, If[LessEqual[z, -7.2e-62], N[(y / N[(N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-53], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.8e+16], 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 -33000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-62}:\\
\;\;\;\;\frac{y}{\frac{z \cdot a - t}{z}}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-53}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+16}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.3e7 or 9.8e16 < z Initial program 58.6%
Taylor expanded in t around 0
associate-*r/N/A
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
div-subN/A
sub-negN/A
distribute-lft-inN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
remove-double-negN/A
remove-double-negN/A
neg-mul-1N/A
remove-double-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6482.1%
Simplified82.1%
if -3.3e7 < z < -7.1999999999999999e-62Initial program 99.3%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6499.2%
Applied egg-rr99.2%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6467.7%
Simplified67.7%
sub0-negN/A
clear-numN/A
un-div-invN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-fracN/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f64N/A
*-lowering-*.f6467.9%
Applied egg-rr67.9%
if -7.1999999999999999e-62 < z < 8.9999999999999997e-53Initial program 99.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6482.1%
Simplified82.1%
if 8.9999999999999997e-53 < z < 9.8e16Initial program 99.7%
Taylor expanded in t around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6475.4%
Simplified75.4%
Final simplification80.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -6.8e-62)
t_1
(if (<= z 8e-52)
(/ x (- t (* z a)))
(if (<= z 5.6e+17) (/ (- 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 <= -6.8e-62) {
tmp = t_1;
} else if (z <= 8e-52) {
tmp = x / (t - (z * a));
} else if (z <= 5.6e+17) {
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 <= (-6.8d-62)) then
tmp = t_1
else if (z <= 8d-52) then
tmp = x / (t - (z * a))
else if (z <= 5.6d+17) 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 <= -6.8e-62) {
tmp = t_1;
} else if (z <= 8e-52) {
tmp = x / (t - (z * a));
} else if (z <= 5.6e+17) {
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 <= -6.8e-62: tmp = t_1 elif z <= 8e-52: tmp = x / (t - (z * a)) elif z <= 5.6e+17: 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 <= -6.8e-62) tmp = t_1; elseif (z <= 8e-52) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 5.6e+17) 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 <= -6.8e-62) tmp = t_1; elseif (z <= 8e-52) tmp = x / (t - (z * a)); elseif (z <= 5.6e+17) 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, -6.8e-62], t$95$1, If[LessEqual[z, 8e-52], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+17], 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 -6.8 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-52}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+17}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.79999999999999975e-62 or 5.6e17 < z Initial program 64.2%
Taylor expanded in t around 0
associate-*r/N/A
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
div-subN/A
sub-negN/A
distribute-lft-inN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
remove-double-negN/A
remove-double-negN/A
neg-mul-1N/A
remove-double-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6476.7%
Simplified76.7%
if -6.79999999999999975e-62 < z < 8.0000000000000001e-52Initial program 99.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6482.1%
Simplified82.1%
if 8.0000000000000001e-52 < z < 5.6e17Initial program 99.7%
Taylor expanded in t around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6475.4%
Simplified75.4%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.1e+60) (/ y a) (if (<= z 8.5e+33) (/ x (- t (* z a))) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.1e+60) {
tmp = y / a;
} else if (z <= 8.5e+33) {
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 <= (-5.1d+60)) then
tmp = y / a
else if (z <= 8.5d+33) 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 <= -5.1e+60) {
tmp = y / a;
} else if (z <= 8.5e+33) {
tmp = x / (t - (z * a));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.1e+60: tmp = y / a elif z <= 8.5e+33: tmp = x / (t - (z * a)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.1e+60) tmp = Float64(y / a); elseif (z <= 8.5e+33) 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 <= -5.1e+60) tmp = y / a; elseif (z <= 8.5e+33) tmp = x / (t - (z * a)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.1e+60], N[(y / a), $MachinePrecision], If[LessEqual[z, 8.5e+33], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.1 \cdot 10^{+60}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+33}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -5.09999999999999996e60 or 8.4999999999999998e33 < z Initial program 55.4%
Taylor expanded in z around inf
/-lowering-/.f6465.8%
Simplified65.8%
if -5.09999999999999996e60 < z < 8.4999999999999998e33Initial program 99.2%
Taylor expanded in x around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6472.9%
Simplified72.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -7e-62) (/ y a) (if (<= z 1e+20) (/ 1.0 (/ t x)) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e-62) {
tmp = y / a;
} else if (z <= 1e+20) {
tmp = 1.0 / (t / x);
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7d-62)) then
tmp = y / a
else if (z <= 1d+20) then
tmp = 1.0d0 / (t / x)
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e-62) {
tmp = y / a;
} else if (z <= 1e+20) {
tmp = 1.0 / (t / x);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7e-62: tmp = y / a elif z <= 1e+20: tmp = 1.0 / (t / x) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7e-62) tmp = Float64(y / a); elseif (z <= 1e+20) tmp = Float64(1.0 / Float64(t / x)); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7e-62) tmp = y / a; elseif (z <= 1e+20) tmp = 1.0 / (t / x); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e-62], N[(y / a), $MachinePrecision], If[LessEqual[z, 1e+20], N[(1.0 / N[(t / x), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-62}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 10^{+20}:\\
\;\;\;\;\frac{1}{\frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -7.0000000000000003e-62 or 1e20 < z Initial program 64.2%
Taylor expanded in z around inf
/-lowering-/.f6459.4%
Simplified59.4%
if -7.0000000000000003e-62 < z < 1e20Initial program 99.8%
Taylor expanded in z around 0
/-lowering-/.f6456.2%
Simplified56.2%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f6456.4%
Applied egg-rr56.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.4e-62) (/ y a) (if (<= z 2e+21) (/ x t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.4e-62) {
tmp = y / a;
} else if (z <= 2e+21) {
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 <= (-6.4d-62)) then
tmp = y / a
else if (z <= 2d+21) 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 <= -6.4e-62) {
tmp = y / a;
} else if (z <= 2e+21) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.4e-62: tmp = y / a elif z <= 2e+21: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.4e-62) tmp = Float64(y / a); elseif (z <= 2e+21) 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 <= -6.4e-62) tmp = y / a; elseif (z <= 2e+21) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.4e-62], N[(y / a), $MachinePrecision], If[LessEqual[z, 2e+21], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{-62}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+21}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.40000000000000043e-62 or 2e21 < z Initial program 64.2%
Taylor expanded in z around inf
/-lowering-/.f6459.4%
Simplified59.4%
if -6.40000000000000043e-62 < z < 2e21Initial program 99.8%
Taylor expanded in z around 0
/-lowering-/.f6456.2%
Simplified56.2%
(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 81.7%
Taylor expanded in z around 0
/-lowering-/.f6434.5%
Simplified34.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 2024191
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:alt
(! :herbie-platform default (if (< z -32113435955957344) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 4392440296622287/125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* (- x (* y z)) (/ 1 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))))))
(/ (- x (* y z)) (- t (* a z))))