
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t))
(t_2 (- (/ y (/ t_1 z)) (/ x t_1)))
(t_3 (/ (- x (* y z)) (- t (* z a))))
(t_4 (- (* y z) x)))
(if (<= t_3 -5e-211)
t_2
(if (<= t_3 4e-96)
(/ 1.0 (- (/ z (/ t_4 a)) (/ t t_4)))
(if (<= t_3 INFINITY) t_2 (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (y / (t_1 / z)) - (x / t_1);
double t_3 = (x - (y * z)) / (t - (z * a));
double t_4 = (y * z) - x;
double tmp;
if (t_3 <= -5e-211) {
tmp = t_2;
} else if (t_3 <= 4e-96) {
tmp = 1.0 / ((z / (t_4 / a)) - (t / t_4));
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double t_2 = (y / (t_1 / z)) - (x / t_1);
double t_3 = (x - (y * z)) / (t - (z * a));
double t_4 = (y * z) - x;
double tmp;
if (t_3 <= -5e-211) {
tmp = t_2;
} else if (t_3 <= 4e-96) {
tmp = 1.0 / ((z / (t_4 / a)) - (t / t_4));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t t_2 = (y / (t_1 / z)) - (x / t_1) t_3 = (x - (y * z)) / (t - (z * a)) t_4 = (y * z) - x tmp = 0 if t_3 <= -5e-211: tmp = t_2 elif t_3 <= 4e-96: tmp = 1.0 / ((z / (t_4 / a)) - (t / t_4)) elif t_3 <= math.inf: tmp = t_2 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) t_2 = Float64(Float64(y / Float64(t_1 / z)) - Float64(x / t_1)) t_3 = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))) t_4 = Float64(Float64(y * z) - x) tmp = 0.0 if (t_3 <= -5e-211) tmp = t_2; elseif (t_3 <= 4e-96) tmp = Float64(1.0 / Float64(Float64(z / Float64(t_4 / a)) - Float64(t / t_4))); elseif (t_3 <= Inf) tmp = t_2; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; t_2 = (y / (t_1 / z)) - (x / t_1); t_3 = (x - (y * z)) / (t - (z * a)); t_4 = (y * z) - x; tmp = 0.0; if (t_3 <= -5e-211) tmp = t_2; elseif (t_3 <= 4e-96) tmp = 1.0 / ((z / (t_4 / a)) - (t / t_4)); elseif (t_3 <= Inf) tmp = t_2; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-211], t$95$2, If[LessEqual[t$95$3, 4e-96], N[(1.0 / N[(N[(z / N[(t$95$4 / a), $MachinePrecision]), $MachinePrecision] - N[(t / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$2, N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
t_2 := \frac{y}{\frac{t_1}{z}} - \frac{x}{t_1}\\
t_3 := \frac{x - y \cdot z}{t - z \cdot a}\\
t_4 := y \cdot z - x\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{-211}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 4 \cdot 10^{-96}:\\
\;\;\;\;\frac{1}{\frac{z}{\frac{t_4}{a}} - \frac{t}{t_4}}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < -5.0000000000000002e-211 or 3.9999999999999996e-96 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < +inf.0Initial program 90.4%
sub-neg90.4%
+-commutative90.4%
neg-sub090.4%
associate-+l-90.4%
sub0-neg90.4%
neg-mul-190.4%
sub-neg90.4%
+-commutative90.4%
neg-sub090.4%
associate-+l-90.4%
sub0-neg90.4%
neg-mul-190.4%
times-frac90.4%
metadata-eval90.4%
*-lft-identity90.4%
*-commutative90.4%
Simplified90.4%
div-sub90.4%
associate-/l*99.3%
Applied egg-rr99.3%
if -5.0000000000000002e-211 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) < 3.9999999999999996e-96Initial program 85.2%
sub-neg85.2%
+-commutative85.2%
neg-sub085.2%
associate-+l-85.2%
sub0-neg85.2%
neg-mul-185.2%
sub-neg85.2%
+-commutative85.2%
neg-sub085.2%
associate-+l-85.2%
sub0-neg85.2%
neg-mul-185.2%
times-frac85.2%
metadata-eval85.2%
*-lft-identity85.2%
*-commutative85.2%
Simplified85.2%
add-cube-cbrt83.9%
pow383.8%
Applied egg-rr83.8%
rem-cube-cbrt85.2%
clear-num84.7%
*-commutative84.7%
Applied egg-rr84.7%
div-sub84.7%
associate-/l*93.0%
Applied egg-rr93.0%
if +inf.0 < (/.f64 (-.f64 x (*.f64 y z)) (-.f64 t (*.f64 a z))) Initial program 0.0%
sub-neg0.0%
+-commutative0.0%
neg-sub00.0%
associate-+l-0.0%
sub0-neg0.0%
neg-mul-10.0%
sub-neg0.0%
+-commutative0.0%
neg-sub00.0%
associate-+l-0.0%
sub0-neg0.0%
neg-mul-10.0%
times-frac0.0%
metadata-eval0.0%
*-lft-identity0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification97.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)))
(if (<= z -3.7e+60)
(/ y (- a (/ t z)))
(if (<= z 3.8e+66)
(/ (- x (* y z)) (- t (* z a)))
(- (* z (/ y t_1)) (/ x t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double tmp;
if (z <= -3.7e+60) {
tmp = y / (a - (t / z));
} else if (z <= 3.8e+66) {
tmp = (x - (y * z)) / (t - (z * a));
} else {
tmp = (z * (y / t_1)) - (x / 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 = (z * a) - t
if (z <= (-3.7d+60)) then
tmp = y / (a - (t / z))
else if (z <= 3.8d+66) then
tmp = (x - (y * z)) / (t - (z * a))
else
tmp = (z * (y / t_1)) - (x / 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 = (z * a) - t;
double tmp;
if (z <= -3.7e+60) {
tmp = y / (a - (t / z));
} else if (z <= 3.8e+66) {
tmp = (x - (y * z)) / (t - (z * a));
} else {
tmp = (z * (y / t_1)) - (x / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t tmp = 0 if z <= -3.7e+60: tmp = y / (a - (t / z)) elif z <= 3.8e+66: tmp = (x - (y * z)) / (t - (z * a)) else: tmp = (z * (y / t_1)) - (x / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) tmp = 0.0 if (z <= -3.7e+60) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (z <= 3.8e+66) tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))); else tmp = Float64(Float64(z * Float64(y / t_1)) - Float64(x / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; tmp = 0.0; if (z <= -3.7e+60) tmp = y / (a - (t / z)); elseif (z <= 3.8e+66) tmp = (x - (y * z)) / (t - (z * a)); else tmp = (z * (y / t_1)) - (x / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[z, -3.7e+60], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+66], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+60}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+66}:\\
\;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{t_1} - \frac{x}{t_1}\\
\end{array}
\end{array}
if z < -3.69999999999999988e60Initial program 62.9%
sub-neg62.9%
+-commutative62.9%
neg-sub062.9%
associate-+l-62.9%
sub0-neg62.9%
neg-mul-162.9%
sub-neg62.9%
+-commutative62.9%
neg-sub062.9%
associate-+l-62.9%
sub0-neg62.9%
neg-mul-162.9%
times-frac62.9%
metadata-eval62.9%
*-lft-identity62.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in y around inf 50.8%
*-commutative50.8%
associate-*r/67.5%
*-commutative67.5%
Simplified67.5%
clear-num67.5%
*-commutative67.5%
div-inv67.8%
Applied egg-rr67.8%
Taylor expanded in z around 0 87.8%
+-commutative87.8%
associate-*r/87.8%
neg-mul-187.8%
Simplified87.8%
if -3.69999999999999988e60 < z < 3.8000000000000002e66Initial program 99.8%
if 3.8000000000000002e66 < z Initial program 66.2%
sub-neg66.2%
+-commutative66.2%
neg-sub066.2%
associate-+l-66.2%
sub0-neg66.2%
neg-mul-166.2%
sub-neg66.2%
+-commutative66.2%
neg-sub066.2%
associate-+l-66.2%
sub0-neg66.2%
neg-mul-166.2%
times-frac66.2%
metadata-eval66.2%
*-lft-identity66.2%
*-commutative66.2%
Simplified66.2%
div-sub66.2%
associate-/l*87.3%
Applied egg-rr87.3%
associate-/r/87.2%
Applied egg-rr87.2%
Final simplification95.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* z a) t)))
(if (<= z -3.3e+60)
(/ y (- a (/ t z)))
(if (<= z 2e+63)
(/ (- x (* y z)) (- t (* z a)))
(- (/ y (/ t_1 z)) (/ x t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * a) - t;
double tmp;
if (z <= -3.3e+60) {
tmp = y / (a - (t / z));
} else if (z <= 2e+63) {
tmp = (x - (y * z)) / (t - (z * a));
} else {
tmp = (y / (t_1 / z)) - (x / 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 = (z * a) - t
if (z <= (-3.3d+60)) then
tmp = y / (a - (t / z))
else if (z <= 2d+63) then
tmp = (x - (y * z)) / (t - (z * a))
else
tmp = (y / (t_1 / z)) - (x / 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 = (z * a) - t;
double tmp;
if (z <= -3.3e+60) {
tmp = y / (a - (t / z));
} else if (z <= 2e+63) {
tmp = (x - (y * z)) / (t - (z * a));
} else {
tmp = (y / (t_1 / z)) - (x / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z * a) - t tmp = 0 if z <= -3.3e+60: tmp = y / (a - (t / z)) elif z <= 2e+63: tmp = (x - (y * z)) / (t - (z * a)) else: tmp = (y / (t_1 / z)) - (x / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z * a) - t) tmp = 0.0 if (z <= -3.3e+60) tmp = Float64(y / Float64(a - Float64(t / z))); elseif (z <= 2e+63) tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))); else tmp = Float64(Float64(y / Float64(t_1 / z)) - Float64(x / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z * a) - t; tmp = 0.0; if (z <= -3.3e+60) tmp = y / (a - (t / z)); elseif (z <= 2e+63) tmp = (x - (y * z)) / (t - (z * a)); else tmp = (y / (t_1 / z)) - (x / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[z, -3.3e+60], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+63], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot a - t\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{+60}:\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+63}:\\
\;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{t_1}{z}} - \frac{x}{t_1}\\
\end{array}
\end{array}
if z < -3.2999999999999998e60Initial program 62.9%
sub-neg62.9%
+-commutative62.9%
neg-sub062.9%
associate-+l-62.9%
sub0-neg62.9%
neg-mul-162.9%
sub-neg62.9%
+-commutative62.9%
neg-sub062.9%
associate-+l-62.9%
sub0-neg62.9%
neg-mul-162.9%
times-frac62.9%
metadata-eval62.9%
*-lft-identity62.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in y around inf 50.8%
*-commutative50.8%
associate-*r/67.5%
*-commutative67.5%
Simplified67.5%
clear-num67.5%
*-commutative67.5%
div-inv67.8%
Applied egg-rr67.8%
Taylor expanded in z around 0 87.8%
+-commutative87.8%
associate-*r/87.8%
neg-mul-187.8%
Simplified87.8%
if -3.2999999999999998e60 < z < 2.00000000000000012e63Initial program 99.8%
if 2.00000000000000012e63 < z Initial program 66.2%
sub-neg66.2%
+-commutative66.2%
neg-sub066.2%
associate-+l-66.2%
sub0-neg66.2%
neg-mul-166.2%
sub-neg66.2%
+-commutative66.2%
neg-sub066.2%
associate-+l-66.2%
sub0-neg66.2%
neg-mul-166.2%
times-frac66.2%
metadata-eval66.2%
*-lft-identity66.2%
*-commutative66.2%
Simplified66.2%
div-sub66.2%
associate-/l*87.3%
Applied egg-rr87.3%
Final simplification95.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.7e+60) (not (<= z 6.5e+194))) (/ y (- a (/ t z))) (/ (- x (* y z)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e+60) || !(z <= 6.5e+194)) {
tmp = y / (a - (t / z));
} else {
tmp = (x - (y * z)) / (t - (z * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.7d+60)) .or. (.not. (z <= 6.5d+194))) then
tmp = y / (a - (t / z))
else
tmp = (x - (y * z)) / (t - (z * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e+60) || !(z <= 6.5e+194)) {
tmp = y / (a - (t / z));
} else {
tmp = (x - (y * z)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.7e+60) or not (z <= 6.5e+194): tmp = y / (a - (t / z)) else: tmp = (x - (y * z)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.7e+60) || !(z <= 6.5e+194)) tmp = Float64(y / Float64(a - Float64(t / z))); else tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.7e+60) || ~((z <= 6.5e+194))) tmp = y / (a - (t / z)); else tmp = (x - (y * z)) / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.7e+60], N[Not[LessEqual[z, 6.5e+194]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+60} \lor \neg \left(z \leq 6.5 \cdot 10^{+194}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -3.69999999999999988e60 or 6.50000000000000005e194 < z Initial program 62.9%
sub-neg62.9%
+-commutative62.9%
neg-sub062.9%
associate-+l-62.9%
sub0-neg62.9%
neg-mul-162.9%
sub-neg62.9%
+-commutative62.9%
neg-sub062.9%
associate-+l-62.9%
sub0-neg62.9%
neg-mul-162.9%
times-frac62.9%
metadata-eval62.9%
*-lft-identity62.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in y around inf 51.9%
*-commutative51.9%
associate-*r/69.8%
*-commutative69.8%
Simplified69.8%
clear-num69.7%
*-commutative69.7%
div-inv70.1%
Applied egg-rr70.1%
Taylor expanded in z around 0 87.7%
+-commutative87.7%
associate-*r/87.7%
neg-mul-187.7%
Simplified87.7%
if -3.69999999999999988e60 < z < 6.50000000000000005e194Initial program 96.1%
Final simplification93.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a (/ t z)))))
(if (<= z -3.4e-19)
t_1
(if (<= z 1.2e-289)
(/ (- (* y z) x) (- t))
(if (<= z 9.6e-49) (/ (- x) (- (* z a) t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - (t / z));
double tmp;
if (z <= -3.4e-19) {
tmp = t_1;
} else if (z <= 1.2e-289) {
tmp = ((y * z) - x) / -t;
} else if (z <= 9.6e-49) {
tmp = -x / ((z * a) - 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 / (a - (t / z))
if (z <= (-3.4d-19)) then
tmp = t_1
else if (z <= 1.2d-289) then
tmp = ((y * z) - x) / -t
else if (z <= 9.6d-49) then
tmp = -x / ((z * a) - 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 / (a - (t / z));
double tmp;
if (z <= -3.4e-19) {
tmp = t_1;
} else if (z <= 1.2e-289) {
tmp = ((y * z) - x) / -t;
} else if (z <= 9.6e-49) {
tmp = -x / ((z * a) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - (t / z)) tmp = 0 if z <= -3.4e-19: tmp = t_1 elif z <= 1.2e-289: tmp = ((y * z) - x) / -t elif z <= 9.6e-49: tmp = -x / ((z * a) - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - Float64(t / z))) tmp = 0.0 if (z <= -3.4e-19) tmp = t_1; elseif (z <= 1.2e-289) tmp = Float64(Float64(Float64(y * z) - x) / Float64(-t)); elseif (z <= 9.6e-49) tmp = Float64(Float64(-x) / Float64(Float64(z * a) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - (t / z)); tmp = 0.0; if (z <= -3.4e-19) tmp = t_1; elseif (z <= 1.2e-289) tmp = ((y * z) - x) / -t; elseif (z <= 9.6e-49) tmp = -x / ((z * a) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e-19], t$95$1, If[LessEqual[z, 1.2e-289], N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[z, 9.6e-49], N[((-x) / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{-19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-289}:\\
\;\;\;\;\frac{y \cdot z - x}{-t}\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-49}:\\
\;\;\;\;\frac{-x}{z \cdot a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.4000000000000002e-19 or 9.59999999999999969e-49 < z Initial program 73.2%
sub-neg73.2%
+-commutative73.2%
neg-sub073.2%
associate-+l-73.2%
sub0-neg73.2%
neg-mul-173.2%
sub-neg73.2%
+-commutative73.2%
neg-sub073.2%
associate-+l-73.2%
sub0-neg73.2%
neg-mul-173.2%
times-frac73.2%
metadata-eval73.2%
*-lft-identity73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y around inf 52.3%
*-commutative52.3%
associate-*r/66.2%
*-commutative66.2%
Simplified66.2%
clear-num66.1%
*-commutative66.1%
div-inv66.4%
Applied egg-rr66.4%
Taylor expanded in z around 0 76.7%
+-commutative76.7%
associate-*r/76.7%
neg-mul-176.7%
Simplified76.7%
if -3.4000000000000002e-19 < z < 1.19999999999999997e-289Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 85.3%
neg-mul-185.3%
Simplified85.3%
if 1.19999999999999997e-289 < z < 9.59999999999999969e-49Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 84.0%
associate-*r/84.0%
neg-mul-184.0%
Simplified84.0%
Final simplification80.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a (/ t z)))))
(if (<= z -1.32e-20)
t_1
(if (<= z 2e-289)
(- (/ x t) (/ (* y z) t))
(if (<= z 9.2e-49) (/ (- x) (- (* z a) t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - (t / z));
double tmp;
if (z <= -1.32e-20) {
tmp = t_1;
} else if (z <= 2e-289) {
tmp = (x / t) - ((y * z) / t);
} else if (z <= 9.2e-49) {
tmp = -x / ((z * a) - 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 / (a - (t / z))
if (z <= (-1.32d-20)) then
tmp = t_1
else if (z <= 2d-289) then
tmp = (x / t) - ((y * z) / t)
else if (z <= 9.2d-49) then
tmp = -x / ((z * a) - 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 / (a - (t / z));
double tmp;
if (z <= -1.32e-20) {
tmp = t_1;
} else if (z <= 2e-289) {
tmp = (x / t) - ((y * z) / t);
} else if (z <= 9.2e-49) {
tmp = -x / ((z * a) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - (t / z)) tmp = 0 if z <= -1.32e-20: tmp = t_1 elif z <= 2e-289: tmp = (x / t) - ((y * z) / t) elif z <= 9.2e-49: tmp = -x / ((z * a) - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - Float64(t / z))) tmp = 0.0 if (z <= -1.32e-20) tmp = t_1; elseif (z <= 2e-289) tmp = Float64(Float64(x / t) - Float64(Float64(y * z) / t)); elseif (z <= 9.2e-49) tmp = Float64(Float64(-x) / Float64(Float64(z * a) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - (t / z)); tmp = 0.0; if (z <= -1.32e-20) tmp = t_1; elseif (z <= 2e-289) tmp = (x / t) - ((y * z) / t); elseif (z <= 9.2e-49) tmp = -x / ((z * a) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.32e-20], t$95$1, If[LessEqual[z, 2e-289], N[(N[(x / t), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e-49], N[((-x) / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -1.32 \cdot 10^{-20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-289}:\\
\;\;\;\;\frac{x}{t} - \frac{y \cdot z}{t}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-49}:\\
\;\;\;\;\frac{-x}{z \cdot a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.32000000000000004e-20 or 9.1999999999999996e-49 < z Initial program 73.2%
sub-neg73.2%
+-commutative73.2%
neg-sub073.2%
associate-+l-73.2%
sub0-neg73.2%
neg-mul-173.2%
sub-neg73.2%
+-commutative73.2%
neg-sub073.2%
associate-+l-73.2%
sub0-neg73.2%
neg-mul-173.2%
times-frac73.2%
metadata-eval73.2%
*-lft-identity73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y around inf 52.3%
*-commutative52.3%
associate-*r/66.2%
*-commutative66.2%
Simplified66.2%
clear-num66.1%
*-commutative66.1%
div-inv66.4%
Applied egg-rr66.4%
Taylor expanded in z around 0 76.7%
+-commutative76.7%
associate-*r/76.7%
neg-mul-176.7%
Simplified76.7%
if -1.32000000000000004e-20 < z < 2e-289Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 85.3%
neg-mul-185.3%
Simplified85.3%
Taylor expanded in y around 0 85.3%
if 2e-289 < z < 9.1999999999999996e-49Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 84.0%
associate-*r/84.0%
neg-mul-184.0%
Simplified84.0%
Final simplification80.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.9e-103) (not (<= z 1.45e-48))) (/ y (- a (/ t z))) (/ (- x) (- (* z a) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.9e-103) || !(z <= 1.45e-48)) {
tmp = y / (a - (t / z));
} else {
tmp = -x / ((z * a) - 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 <= (-2.9d-103)) .or. (.not. (z <= 1.45d-48))) then
tmp = y / (a - (t / z))
else
tmp = -x / ((z * a) - 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 <= -2.9e-103) || !(z <= 1.45e-48)) {
tmp = y / (a - (t / z));
} else {
tmp = -x / ((z * a) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.9e-103) or not (z <= 1.45e-48): tmp = y / (a - (t / z)) else: tmp = -x / ((z * a) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.9e-103) || !(z <= 1.45e-48)) tmp = Float64(y / Float64(a - Float64(t / z))); else tmp = Float64(Float64(-x) / Float64(Float64(z * a) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.9e-103) || ~((z <= 1.45e-48))) tmp = y / (a - (t / z)); else tmp = -x / ((z * a) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.9e-103], N[Not[LessEqual[z, 1.45e-48]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x) / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-103} \lor \neg \left(z \leq 1.45 \cdot 10^{-48}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{z \cdot a - t}\\
\end{array}
\end{array}
if z < -2.8999999999999999e-103 or 1.4500000000000001e-48 < z Initial program 76.3%
sub-neg76.3%
+-commutative76.3%
neg-sub076.3%
associate-+l-76.3%
sub0-neg76.3%
neg-mul-176.3%
sub-neg76.3%
+-commutative76.3%
neg-sub076.3%
associate-+l-76.3%
sub0-neg76.3%
neg-mul-176.3%
times-frac76.3%
metadata-eval76.3%
*-lft-identity76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in y around inf 53.2%
*-commutative53.2%
associate-*r/65.5%
*-commutative65.5%
Simplified65.5%
clear-num65.4%
*-commutative65.4%
div-inv65.7%
Applied egg-rr65.7%
Taylor expanded in z around 0 74.8%
+-commutative74.8%
associate-*r/74.8%
neg-mul-174.8%
Simplified74.8%
if -2.8999999999999999e-103 < z < 1.4500000000000001e-48Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 78.9%
associate-*r/78.9%
neg-mul-178.9%
Simplified78.9%
Final simplification76.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.2e-76) (not (<= z 4.8e-77))) (/ (- y (/ x z)) a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.2e-76) || !(z <= 4.8e-77)) {
tmp = (y - (x / z)) / 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 <= (-9.2d-76)) .or. (.not. (z <= 4.8d-77))) then
tmp = (y - (x / z)) / 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 <= -9.2e-76) || !(z <= 4.8e-77)) {
tmp = (y - (x / z)) / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.2e-76) or not (z <= 4.8e-77): tmp = (y - (x / z)) / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.2e-76) || !(z <= 4.8e-77)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(x / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9.2e-76) || ~((z <= 4.8e-77))) tmp = (y - (x / z)) / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.2e-76], N[Not[LessEqual[z, 4.8e-77]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{-76} \lor \neg \left(z \leq 4.8 \cdot 10^{-77}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -9.20000000000000025e-76 or 4.7999999999999998e-77 < z Initial program 76.8%
sub-neg76.8%
+-commutative76.8%
neg-sub076.8%
associate-+l-76.8%
sub0-neg76.8%
neg-mul-176.8%
sub-neg76.8%
+-commutative76.8%
neg-sub076.8%
associate-+l-76.8%
sub0-neg76.8%
neg-mul-176.8%
times-frac76.8%
metadata-eval76.8%
*-lft-identity76.8%
*-commutative76.8%
Simplified76.8%
Taylor expanded in z around inf 54.5%
mul-1-neg54.5%
+-commutative54.5%
associate--l+54.5%
associate-/r*53.9%
distribute-neg-frac53.9%
mul-1-neg53.9%
associate-/r*53.1%
associate-*r/53.1%
div-sub53.1%
distribute-lft-out--53.1%
associate-*r/53.1%
Simplified58.1%
Taylor expanded in a around inf 66.8%
if -9.20000000000000025e-76 < z < 4.7999999999999998e-77Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 62.3%
Final simplification64.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8e-105) (not (<= z 1.32e-73))) (/ y (- a (/ t z))) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8e-105) || !(z <= 1.32e-73)) {
tmp = y / (a - (t / z));
} 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 <= (-8d-105)) .or. (.not. (z <= 1.32d-73))) then
tmp = y / (a - (t / z))
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 <= -8e-105) || !(z <= 1.32e-73)) {
tmp = y / (a - (t / z));
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8e-105) or not (z <= 1.32e-73): tmp = y / (a - (t / z)) else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8e-105) || !(z <= 1.32e-73)) tmp = Float64(y / Float64(a - Float64(t / z))); else tmp = Float64(x / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8e-105) || ~((z <= 1.32e-73))) tmp = y / (a - (t / z)); else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8e-105], N[Not[LessEqual[z, 1.32e-73]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-105} \lor \neg \left(z \leq 1.32 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -7.99999999999999972e-105 or 1.31999999999999998e-73 < z Initial program 77.5%
sub-neg77.5%
+-commutative77.5%
neg-sub077.5%
associate-+l-77.5%
sub0-neg77.5%
neg-mul-177.5%
sub-neg77.5%
+-commutative77.5%
neg-sub077.5%
associate-+l-77.5%
sub0-neg77.5%
neg-mul-177.5%
times-frac77.5%
metadata-eval77.5%
*-lft-identity77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in y around inf 52.5%
*-commutative52.5%
associate-*r/64.2%
*-commutative64.2%
Simplified64.2%
clear-num64.1%
*-commutative64.1%
div-inv64.4%
Applied egg-rr64.4%
Taylor expanded in z around 0 72.9%
+-commutative72.9%
associate-*r/72.9%
neg-mul-172.9%
Simplified72.9%
if -7.99999999999999972e-105 < z < 1.31999999999999998e-73Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 63.3%
Final simplification69.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.9e-74) (/ y a) (if (<= z 1.5e-73) (/ x t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e-74) {
tmp = y / a;
} else if (z <= 1.5e-73) {
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 <= (-2.9d-74)) then
tmp = y / a
else if (z <= 1.5d-73) 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 <= -2.9e-74) {
tmp = y / a;
} else if (z <= 1.5e-73) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.9e-74: tmp = y / a elif z <= 1.5e-73: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.9e-74) tmp = Float64(y / a); elseif (z <= 1.5e-73) 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 <= -2.9e-74) tmp = y / a; elseif (z <= 1.5e-73) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.9e-74], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.5e-73], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-74}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-73}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.9e-74 or 1.5e-73 < z Initial program 76.6%
sub-neg76.6%
+-commutative76.6%
neg-sub076.6%
associate-+l-76.6%
sub0-neg76.6%
neg-mul-176.6%
sub-neg76.6%
+-commutative76.6%
neg-sub076.6%
associate-+l-76.6%
sub0-neg76.6%
neg-mul-176.6%
times-frac76.6%
metadata-eval76.6%
*-lft-identity76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in z around inf 52.7%
if -2.9e-74 < z < 1.5e-73Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
*-lft-identity99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 61.8%
Final simplification56.5%
(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.4%
sub-neg86.4%
+-commutative86.4%
neg-sub086.4%
associate-+l-86.4%
sub0-neg86.4%
neg-mul-186.4%
sub-neg86.4%
+-commutative86.4%
neg-sub086.4%
associate-+l-86.4%
sub0-neg86.4%
neg-mul-186.4%
times-frac86.4%
metadata-eval86.4%
*-lft-identity86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in z around 0 35.7%
Final simplification35.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 2023196
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))
(/ (- x (* y z)) (- t (* a z))))