
(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 12 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 95.7%
associate-/r/99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e-29) (not (<= z 1.05e-11))) (+ x (/ a (/ (+ (- t z) 1.0) z))) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e-29) || !(z <= 1.05e-11)) {
tmp = x + (a / (((t - z) + 1.0) / 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 <= (-9d-29)) .or. (.not. (z <= 1.05d-11))) then
tmp = x + (a / (((t - z) + 1.0d0) / 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 <= -9e-29) || !(z <= 1.05e-11)) {
tmp = x + (a / (((t - z) + 1.0) / z));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e-29) or not (z <= 1.05e-11): tmp = x + (a / (((t - z) + 1.0) / z)) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e-29) || !(z <= 1.05e-11)) tmp = Float64(x + Float64(a / Float64(Float64(Float64(t - z) + 1.0) / 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 <= -9e-29) || ~((z <= 1.05e-11))) tmp = x + (a / (((t - z) + 1.0) / z)); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e-29], N[Not[LessEqual[z, 1.05e-11]], $MachinePrecision]], N[(x + N[(a / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / z), $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 -9 \cdot 10^{-29} \lor \neg \left(z \leq 1.05 \cdot 10^{-11}\right):\\
\;\;\;\;x + \frac{a}{\frac{\left(t - z\right) + 1}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -8.9999999999999996e-29 or 1.0499999999999999e-11 < z Initial program 91.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in y around 0 67.5%
sub-neg67.5%
mul-1-neg67.5%
*-commutative67.5%
associate--l+67.5%
+-commutative67.5%
associate-*r/81.0%
remove-double-neg81.0%
associate-*r/67.5%
*-commutative67.5%
+-commutative67.5%
associate--l+67.5%
associate-/l*87.2%
associate--l+87.2%
Simplified87.2%
if -8.9999999999999996e-29 < z < 1.0499999999999999e-11Initial program 99.9%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 96.9%
Final simplification91.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- t z) 1.0)))
(if (or (<= z -2.4e+38) (not (<= z 3.7e+76)))
(+ x (/ a (/ t_1 z)))
(- x (* y (/ a t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) + 1.0;
double tmp;
if ((z <= -2.4e+38) || !(z <= 3.7e+76)) {
tmp = x + (a / (t_1 / z));
} else {
tmp = x - (y * (a / 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 = (t - z) + 1.0d0
if ((z <= (-2.4d+38)) .or. (.not. (z <= 3.7d+76))) then
tmp = x + (a / (t_1 / z))
else
tmp = x - (y * (a / 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 = (t - z) + 1.0;
double tmp;
if ((z <= -2.4e+38) || !(z <= 3.7e+76)) {
tmp = x + (a / (t_1 / z));
} else {
tmp = x - (y * (a / t_1));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t - z) + 1.0 tmp = 0 if (z <= -2.4e+38) or not (z <= 3.7e+76): tmp = x + (a / (t_1 / z)) else: tmp = x - (y * (a / t_1)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) + 1.0) tmp = 0.0 if ((z <= -2.4e+38) || !(z <= 3.7e+76)) tmp = Float64(x + Float64(a / Float64(t_1 / z))); else tmp = Float64(x - Float64(y * Float64(a / t_1))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t - z) + 1.0; tmp = 0.0; if ((z <= -2.4e+38) || ~((z <= 3.7e+76))) tmp = x + (a / (t_1 / z)); else tmp = x - (y * (a / t_1)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]}, If[Or[LessEqual[z, -2.4e+38], N[Not[LessEqual[z, 3.7e+76]], $MachinePrecision]], N[(x + N[(a / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(a / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - z\right) + 1\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+38} \lor \neg \left(z \leq 3.7 \cdot 10^{+76}\right):\\
\;\;\;\;x + \frac{a}{\frac{t_1}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{a}{t_1}\\
\end{array}
\end{array}
if z < -2.40000000000000017e38 or 3.6999999999999999e76 < z Initial program 90.5%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in y around 0 66.3%
sub-neg66.3%
mul-1-neg66.3%
*-commutative66.3%
associate--l+66.3%
+-commutative66.3%
associate-*r/83.1%
remove-double-neg83.1%
associate-*r/66.3%
*-commutative66.3%
+-commutative66.3%
associate--l+66.3%
associate-/l*90.8%
associate--l+90.8%
Simplified90.8%
if -2.40000000000000017e38 < z < 3.6999999999999999e76Initial program 99.4%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in y around inf 91.4%
*-commutative91.4%
associate--l+91.4%
+-commutative91.4%
associate-*r/93.6%
+-commutative93.6%
Simplified93.6%
Final simplification92.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.95e-32) (not (<= z 1.75e+56))) (+ x (* a (/ (- z y) (- 1.0 z)))) (- x (* y (/ a (+ (- t z) 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.95e-32) || !(z <= 1.75e+56)) {
tmp = x + (a * ((z - y) / (1.0 - z)));
} else {
tmp = x - (y * (a / ((t - z) + 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 <= (-1.95d-32)) .or. (.not. (z <= 1.75d+56))) then
tmp = x + (a * ((z - y) / (1.0d0 - z)))
else
tmp = x - (y * (a / ((t - z) + 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 <= -1.95e-32) || !(z <= 1.75e+56)) {
tmp = x + (a * ((z - y) / (1.0 - z)));
} else {
tmp = x - (y * (a / ((t - z) + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.95e-32) or not (z <= 1.75e+56): tmp = x + (a * ((z - y) / (1.0 - z))) else: tmp = x - (y * (a / ((t - z) + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.95e-32) || !(z <= 1.75e+56)) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / Float64(1.0 - z)))); else tmp = Float64(x - Float64(y * Float64(a / Float64(Float64(t - z) + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.95e-32) || ~((z <= 1.75e+56))) tmp = x + (a * ((z - y) / (1.0 - z))); else tmp = x - (y * (a / ((t - z) + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.95e-32], N[Not[LessEqual[z, 1.75e+56]], $MachinePrecision]], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(a / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-32} \lor \neg \left(z \leq 1.75 \cdot 10^{+56}\right):\\
\;\;\;\;x + a \cdot \frac{z - y}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{a}{\left(t - z\right) + 1}\\
\end{array}
\end{array}
if z < -1.9500000000000001e-32 or 1.75e56 < z Initial program 91.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 95.4%
if -1.9500000000000001e-32 < z < 1.75e56Initial program 99.4%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in y around inf 93.6%
*-commutative93.6%
associate--l+93.6%
+-commutative93.6%
associate-*r/95.3%
+-commutative95.3%
Simplified95.3%
Final simplification95.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -920.0) (not (<= z 2e+24))) (+ x (/ (- z y) (/ (- z) a))) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -920.0) || !(z <= 2e+24)) {
tmp = x + ((z - y) / (-z / a));
} 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 <= (-920.0d0)) .or. (.not. (z <= 2d+24))) then
tmp = x + ((z - y) / (-z / a))
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 <= -920.0) || !(z <= 2e+24)) {
tmp = x + ((z - y) / (-z / a));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -920.0) or not (z <= 2e+24): tmp = x + ((z - y) / (-z / a)) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -920.0) || !(z <= 2e+24)) tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(-z) / a))); 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 <= -920.0) || ~((z <= 2e+24))) tmp = x + ((z - y) / (-z / a)); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -920.0], N[Not[LessEqual[z, 2e+24]], $MachinePrecision]], N[(x + N[(N[(z - y), $MachinePrecision] / N[((-z) / a), $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 -920 \lor \neg \left(z \leq 2 \cdot 10^{+24}\right):\\
\;\;\;\;x + \frac{z - y}{\frac{-z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -920 or 2e24 < z Initial program 91.2%
Taylor expanded in z around inf 85.3%
mul-1-neg85.3%
distribute-neg-frac85.3%
Simplified85.3%
if -920 < z < 2e24Initial program 99.9%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 93.8%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.2e-34) (not (<= z 0.024))) (+ x (/ a (/ (- 1.0 z) z))) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.2e-34) || !(z <= 0.024)) {
tmp = x + (a / ((1.0 - z) / z));
} 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 <= (-6.2d-34)) .or. (.not. (z <= 0.024d0))) then
tmp = x + (a / ((1.0d0 - z) / z))
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 <= -6.2e-34) || !(z <= 0.024)) {
tmp = x + (a / ((1.0 - z) / z));
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.2e-34) or not (z <= 0.024): tmp = x + (a / ((1.0 - z) / z)) else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.2e-34) || !(z <= 0.024)) tmp = Float64(x + Float64(a / Float64(Float64(1.0 - z) / z))); 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 <= -6.2e-34) || ~((z <= 0.024))) tmp = x + (a / ((1.0 - z) / z)); else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.2e-34], N[Not[LessEqual[z, 0.024]], $MachinePrecision]], N[(x + N[(a / N[(N[(1.0 - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-34} \lor \neg \left(z \leq 0.024\right):\\
\;\;\;\;x + \frac{a}{\frac{1 - z}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -6.1999999999999996e-34 or 0.024 < z Initial program 91.8%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 92.9%
Taylor expanded in y around 0 64.3%
sub-neg64.3%
mul-1-neg64.3%
remove-double-neg64.3%
associate-/l*82.7%
Simplified82.7%
if -6.1999999999999996e-34 < z < 0.024Initial program 99.9%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in t around 0 85.0%
Taylor expanded in z around 0 83.8%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.2e-29) (not (<= z 0.0095))) (+ x (/ a (/ (- 1.0 z) z))) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.2e-29) || !(z <= 0.0095)) {
tmp = x + (a / ((1.0 - z) / 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 <= (-2.2d-29)) .or. (.not. (z <= 0.0095d0))) then
tmp = x + (a / ((1.0d0 - z) / 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 <= -2.2e-29) || !(z <= 0.0095)) {
tmp = x + (a / ((1.0 - z) / z));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.2e-29) or not (z <= 0.0095): tmp = x + (a / ((1.0 - z) / z)) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.2e-29) || !(z <= 0.0095)) tmp = Float64(x + Float64(a / Float64(Float64(1.0 - z) / 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 <= -2.2e-29) || ~((z <= 0.0095))) tmp = x + (a / ((1.0 - z) / z)); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.2e-29], N[Not[LessEqual[z, 0.0095]], $MachinePrecision]], N[(x + N[(a / N[(N[(1.0 - z), $MachinePrecision] / z), $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 -2.2 \cdot 10^{-29} \lor \neg \left(z \leq 0.0095\right):\\
\;\;\;\;x + \frac{a}{\frac{1 - z}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -2.1999999999999999e-29 or 0.00949999999999999976 < z Initial program 91.7%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 93.5%
Taylor expanded in y around 0 64.0%
sub-neg64.0%
mul-1-neg64.0%
remove-double-neg64.0%
associate-/l*82.5%
Simplified82.5%
if -2.1999999999999999e-29 < z < 0.00949999999999999976Initial program 99.9%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 97.0%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.8e-34) (- x a) (if (<= z 0.034) (- x (* y a)) (- (- x a) (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.8e-34) {
tmp = x - a;
} else if (z <= 0.034) {
tmp = x - (y * a);
} else {
tmp = (x - a) - (a / 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 (z <= (-6.8d-34)) then
tmp = x - a
else if (z <= 0.034d0) then
tmp = x - (y * a)
else
tmp = (x - a) - (a / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.8e-34) {
tmp = x - a;
} else if (z <= 0.034) {
tmp = x - (y * a);
} else {
tmp = (x - a) - (a / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.8e-34: tmp = x - a elif z <= 0.034: tmp = x - (y * a) else: tmp = (x - a) - (a / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.8e-34) tmp = Float64(x - a); elseif (z <= 0.034) tmp = Float64(x - Float64(y * a)); else tmp = Float64(Float64(x - a) - Float64(a / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.8e-34) tmp = x - a; elseif (z <= 0.034) tmp = x - (y * a); else tmp = (x - a) - (a / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.8e-34], N[(x - a), $MachinePrecision], If[LessEqual[z, 0.034], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(N[(x - a), $MachinePrecision] - N[(a / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-34}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 0.034:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(x - a\right) - \frac{a}{z}\\
\end{array}
\end{array}
if z < -6.8000000000000001e-34Initial program 92.2%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 81.4%
if -6.8000000000000001e-34 < z < 0.034000000000000002Initial program 99.9%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in t around 0 85.0%
Taylor expanded in z around 0 83.8%
if 0.034000000000000002 < z Initial program 91.3%
Taylor expanded in t around 0 83.3%
Taylor expanded in y around 0 68.4%
*-commutative68.4%
associate-*r/74.9%
neg-mul-174.9%
distribute-lft-neg-in74.9%
cancel-sign-sub74.9%
Simplified74.9%
Taylor expanded in z around inf 82.3%
neg-mul-182.3%
associate-+r+82.3%
sub-neg82.3%
mul-1-neg82.3%
unsub-neg82.3%
Simplified82.3%
Final simplification82.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -10000000000.0) (not (<= z 7.5e-41))) (- x a) (+ x (* z a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -10000000000.0) || !(z <= 7.5e-41)) {
tmp = x - a;
} else {
tmp = x + (z * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-10000000000.0d0)) .or. (.not. (z <= 7.5d-41))) then
tmp = x - a
else
tmp = x + (z * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -10000000000.0) || !(z <= 7.5e-41)) {
tmp = x - a;
} else {
tmp = x + (z * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -10000000000.0) or not (z <= 7.5e-41): tmp = x - a else: tmp = x + (z * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -10000000000.0) || !(z <= 7.5e-41)) tmp = Float64(x - a); else tmp = Float64(x + Float64(z * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -10000000000.0) || ~((z <= 7.5e-41))) tmp = x - a; else tmp = x + (z * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -10000000000.0], N[Not[LessEqual[z, 7.5e-41]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(z * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -10000000000 \lor \neg \left(z \leq 7.5 \cdot 10^{-41}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot a\\
\end{array}
\end{array}
if z < -1e10 or 7.50000000000000049e-41 < z Initial program 91.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 80.6%
if -1e10 < z < 7.50000000000000049e-41Initial program 99.9%
Taylor expanded in t around 0 86.8%
Taylor expanded in y around 0 64.5%
*-commutative64.5%
associate-*r/64.5%
neg-mul-164.5%
distribute-lft-neg-in64.5%
cancel-sign-sub64.5%
Simplified64.5%
Taylor expanded in z around 0 64.5%
Final simplification72.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.8e-34) (not (<= z 0.034))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.8e-34) || !(z <= 0.034)) {
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 <= (-6.8d-34)) .or. (.not. (z <= 0.034d0))) 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 <= -6.8e-34) || !(z <= 0.034)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.8e-34) or not (z <= 0.034): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.8e-34) || !(z <= 0.034)) 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 <= -6.8e-34) || ~((z <= 0.034))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.8e-34], N[Not[LessEqual[z, 0.034]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-34} \lor \neg \left(z \leq 0.034\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -6.8000000000000001e-34 or 0.034000000000000002 < z Initial program 91.8%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 81.6%
if -6.8000000000000001e-34 < z < 0.034000000000000002Initial program 99.9%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in t around 0 85.0%
Taylor expanded in z around 0 83.8%
Final simplification82.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e+48) (not (<= z 1.42e+50))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e+48) || !(z <= 1.42e+50)) {
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.2d+48)) .or. (.not. (z <= 1.42d+50))) 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.2e+48) || !(z <= 1.42e+50)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e+48) or not (z <= 1.42e+50): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e+48) || !(z <= 1.42e+50)) 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.2e+48) || ~((z <= 1.42e+50))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e+48], N[Not[LessEqual[z, 1.42e+50]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+48} \lor \neg \left(z \leq 1.42 \cdot 10^{+50}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.19999999999999967e48 or 1.41999999999999994e50 < z Initial program 90.4%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 87.0%
if -7.19999999999999967e48 < z < 1.41999999999999994e50Initial program 99.5%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in x around inf 62.6%
Final simplification72.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 95.7%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in x around inf 54.3%
Final simplification54.3%
(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 2023312
(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))))