
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\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 z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ (- z y) (+ (- t z) 1.0)) a x))
double code(double x, double y, double z, double t, double a) {
return fma(((z - y) / ((t - z) + 1.0)), a, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(z - y) / Float64(Float64(t - z) + 1.0)), a, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(z - y), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right)
\end{array}
Initial program 96.9%
sub-neg96.9%
+-commutative96.9%
associate-/r/99.9%
distribute-lft-neg-in99.9%
fma-define99.9%
distribute-neg-frac299.9%
distribute-neg-in99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ (* y a) t))))
(if (<= z -9500000000000.0)
(- x a)
(if (<= z -9e-110)
(+ x (/ z (/ t a)))
(if (<= z -1.3e-245)
t_1
(if (<= z 8e-262)
(/ (* y a) (- -1.0 t))
(if (<= z 7e-10)
t_1
(if (<= z 2.3e+51) (+ x (/ (* y a) z)) (- x a)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((y * a) / t);
double tmp;
if (z <= -9500000000000.0) {
tmp = x - a;
} else if (z <= -9e-110) {
tmp = x + (z / (t / a));
} else if (z <= -1.3e-245) {
tmp = t_1;
} else if (z <= 8e-262) {
tmp = (y * a) / (-1.0 - t);
} else if (z <= 7e-10) {
tmp = t_1;
} else if (z <= 2.3e+51) {
tmp = x + ((y * a) / z);
} else {
tmp = x - a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - ((y * a) / t)
if (z <= (-9500000000000.0d0)) then
tmp = x - a
else if (z <= (-9d-110)) then
tmp = x + (z / (t / a))
else if (z <= (-1.3d-245)) then
tmp = t_1
else if (z <= 8d-262) then
tmp = (y * a) / ((-1.0d0) - t)
else if (z <= 7d-10) then
tmp = t_1
else if (z <= 2.3d+51) then
tmp = x + ((y * a) / z)
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((y * a) / t);
double tmp;
if (z <= -9500000000000.0) {
tmp = x - a;
} else if (z <= -9e-110) {
tmp = x + (z / (t / a));
} else if (z <= -1.3e-245) {
tmp = t_1;
} else if (z <= 8e-262) {
tmp = (y * a) / (-1.0 - t);
} else if (z <= 7e-10) {
tmp = t_1;
} else if (z <= 2.3e+51) {
tmp = x + ((y * a) / z);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((y * a) / t) tmp = 0 if z <= -9500000000000.0: tmp = x - a elif z <= -9e-110: tmp = x + (z / (t / a)) elif z <= -1.3e-245: tmp = t_1 elif z <= 8e-262: tmp = (y * a) / (-1.0 - t) elif z <= 7e-10: tmp = t_1 elif z <= 2.3e+51: tmp = x + ((y * a) / z) else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(y * a) / t)) tmp = 0.0 if (z <= -9500000000000.0) tmp = Float64(x - a); elseif (z <= -9e-110) tmp = Float64(x + Float64(z / Float64(t / a))); elseif (z <= -1.3e-245) tmp = t_1; elseif (z <= 8e-262) tmp = Float64(Float64(y * a) / Float64(-1.0 - t)); elseif (z <= 7e-10) tmp = t_1; elseif (z <= 2.3e+51) tmp = Float64(x + Float64(Float64(y * a) / z)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((y * a) / t); tmp = 0.0; if (z <= -9500000000000.0) tmp = x - a; elseif (z <= -9e-110) tmp = x + (z / (t / a)); elseif (z <= -1.3e-245) tmp = t_1; elseif (z <= 8e-262) tmp = (y * a) / (-1.0 - t); elseif (z <= 7e-10) tmp = t_1; elseif (z <= 2.3e+51) tmp = x + ((y * a) / z); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9500000000000.0], N[(x - a), $MachinePrecision], If[LessEqual[z, -9e-110], N[(x + N[(z / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.3e-245], t$95$1, If[LessEqual[z, 8e-262], N[(N[(y * a), $MachinePrecision] / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-10], t$95$1, If[LessEqual[z, 2.3e+51], N[(x + N[(N[(y * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{y \cdot a}{t}\\
\mathbf{if}\;z \leq -9500000000000:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-110}:\\
\;\;\;\;x + \frac{z}{\frac{t}{a}}\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-245}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-262}:\\
\;\;\;\;\frac{y \cdot a}{-1 - t}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+51}:\\
\;\;\;\;x + \frac{y \cdot a}{z}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -9.5e12 or 2.30000000000000005e51 < z Initial program 94.1%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 84.8%
if -9.5e12 < z < -9.0000000000000002e-110Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 71.8%
Taylor expanded in y around 0 72.7%
cancel-sign-sub-inv72.7%
metadata-eval72.7%
*-lft-identity72.7%
+-commutative72.7%
associate-/l*72.7%
Simplified72.7%
associate-*r/72.7%
add-cube-cbrt72.5%
times-frac72.5%
add-sqr-sqrt0.0%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod56.7%
add-sqr-sqrt56.7%
times-frac56.7%
*-commutative56.7%
add-cube-cbrt56.7%
associate-/l*56.7%
add-sqr-sqrt56.7%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod0.0%
add-sqr-sqrt76.5%
clear-num76.6%
div-inv76.6%
Applied egg-rr76.6%
if -9.0000000000000002e-110 < z < -1.30000000000000003e-245 or 8.0000000000000001e-262 < z < 6.99999999999999961e-10Initial program 98.7%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 67.4%
Taylor expanded in z around 0 64.1%
if -1.30000000000000003e-245 < z < 8.0000000000000001e-262Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
associate-/r/100.0%
distribute-lft-neg-in100.0%
fma-define100.0%
distribute-neg-frac2100.0%
distribute-neg-in100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 59.6%
Taylor expanded in z around 0 59.6%
associate-*r/59.6%
neg-mul-159.6%
distribute-rgt-neg-in59.6%
Simplified59.6%
if 6.99999999999999961e-10 < z < 2.30000000000000005e51Initial program 100.0%
Taylor expanded in z around inf 82.1%
associate-*r/82.1%
neg-mul-182.1%
Simplified82.1%
Taylor expanded in y around inf 82.9%
associate-*r/82.9%
neg-mul-182.9%
distribute-rgt-neg-in82.9%
Simplified82.9%
Final simplification75.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* a (- 1.0 (/ y z))))) (t_2 (- x (/ (* y a) t))))
(if (<= z -78000000000.0)
t_1
(if (<= z -8e-110)
(+ x (/ z (/ t a)))
(if (<= z -1.2e-245)
t_2
(if (<= z 4.6e-262)
(/ (* y a) (- -1.0 t))
(if (<= z 1.05e-10) t_2 t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * (1.0 - (y / z)));
double t_2 = x - ((y * a) / t);
double tmp;
if (z <= -78000000000.0) {
tmp = t_1;
} else if (z <= -8e-110) {
tmp = x + (z / (t / a));
} else if (z <= -1.2e-245) {
tmp = t_2;
} else if (z <= 4.6e-262) {
tmp = (y * a) / (-1.0 - t);
} else if (z <= 1.05e-10) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = x - (a * (1.0d0 - (y / z)))
t_2 = x - ((y * a) / t)
if (z <= (-78000000000.0d0)) then
tmp = t_1
else if (z <= (-8d-110)) then
tmp = x + (z / (t / a))
else if (z <= (-1.2d-245)) then
tmp = t_2
else if (z <= 4.6d-262) then
tmp = (y * a) / ((-1.0d0) - t)
else if (z <= 1.05d-10) then
tmp = t_2
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 = x - (a * (1.0 - (y / z)));
double t_2 = x - ((y * a) / t);
double tmp;
if (z <= -78000000000.0) {
tmp = t_1;
} else if (z <= -8e-110) {
tmp = x + (z / (t / a));
} else if (z <= -1.2e-245) {
tmp = t_2;
} else if (z <= 4.6e-262) {
tmp = (y * a) / (-1.0 - t);
} else if (z <= 1.05e-10) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (1.0 - (y / z))) t_2 = x - ((y * a) / t) tmp = 0 if z <= -78000000000.0: tmp = t_1 elif z <= -8e-110: tmp = x + (z / (t / a)) elif z <= -1.2e-245: tmp = t_2 elif z <= 4.6e-262: tmp = (y * a) / (-1.0 - t) elif z <= 1.05e-10: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a * Float64(1.0 - Float64(y / z)))) t_2 = Float64(x - Float64(Float64(y * a) / t)) tmp = 0.0 if (z <= -78000000000.0) tmp = t_1; elseif (z <= -8e-110) tmp = Float64(x + Float64(z / Float64(t / a))); elseif (z <= -1.2e-245) tmp = t_2; elseif (z <= 4.6e-262) tmp = Float64(Float64(y * a) / Float64(-1.0 - t)); elseif (z <= 1.05e-10) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a * (1.0 - (y / z))); t_2 = x - ((y * a) / t); tmp = 0.0; if (z <= -78000000000.0) tmp = t_1; elseif (z <= -8e-110) tmp = x + (z / (t / a)); elseif (z <= -1.2e-245) tmp = t_2; elseif (z <= 4.6e-262) tmp = (y * a) / (-1.0 - t); elseif (z <= 1.05e-10) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(a * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -78000000000.0], t$95$1, If[LessEqual[z, -8e-110], N[(x + N[(z / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.2e-245], t$95$2, If[LessEqual[z, 4.6e-262], N[(N[(y * a), $MachinePrecision] / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-10], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \left(1 - \frac{y}{z}\right)\\
t_2 := x - \frac{y \cdot a}{t}\\
\mathbf{if}\;z \leq -78000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-110}:\\
\;\;\;\;x + \frac{z}{\frac{t}{a}}\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-245}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-262}:\\
\;\;\;\;\frac{y \cdot a}{-1 - t}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-10}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.8e10 or 1.05e-10 < z Initial program 94.8%
Taylor expanded in z around inf 85.6%
associate-*r/85.6%
neg-mul-185.6%
Simplified85.6%
Taylor expanded in y around 0 78.8%
*-rgt-identity78.8%
mul-1-neg78.8%
associate-/l*90.1%
distribute-rgt-neg-in90.1%
distribute-lft-in90.1%
sub-neg90.1%
Simplified90.1%
if -7.8e10 < z < -8.0000000000000004e-110Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 71.8%
Taylor expanded in y around 0 72.7%
cancel-sign-sub-inv72.7%
metadata-eval72.7%
*-lft-identity72.7%
+-commutative72.7%
associate-/l*72.7%
Simplified72.7%
associate-*r/72.7%
add-cube-cbrt72.5%
times-frac72.5%
add-sqr-sqrt0.0%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod56.7%
add-sqr-sqrt56.7%
times-frac56.7%
*-commutative56.7%
add-cube-cbrt56.7%
associate-/l*56.7%
add-sqr-sqrt56.7%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod0.0%
add-sqr-sqrt76.5%
clear-num76.6%
div-inv76.6%
Applied egg-rr76.6%
if -8.0000000000000004e-110 < z < -1.2e-245 or 4.6000000000000002e-262 < z < 1.05e-10Initial program 98.7%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 67.0%
Taylor expanded in z around 0 64.8%
if -1.2e-245 < z < 4.6000000000000002e-262Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
associate-/r/100.0%
distribute-lft-neg-in100.0%
fma-define100.0%
distribute-neg-frac2100.0%
distribute-neg-in100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 59.6%
Taylor expanded in z around 0 59.6%
associate-*r/59.6%
neg-mul-159.6%
distribute-rgt-neg-in59.6%
Simplified59.6%
Final simplification78.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6900000.0)
(- x a)
(if (<= z -2.9e-108)
(+ x (/ z (/ t a)))
(if (<= z 3.3e-10)
(- x (/ (* y a) t))
(if (<= z 7.5e+50) (+ x (/ (* y a) z)) (- x a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6900000.0) {
tmp = x - a;
} else if (z <= -2.9e-108) {
tmp = x + (z / (t / a));
} else if (z <= 3.3e-10) {
tmp = x - ((y * a) / t);
} else if (z <= 7.5e+50) {
tmp = x + ((y * a) / z);
} else {
tmp = x - 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 <= (-6900000.0d0)) then
tmp = x - a
else if (z <= (-2.9d-108)) then
tmp = x + (z / (t / a))
else if (z <= 3.3d-10) then
tmp = x - ((y * a) / t)
else if (z <= 7.5d+50) then
tmp = x + ((y * a) / z)
else
tmp = x - 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 <= -6900000.0) {
tmp = x - a;
} else if (z <= -2.9e-108) {
tmp = x + (z / (t / a));
} else if (z <= 3.3e-10) {
tmp = x - ((y * a) / t);
} else if (z <= 7.5e+50) {
tmp = x + ((y * a) / z);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6900000.0: tmp = x - a elif z <= -2.9e-108: tmp = x + (z / (t / a)) elif z <= 3.3e-10: tmp = x - ((y * a) / t) elif z <= 7.5e+50: tmp = x + ((y * a) / z) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6900000.0) tmp = Float64(x - a); elseif (z <= -2.9e-108) tmp = Float64(x + Float64(z / Float64(t / a))); elseif (z <= 3.3e-10) tmp = Float64(x - Float64(Float64(y * a) / t)); elseif (z <= 7.5e+50) tmp = Float64(x + Float64(Float64(y * a) / z)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6900000.0) tmp = x - a; elseif (z <= -2.9e-108) tmp = x + (z / (t / a)); elseif (z <= 3.3e-10) tmp = x - ((y * a) / t); elseif (z <= 7.5e+50) tmp = x + ((y * a) / z); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6900000.0], N[(x - a), $MachinePrecision], If[LessEqual[z, -2.9e-108], N[(x + N[(z / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e-10], N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e+50], N[(x + N[(N[(y * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6900000:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-108}:\\
\;\;\;\;x + \frac{z}{\frac{t}{a}}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-10}:\\
\;\;\;\;x - \frac{y \cdot a}{t}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+50}:\\
\;\;\;\;x + \frac{y \cdot a}{z}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -6.9e6 or 7.4999999999999999e50 < z Initial program 94.1%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 84.8%
if -6.9e6 < z < -2.9000000000000001e-108Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 71.8%
Taylor expanded in y around 0 72.7%
cancel-sign-sub-inv72.7%
metadata-eval72.7%
*-lft-identity72.7%
+-commutative72.7%
associate-/l*72.7%
Simplified72.7%
associate-*r/72.7%
add-cube-cbrt72.5%
times-frac72.5%
add-sqr-sqrt0.0%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod56.7%
add-sqr-sqrt56.7%
times-frac56.7%
*-commutative56.7%
add-cube-cbrt56.7%
associate-/l*56.7%
add-sqr-sqrt56.7%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod0.0%
add-sqr-sqrt76.5%
clear-num76.6%
div-inv76.6%
Applied egg-rr76.6%
if -2.9000000000000001e-108 < z < 3.3e-10Initial program 98.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 63.3%
Taylor expanded in z around 0 59.0%
if 3.3e-10 < z < 7.4999999999999999e50Initial program 100.0%
Taylor expanded in z around inf 82.1%
associate-*r/82.1%
neg-mul-182.1%
Simplified82.1%
Taylor expanded in y around inf 82.9%
associate-*r/82.9%
neg-mul-182.9%
distribute-rgt-neg-in82.9%
Simplified82.9%
Final simplification73.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1960000000000.0)
(- x a)
(if (<= z -5.1e-108)
(+ x (/ z (/ t a)))
(if (<= z 1.05e-10) (- x (/ (* y a) t)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1960000000000.0) {
tmp = x - a;
} else if (z <= -5.1e-108) {
tmp = x + (z / (t / a));
} else if (z <= 1.05e-10) {
tmp = x - ((y * a) / t);
} else {
tmp = x - 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 <= (-1960000000000.0d0)) then
tmp = x - a
else if (z <= (-5.1d-108)) then
tmp = x + (z / (t / a))
else if (z <= 1.05d-10) then
tmp = x - ((y * a) / t)
else
tmp = x - 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 <= -1960000000000.0) {
tmp = x - a;
} else if (z <= -5.1e-108) {
tmp = x + (z / (t / a));
} else if (z <= 1.05e-10) {
tmp = x - ((y * a) / t);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1960000000000.0: tmp = x - a elif z <= -5.1e-108: tmp = x + (z / (t / a)) elif z <= 1.05e-10: tmp = x - ((y * a) / t) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1960000000000.0) tmp = Float64(x - a); elseif (z <= -5.1e-108) tmp = Float64(x + Float64(z / Float64(t / a))); elseif (z <= 1.05e-10) tmp = Float64(x - Float64(Float64(y * a) / t)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1960000000000.0) tmp = x - a; elseif (z <= -5.1e-108) tmp = x + (z / (t / a)); elseif (z <= 1.05e-10) tmp = x - ((y * a) / t); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1960000000000.0], N[(x - a), $MachinePrecision], If[LessEqual[z, -5.1e-108], N[(x + N[(z / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-10], N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1960000000000:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -5.1 \cdot 10^{-108}:\\
\;\;\;\;x + \frac{z}{\frac{t}{a}}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-10}:\\
\;\;\;\;x - \frac{y \cdot a}{t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.96e12 or 1.05e-10 < z Initial program 94.8%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 80.5%
if -1.96e12 < z < -5.1000000000000002e-108Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 71.8%
Taylor expanded in y around 0 72.7%
cancel-sign-sub-inv72.7%
metadata-eval72.7%
*-lft-identity72.7%
+-commutative72.7%
associate-/l*72.7%
Simplified72.7%
associate-*r/72.7%
add-cube-cbrt72.5%
times-frac72.5%
add-sqr-sqrt0.0%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod56.7%
add-sqr-sqrt56.7%
times-frac56.7%
*-commutative56.7%
add-cube-cbrt56.7%
associate-/l*56.7%
add-sqr-sqrt56.7%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod0.0%
add-sqr-sqrt76.5%
clear-num76.6%
div-inv76.6%
Applied egg-rr76.6%
if -5.1000000000000002e-108 < z < 1.05e-10Initial program 98.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 63.0%
Taylor expanded in z around 0 59.5%
Final simplification71.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.7e+37)
(+ x (/ (- z y) (/ t a)))
(if (<= t 8.5e+45)
(- x (* a (/ (- y z) (- 1.0 z))))
(+ x (* a (/ (- z y) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.7e+37) {
tmp = x + ((z - y) / (t / a));
} else if (t <= 8.5e+45) {
tmp = x - (a * ((y - z) / (1.0 - z)));
} else {
tmp = x + (a * ((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 (t <= (-3.7d+37)) then
tmp = x + ((z - y) / (t / a))
else if (t <= 8.5d+45) then
tmp = x - (a * ((y - z) / (1.0d0 - z)))
else
tmp = x + (a * ((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 (t <= -3.7e+37) {
tmp = x + ((z - y) / (t / a));
} else if (t <= 8.5e+45) {
tmp = x - (a * ((y - z) / (1.0 - z)));
} else {
tmp = x + (a * ((z - y) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.7e+37: tmp = x + ((z - y) / (t / a)) elif t <= 8.5e+45: tmp = x - (a * ((y - z) / (1.0 - z))) else: tmp = x + (a * ((z - y) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.7e+37) tmp = Float64(x + Float64(Float64(z - y) / Float64(t / a))); elseif (t <= 8.5e+45) tmp = Float64(x - Float64(a * Float64(Float64(y - z) / Float64(1.0 - z)))); else tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.7e+37) tmp = x + ((z - y) / (t / a)); elseif (t <= 8.5e+45) tmp = x - (a * ((y - z) / (1.0 - z))); else tmp = x + (a * ((z - y) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.7e+37], N[(x + N[(N[(z - y), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e+45], N[(x - N[(a * N[(N[(y - z), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{+37}:\\
\;\;\;\;x + \frac{z - y}{\frac{t}{a}}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+45}:\\
\;\;\;\;x - a \cdot \frac{y - z}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\end{array}
\end{array}
if t < -3.6999999999999999e37Initial program 99.8%
Taylor expanded in t around inf 91.3%
if -3.6999999999999999e37 < t < 8.4999999999999996e45Initial program 95.6%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 99.0%
if 8.4999999999999996e45 < t Initial program 97.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 89.5%
Final simplification95.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3800000000.0) (not (<= z 1.05e-10))) (+ x (* a (+ -1.0 (/ y z)))) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3800000000.0) || !(z <= 1.05e-10)) {
tmp = x + (a * (-1.0 + (y / z)));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
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 <= (-3800000000.0d0)) .or. (.not. (z <= 1.05d-10))) then
tmp = x + (a * ((-1.0d0) + (y / z)))
else
tmp = x - (a * (y / (t + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3800000000.0) || !(z <= 1.05e-10)) {
tmp = x + (a * (-1.0 + (y / z)));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3800000000.0) or not (z <= 1.05e-10): tmp = x + (a * (-1.0 + (y / z))) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3800000000.0) || !(z <= 1.05e-10)) tmp = Float64(x + Float64(a * Float64(-1.0 + Float64(y / z)))); else tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3800000000.0) || ~((z <= 1.05e-10))) tmp = x + (a * (-1.0 + (y / z))); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3800000000.0], N[Not[LessEqual[z, 1.05e-10]], $MachinePrecision]], N[(x + N[(a * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3800000000 \lor \neg \left(z \leq 1.05 \cdot 10^{-10}\right):\\
\;\;\;\;x + a \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -3.8e9 or 1.05e-10 < z Initial program 94.8%
Taylor expanded in z around inf 85.6%
associate-*r/85.6%
neg-mul-185.6%
Simplified85.6%
Taylor expanded in y around 0 78.8%
*-rgt-identity78.8%
mul-1-neg78.8%
associate-/l*90.1%
distribute-rgt-neg-in90.1%
distribute-lft-in90.1%
sub-neg90.1%
Simplified90.1%
if -3.8e9 < z < 1.05e-10Initial program 99.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 93.5%
Final simplification91.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -880000000000.0) (not (<= z 3.8e-10))) (- x a) (+ x (* a (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -880000000000.0) || !(z <= 3.8e-10)) {
tmp = x - a;
} else {
tmp = x + (a * (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) :: tmp
if ((z <= (-880000000000.0d0)) .or. (.not. (z <= 3.8d-10))) then
tmp = x - a
else
tmp = x + (a * (z / 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 <= -880000000000.0) || !(z <= 3.8e-10)) {
tmp = x - a;
} else {
tmp = x + (a * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -880000000000.0) or not (z <= 3.8e-10): tmp = x - a else: tmp = x + (a * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -880000000000.0) || !(z <= 3.8e-10)) tmp = Float64(x - a); else tmp = Float64(x + Float64(a * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -880000000000.0) || ~((z <= 3.8e-10))) tmp = x - a; else tmp = x + (a * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -880000000000.0], N[Not[LessEqual[z, 3.8e-10]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(a * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -880000000000 \lor \neg \left(z \leq 3.8 \cdot 10^{-10}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -8.8e11 or 3.7999999999999998e-10 < z Initial program 94.7%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 81.1%
if -8.8e11 < z < 3.7999999999999998e-10Initial program 99.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 64.9%
Taylor expanded in y around 0 55.0%
cancel-sign-sub-inv55.0%
metadata-eval55.0%
*-lft-identity55.0%
+-commutative55.0%
associate-/l*55.0%
Simplified55.0%
Final simplification67.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -13200000.0) (not (<= z 2.75e+29))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -13200000.0) || !(z <= 2.75e+29)) {
tmp = x - a;
} else {
tmp = x;
}
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 <= (-13200000.0d0)) .or. (.not. (z <= 2.75d+29))) then
tmp = x - a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -13200000.0) || !(z <= 2.75e+29)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -13200000.0) or not (z <= 2.75e+29): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -13200000.0) || !(z <= 2.75e+29)) tmp = Float64(x - a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -13200000.0) || ~((z <= 2.75e+29))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -13200000.0], N[Not[LessEqual[z, 2.75e+29]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -13200000 \lor \neg \left(z \leq 2.75 \cdot 10^{+29}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.32e7 or 2.75e29 < z Initial program 94.2%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 83.4%
if -1.32e7 < z < 2.75e29Initial program 99.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 53.2%
Final simplification66.8%
(FPCore (x y z t a) :precision binary64 (+ x (* a (/ (- y z) (+ -1.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 + (z - 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 + (a * ((y - z) / ((-1.0d0) + (z - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 + (z - t))));
}
def code(x, y, z, t, a): return x + (a * ((y - z) / (-1.0 + (z - t))))
function code(x, y, z, t, a) return Float64(x + Float64(a * Float64(Float64(y - z) / Float64(-1.0 + Float64(z - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + (a * ((y - z) / (-1.0 + (z - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \frac{y - z}{-1 + \left(z - t\right)}
\end{array}
Initial program 96.9%
associate-/r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 51.7%
Final simplification51.7%
(FPCore (x y z t a) :precision binary64 (- x (* (/ (- y z) (+ (- t z) 1.0)) a)))
double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
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 - z) + 1.0d0)) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
def code(x, y, z, t, a): return x - (((y - z) / ((t - z) + 1.0)) * a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(y - z) / Float64(Float64(t - z) + 1.0)) * a)) end
function tmp = code(x, y, z, t, a) tmp = x - (((y - z) / ((t - z) + 1.0)) * a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(y - z), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\left(t - z\right) + 1} \cdot a
\end{array}
herbie shell --seed 2024079
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))