
(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 (+ x (* a (/ (- z y) (+ (- t z) 1.0)))))
double code(double x, double y, double z, double t, double a) {
return x + (a * ((z - y) / ((t - z) + 1.0)));
}
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 * ((z - y) / ((t - z) + 1.0d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a * ((z - y) / ((t - z) + 1.0)));
}
def code(x, y, z, t, a): return x + (a * ((z - y) / ((t - z) + 1.0)))
function code(x, y, z, t, a) return Float64(x + Float64(a * Float64(Float64(z - y) / Float64(Float64(t - z) + 1.0)))) end
function tmp = code(x, y, z, t, a) tmp = x + (a * ((z - y) / ((t - z) + 1.0))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \frac{z - y}{\left(t - z\right) + 1}
\end{array}
Initial program 96.9%
associate-/r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.7e+64)
(+ x (* a (/ (- z y) t)))
(if (<= t 0.0064)
(+ x (* (/ a (- 1.0 z)) (- z y)))
(- x (/ a (/ t (- y z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.7e+64) {
tmp = x + (a * ((z - y) / t));
} else if (t <= 0.0064) {
tmp = x + ((a / (1.0 - z)) * (z - y));
} else {
tmp = x - (a / (t / (y - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.7d+64)) then
tmp = x + (a * ((z - y) / t))
else if (t <= 0.0064d0) then
tmp = x + ((a / (1.0d0 - z)) * (z - y))
else
tmp = x - (a / (t / (y - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.7e+64) {
tmp = x + (a * ((z - y) / t));
} else if (t <= 0.0064) {
tmp = x + ((a / (1.0 - z)) * (z - y));
} else {
tmp = x - (a / (t / (y - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.7e+64: tmp = x + (a * ((z - y) / t)) elif t <= 0.0064: tmp = x + ((a / (1.0 - z)) * (z - y)) else: tmp = x - (a / (t / (y - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.7e+64) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); elseif (t <= 0.0064) tmp = Float64(x + Float64(Float64(a / Float64(1.0 - z)) * Float64(z - y))); else tmp = Float64(x - Float64(a / Float64(t / Float64(y - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.7e+64) tmp = x + (a * ((z - y) / t)); elseif (t <= 0.0064) tmp = x + ((a / (1.0 - z)) * (z - y)); else tmp = x - (a / (t / (y - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.7e+64], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.0064], N[(x + N[(N[(a / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+64}:\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\mathbf{elif}\;t \leq 0.0064:\\
\;\;\;\;x + \frac{a}{1 - z} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y - z}}\\
\end{array}
\end{array}
if t < -1.7000000000000001e64Initial program 96.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 92.6%
if -1.7000000000000001e64 < t < 0.00640000000000000031Initial program 97.2%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 87.6%
associate-/l*97.4%
associate-/r/95.0%
Simplified95.0%
if 0.00640000000000000031 < t Initial program 96.2%
associate-/r/99.8%
Simplified99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 79.0%
associate-/l*90.0%
Simplified90.0%
Final simplification93.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -410000.0)
(- x a)
(if (<= z -6.9e-295)
(- x (* y (/ a t)))
(if (<= z 1700.0) (- x (* y a)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -410000.0) {
tmp = x - a;
} else if (z <= -6.9e-295) {
tmp = x - (y * (a / t));
} else if (z <= 1700.0) {
tmp = x - (y * a);
} 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 <= (-410000.0d0)) then
tmp = x - a
else if (z <= (-6.9d-295)) then
tmp = x - (y * (a / t))
else if (z <= 1700.0d0) then
tmp = x - (y * a)
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 <= -410000.0) {
tmp = x - a;
} else if (z <= -6.9e-295) {
tmp = x - (y * (a / t));
} else if (z <= 1700.0) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -410000.0: tmp = x - a elif z <= -6.9e-295: tmp = x - (y * (a / t)) elif z <= 1700.0: tmp = x - (y * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -410000.0) tmp = Float64(x - a); elseif (z <= -6.9e-295) tmp = Float64(x - Float64(y * Float64(a / t))); elseif (z <= 1700.0) tmp = Float64(x - Float64(y * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -410000.0) tmp = x - a; elseif (z <= -6.9e-295) tmp = x - (y * (a / t)); elseif (z <= 1700.0) tmp = x - (y * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -410000.0], N[(x - a), $MachinePrecision], If[LessEqual[z, -6.9e-295], N[(x - N[(y * N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1700.0], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -410000:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -6.9 \cdot 10^{-295}:\\
\;\;\;\;x - y \cdot \frac{a}{t}\\
\mathbf{elif}\;z \leq 1700:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.1e5 or 1700 < z Initial program 94.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 73.9%
if -4.1e5 < z < -6.89999999999999996e-295Initial program 99.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 77.4%
Taylor expanded in y around inf 71.5%
*-commutative71.5%
associate-*r/72.8%
Simplified72.8%
if -6.89999999999999996e-295 < z < 1700Initial program 98.2%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 79.2%
Taylor expanded in z around 0 73.1%
Final simplification73.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -210.0)
(- x a)
(if (<= z -1.9e-293)
(- x (* a (/ y t)))
(if (<= z 1600.0) (- x (* y a)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -210.0) {
tmp = x - a;
} else if (z <= -1.9e-293) {
tmp = x - (a * (y / t));
} else if (z <= 1600.0) {
tmp = x - (y * a);
} 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 <= (-210.0d0)) then
tmp = x - a
else if (z <= (-1.9d-293)) then
tmp = x - (a * (y / t))
else if (z <= 1600.0d0) then
tmp = x - (y * a)
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 <= -210.0) {
tmp = x - a;
} else if (z <= -1.9e-293) {
tmp = x - (a * (y / t));
} else if (z <= 1600.0) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -210.0: tmp = x - a elif z <= -1.9e-293: tmp = x - (a * (y / t)) elif z <= 1600.0: tmp = x - (y * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -210.0) tmp = Float64(x - a); elseif (z <= -1.9e-293) tmp = Float64(x - Float64(a * Float64(y / t))); elseif (z <= 1600.0) tmp = Float64(x - Float64(y * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -210.0) tmp = x - a; elseif (z <= -1.9e-293) tmp = x - (a * (y / t)); elseif (z <= 1600.0) tmp = x - (y * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -210.0], N[(x - a), $MachinePrecision], If[LessEqual[z, -1.9e-293], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1600.0], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -210:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-293}:\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 1600:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -210 or 1600 < z Initial program 94.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 73.9%
if -210 < z < -1.9e-293Initial program 99.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 77.4%
Taylor expanded in y around inf 74.3%
if -1.9e-293 < z < 1600Initial program 98.2%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 79.2%
Taylor expanded in z around 0 73.1%
Final simplification73.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6e+32) (not (<= z 1.1e+45))) (- x a) (- x (* y (/ a (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6e+32) || !(z <= 1.1e+45)) {
tmp = x - a;
} else {
tmp = x - (y * (a / (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 <= (-6d+32)) .or. (.not. (z <= 1.1d+45))) then
tmp = x - a
else
tmp = x - (y * (a / (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 <= -6e+32) || !(z <= 1.1e+45)) {
tmp = x - a;
} else {
tmp = x - (y * (a / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6e+32) or not (z <= 1.1e+45): tmp = x - a else: tmp = x - (y * (a / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6e+32) || !(z <= 1.1e+45)) tmp = Float64(x - a); else tmp = Float64(x - Float64(y * Float64(a / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6e+32) || ~((z <= 1.1e+45))) tmp = x - a; else tmp = x - (y * (a / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6e+32], N[Not[LessEqual[z, 1.1e+45]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * N[(a / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+32} \lor \neg \left(z \leq 1.1 \cdot 10^{+45}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{a}{t + 1}\\
\end{array}
\end{array}
if z < -6e32 or 1.1e45 < z Initial program 94.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 77.7%
if -6e32 < z < 1.1e45Initial program 99.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 80.0%
associate-/l*84.6%
associate-/r/84.0%
Simplified84.0%
Final simplification81.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1150000.0) (not (<= z 1e+40))) (+ x (- (* y (/ a z)) a)) (- x (* y (/ a (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1150000.0) || !(z <= 1e+40)) {
tmp = x + ((y * (a / z)) - a);
} else {
tmp = x - (y * (a / (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 <= (-1150000.0d0)) .or. (.not. (z <= 1d+40))) then
tmp = x + ((y * (a / z)) - a)
else
tmp = x - (y * (a / (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 <= -1150000.0) || !(z <= 1e+40)) {
tmp = x + ((y * (a / z)) - a);
} else {
tmp = x - (y * (a / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1150000.0) or not (z <= 1e+40): tmp = x + ((y * (a / z)) - a) else: tmp = x - (y * (a / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1150000.0) || !(z <= 1e+40)) tmp = Float64(x + Float64(Float64(y * Float64(a / z)) - a)); else tmp = Float64(x - Float64(y * Float64(a / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1150000.0) || ~((z <= 1e+40))) tmp = x + ((y * (a / z)) - a); else tmp = x - (y * (a / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1150000.0], N[Not[LessEqual[z, 1e+40]], $MachinePrecision]], N[(x + N[(N[(y * N[(a / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(a / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1150000 \lor \neg \left(z \leq 10^{+40}\right):\\
\;\;\;\;x + \left(y \cdot \frac{a}{z} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{a}{t + 1}\\
\end{array}
\end{array}
if z < -1.15e6 or 1.00000000000000003e40 < z Initial program 94.6%
Taylor expanded in z around inf 81.7%
mul-1-neg81.7%
distribute-neg-frac81.7%
Simplified81.7%
Taylor expanded in y around 0 78.1%
mul-1-neg78.1%
unsub-neg78.1%
*-commutative78.1%
associate-*r/84.8%
Simplified84.8%
if -1.15e6 < z < 1.00000000000000003e40Initial program 99.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 81.2%
associate-/l*85.9%
associate-/r/85.3%
Simplified85.3%
Final simplification85.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -900000.0) (+ x (- (/ y (/ z a)) a)) (if (<= z 1e+40) (- x (* y (/ a (+ t 1.0)))) (+ x (- (* y (/ a z)) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -900000.0) {
tmp = x + ((y / (z / a)) - a);
} else if (z <= 1e+40) {
tmp = x - (y * (a / (t + 1.0)));
} else {
tmp = x + ((y * (a / 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 <= (-900000.0d0)) then
tmp = x + ((y / (z / a)) - a)
else if (z <= 1d+40) then
tmp = x - (y * (a / (t + 1.0d0)))
else
tmp = x + ((y * (a / 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 <= -900000.0) {
tmp = x + ((y / (z / a)) - a);
} else if (z <= 1e+40) {
tmp = x - (y * (a / (t + 1.0)));
} else {
tmp = x + ((y * (a / z)) - a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -900000.0: tmp = x + ((y / (z / a)) - a) elif z <= 1e+40: tmp = x - (y * (a / (t + 1.0))) else: tmp = x + ((y * (a / z)) - a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -900000.0) tmp = Float64(x + Float64(Float64(y / Float64(z / a)) - a)); elseif (z <= 1e+40) tmp = Float64(x - Float64(y * Float64(a / Float64(t + 1.0)))); else tmp = Float64(x + Float64(Float64(y * Float64(a / z)) - a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -900000.0) tmp = x + ((y / (z / a)) - a); elseif (z <= 1e+40) tmp = x - (y * (a / (t + 1.0))); else tmp = x + ((y * (a / z)) - a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -900000.0], N[(x + N[(N[(y / N[(z / a), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+40], N[(x - N[(y * N[(a / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(a / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -900000:\\
\;\;\;\;x + \left(\frac{y}{\frac{z}{a}} - a\right)\\
\mathbf{elif}\;z \leq 10^{+40}:\\
\;\;\;\;x - y \cdot \frac{a}{t + 1}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot \frac{a}{z} - a\right)\\
\end{array}
\end{array}
if z < -9e5Initial program 94.4%
Taylor expanded in z around inf 84.2%
mul-1-neg84.2%
distribute-neg-frac84.2%
Simplified84.2%
Taylor expanded in y around 0 81.7%
mul-1-neg81.7%
unsub-neg81.7%
*-commutative81.7%
associate-*r/87.0%
Simplified87.0%
clear-num87.0%
un-div-inv87.0%
Applied egg-rr87.0%
if -9e5 < z < 1.00000000000000003e40Initial program 99.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 81.2%
associate-/l*85.9%
associate-/r/85.3%
Simplified85.3%
if 1.00000000000000003e40 < z Initial program 94.7%
Taylor expanded in z around inf 78.6%
mul-1-neg78.6%
distribute-neg-frac78.6%
Simplified78.6%
Taylor expanded in y around 0 73.7%
mul-1-neg73.7%
unsub-neg73.7%
*-commutative73.7%
associate-*r/82.0%
Simplified82.0%
Final simplification85.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -1150000.0) (+ x (- (/ y (/ z a)) a)) (if (<= z 3.9e+40) (- x (/ a (/ (+ t 1.0) y))) (+ x (- (* y (/ a z)) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1150000.0) {
tmp = x + ((y / (z / a)) - a);
} else if (z <= 3.9e+40) {
tmp = x - (a / ((t + 1.0) / y));
} else {
tmp = x + ((y * (a / 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 <= (-1150000.0d0)) then
tmp = x + ((y / (z / a)) - a)
else if (z <= 3.9d+40) then
tmp = x - (a / ((t + 1.0d0) / y))
else
tmp = x + ((y * (a / 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 <= -1150000.0) {
tmp = x + ((y / (z / a)) - a);
} else if (z <= 3.9e+40) {
tmp = x - (a / ((t + 1.0) / y));
} else {
tmp = x + ((y * (a / z)) - a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1150000.0: tmp = x + ((y / (z / a)) - a) elif z <= 3.9e+40: tmp = x - (a / ((t + 1.0) / y)) else: tmp = x + ((y * (a / z)) - a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1150000.0) tmp = Float64(x + Float64(Float64(y / Float64(z / a)) - a)); elseif (z <= 3.9e+40) tmp = Float64(x - Float64(a / Float64(Float64(t + 1.0) / y))); else tmp = Float64(x + Float64(Float64(y * Float64(a / z)) - a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1150000.0) tmp = x + ((y / (z / a)) - a); elseif (z <= 3.9e+40) tmp = x - (a / ((t + 1.0) / y)); else tmp = x + ((y * (a / z)) - a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1150000.0], N[(x + N[(N[(y / N[(z / a), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e+40], N[(x - N[(a / N[(N[(t + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(a / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1150000:\\
\;\;\;\;x + \left(\frac{y}{\frac{z}{a}} - a\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+40}:\\
\;\;\;\;x - \frac{a}{\frac{t + 1}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot \frac{a}{z} - a\right)\\
\end{array}
\end{array}
if z < -1.15e6Initial program 94.4%
Taylor expanded in z around inf 84.2%
mul-1-neg84.2%
distribute-neg-frac84.2%
Simplified84.2%
Taylor expanded in y around 0 81.7%
mul-1-neg81.7%
unsub-neg81.7%
*-commutative81.7%
associate-*r/87.0%
Simplified87.0%
clear-num87.0%
un-div-inv87.0%
Applied egg-rr87.0%
if -1.15e6 < z < 3.9000000000000001e40Initial program 99.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 81.2%
associate-/l*85.9%
Simplified85.9%
if 3.9000000000000001e40 < z Initial program 94.7%
Taylor expanded in z around inf 78.6%
mul-1-neg78.6%
distribute-neg-frac78.6%
Simplified78.6%
Taylor expanded in y around 0 73.7%
mul-1-neg73.7%
unsub-neg73.7%
*-commutative73.7%
associate-*r/82.0%
Simplified82.0%
Final simplification85.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3e+36) (not (<= z 4700.0))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3e+36) || !(z <= 4700.0)) {
tmp = x - a;
} else {
tmp = x - (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 <= (-3d+36)) .or. (.not. (z <= 4700.0d0))) then
tmp = x - a
else
tmp = x - (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 <= -3e+36) || !(z <= 4700.0)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3e+36) or not (z <= 4700.0): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3e+36) || !(z <= 4700.0)) tmp = Float64(x - a); else tmp = Float64(x - Float64(y * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3e+36) || ~((z <= 4700.0))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3e+36], N[Not[LessEqual[z, 4700.0]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+36} \lor \neg \left(z \leq 4700\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -3e36 or 4700 < z Initial program 94.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 74.9%
if -3e36 < z < 4700Initial program 99.1%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 77.5%
Taylor expanded in z around 0 67.4%
Final simplification71.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.8e-11) (not (<= z 5e-17))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.8e-11) || !(z <= 5e-17)) {
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 <= (-7.8d-11)) .or. (.not. (z <= 5d-17))) 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 <= -7.8e-11) || !(z <= 5e-17)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.8e-11) or not (z <= 5e-17): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.8e-11) || !(z <= 5e-17)) 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 <= -7.8e-11) || ~((z <= 5e-17))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.8e-11], N[Not[LessEqual[z, 5e-17]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{-11} \lor \neg \left(z \leq 5 \cdot 10^{-17}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.80000000000000021e-11 or 4.9999999999999999e-17 < z Initial program 95.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 70.6%
if -7.80000000000000021e-11 < z < 4.9999999999999999e-17Initial program 99.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around inf 88.2%
Taylor expanded in x around inf 55.2%
Final simplification63.7%
(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 y around inf 75.5%
Taylor expanded in x around inf 51.1%
Final simplification51.1%
(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 2024018
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:herbie-target
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))