
(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 (/ (- 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 98.0%
associate-/r/99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.1e+72) (not (<= z 1.6e-29))) (+ x (* a (/ z (+ (- t z) 1.0)))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.1e+72) || !(z <= 1.6e-29)) {
tmp = x + (a * (z / ((t - z) + 1.0)));
} else {
tmp = x + (a * (y / (-1.0 - 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 <= (-3.1d+72)) .or. (.not. (z <= 1.6d-29))) then
tmp = x + (a * (z / ((t - z) + 1.0d0)))
else
tmp = x + (a * (y / ((-1.0d0) - 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 <= -3.1e+72) || !(z <= 1.6e-29)) {
tmp = x + (a * (z / ((t - z) + 1.0)));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.1e+72) or not (z <= 1.6e-29): tmp = x + (a * (z / ((t - z) + 1.0))) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.1e+72) || !(z <= 1.6e-29)) tmp = Float64(x + Float64(a * Float64(z / Float64(Float64(t - z) + 1.0)))); else tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.1e+72) || ~((z <= 1.6e-29))) tmp = x + (a * (z / ((t - z) + 1.0))); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.1e+72], N[Not[LessEqual[z, 1.6e-29]], $MachinePrecision]], N[(x + N[(a * N[(z / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+72} \lor \neg \left(z \leq 1.6 \cdot 10^{-29}\right):\\
\;\;\;\;x + a \cdot \frac{z}{\left(t - z\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -3.09999999999999988e72 or 1.6e-29 < z Initial program 96.5%
sub-neg96.5%
+-commutative96.5%
associate-/r/100.0%
distribute-rgt-neg-in100.0%
associate-*l/81.1%
associate-/l*96.5%
fma-define96.5%
distribute-frac-neg96.5%
distribute-neg-frac296.5%
distribute-neg-in96.5%
sub-neg96.5%
distribute-neg-in96.5%
remove-double-neg96.5%
+-commutative96.5%
sub-neg96.5%
metadata-eval96.5%
Simplified96.5%
Taylor expanded in y around 0 76.0%
mul-1-neg76.0%
unsub-neg76.0%
associate-/l*92.7%
associate--r+92.7%
sub-neg92.7%
metadata-eval92.7%
+-commutative92.7%
associate--l+92.7%
Simplified92.7%
if -3.09999999999999988e72 < z < 1.6e-29Initial program 99.4%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 92.9%
Final simplification92.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.7e+27) (not (<= z 20000000000000.0))) (+ x (* (- y z) (/ a z))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e+27) || !(z <= 20000000000000.0)) {
tmp = x + ((y - z) * (a / z));
} else {
tmp = x + (a * (y / (-1.0 - 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 <= (-1.7d+27)) .or. (.not. (z <= 20000000000000.0d0))) then
tmp = x + ((y - z) * (a / z))
else
tmp = x + (a * (y / ((-1.0d0) - 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 <= -1.7e+27) || !(z <= 20000000000000.0)) {
tmp = x + ((y - z) * (a / z));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.7e+27) or not (z <= 20000000000000.0): tmp = x + ((y - z) * (a / z)) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.7e+27) || !(z <= 20000000000000.0)) tmp = Float64(x + Float64(Float64(y - z) * Float64(a / z))); else tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.7e+27) || ~((z <= 20000000000000.0))) tmp = x + ((y - z) * (a / z)); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.7e+27], N[Not[LessEqual[z, 20000000000000.0]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+27} \lor \neg \left(z \leq 20000000000000\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{a}{z}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -1.7e27 or 2e13 < z Initial program 96.6%
clear-num96.5%
associate-/r/96.4%
clear-num96.5%
Applied egg-rr96.5%
Taylor expanded in z around inf 89.8%
associate-*r/89.8%
neg-mul-189.8%
Simplified89.8%
if -1.7e27 < z < 2e13Initial program 99.4%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 94.9%
Final simplification92.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3e+72) (not (<= z 2.8e+16))) (- x a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3e+72) || !(z <= 2.8e+16)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - 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 <= (-3d+72)) .or. (.not. (z <= 2.8d+16))) then
tmp = x - a
else
tmp = x + (a * (y / ((-1.0d0) - 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 <= -3e+72) || !(z <= 2.8e+16)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3e+72) or not (z <= 2.8e+16): tmp = x - a else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3e+72) || !(z <= 2.8e+16)) tmp = Float64(x - a); else tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3e+72) || ~((z <= 2.8e+16))) tmp = x - a; else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3e+72], N[Not[LessEqual[z, 2.8e+16]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+72} \lor \neg \left(z \leq 2.8 \cdot 10^{+16}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -3.00000000000000003e72 or 2.8e16 < z Initial program 96.3%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 87.7%
if -3.00000000000000003e72 < z < 2.8e16Initial program 99.5%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 91.9%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.5e+27) (+ x (/ (- y z) (/ z a))) (if (<= z 8e+16) (+ x (* a (/ y (- -1.0 t)))) (+ x (* (- y z) (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e+27) {
tmp = x + ((y - z) / (z / a));
} else if (z <= 8e+16) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + ((y - z) * (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 <= (-1.5d+27)) then
tmp = x + ((y - z) / (z / a))
else if (z <= 8d+16) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x + ((y - z) * (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 <= -1.5e+27) {
tmp = x + ((y - z) / (z / a));
} else if (z <= 8e+16) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + ((y - z) * (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.5e+27: tmp = x + ((y - z) / (z / a)) elif z <= 8e+16: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x + ((y - z) * (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e+27) tmp = Float64(x + Float64(Float64(y - z) / Float64(z / a))); elseif (z <= 8e+16) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x + Float64(Float64(y - z) * Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.5e+27) tmp = x + ((y - z) / (z / a)); elseif (z <= 8e+16) tmp = x + (a * (y / (-1.0 - t))); else tmp = x + ((y - z) * (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.5e+27], N[(x + N[(N[(y - z), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+16], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+27}:\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+16}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{a}{z}\\
\end{array}
\end{array}
if z < -1.49999999999999988e27Initial program 96.0%
Taylor expanded in z around inf 89.5%
associate-*r/89.5%
neg-mul-189.5%
Simplified89.5%
if -1.49999999999999988e27 < z < 8e16Initial program 99.4%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 94.9%
if 8e16 < z Initial program 97.1%
clear-num97.0%
associate-/r/97.0%
clear-num97.1%
Applied egg-rr97.1%
Taylor expanded in z around inf 90.1%
associate-*r/90.1%
neg-mul-190.1%
Simplified90.1%
Final simplification92.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.95e-50) (not (<= z 1.9e-71))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.95e-50) || !(z <= 1.9e-71)) {
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 <= (-1.95d-50)) .or. (.not. (z <= 1.9d-71))) 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 <= -1.95e-50) || !(z <= 1.9e-71)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.95e-50) or not (z <= 1.9e-71): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.95e-50) || !(z <= 1.9e-71)) 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 <= -1.95e-50) || ~((z <= 1.9e-71))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.95e-50], N[Not[LessEqual[z, 1.9e-71]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-50} \lor \neg \left(z \leq 1.9 \cdot 10^{-71}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -1.9500000000000001e-50 or 1.89999999999999996e-71 < z Initial program 97.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.0%
if -1.9500000000000001e-50 < z < 1.89999999999999996e-71Initial program 99.3%
clear-num99.3%
associate-/r/99.3%
clear-num99.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 94.7%
Taylor expanded in t around 0 78.3%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+38) (not (<= z 9.5e-79))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+38) || !(z <= 9.5e-79)) {
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 <= (-1.1d+38)) .or. (.not. (z <= 9.5d-79))) 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 <= -1.1e+38) || !(z <= 9.5e-79)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e+38) or not (z <= 9.5e-79): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+38) || !(z <= 9.5e-79)) 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 <= -1.1e+38) || ~((z <= 9.5e-79))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e+38], N[Not[LessEqual[z, 9.5e-79]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+38} \lor \neg \left(z \leq 9.5 \cdot 10^{-79}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.10000000000000003e38 or 9.4999999999999997e-79 < z Initial program 96.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.9%
if -1.10000000000000003e38 < z < 9.4999999999999997e-79Initial program 99.4%
sub-neg99.4%
+-commutative99.4%
associate-/r/99.2%
distribute-rgt-neg-in99.2%
associate-*l/96.8%
associate-/l*99.4%
fma-define99.4%
distribute-frac-neg99.4%
distribute-neg-frac299.4%
distribute-neg-in99.4%
sub-neg99.4%
distribute-neg-in99.4%
remove-double-neg99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in a around 0 62.9%
Final simplification73.7%
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ a (+ -1.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (a / (-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 + ((y - z) * (a / ((-1.0d0) + (z - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (a / (-1.0 + (z - t))));
}
def code(x, y, z, t, a): return x + ((y - z) * (a / (-1.0 + (z - t))))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(a / Float64(-1.0 + Float64(z - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * (a / (-1.0 + (z - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{a}{-1 + \left(z - t\right)}
\end{array}
Initial program 98.0%
clear-num97.9%
associate-/r/97.9%
clear-num98.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.55e+128) (not (<= a 1.08e+82))) (- a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.55e+128) || !(a <= 1.08e+82)) {
tmp = -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 ((a <= (-1.55d+128)) .or. (.not. (a <= 1.08d+82))) then
tmp = -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 ((a <= -1.55e+128) || !(a <= 1.08e+82)) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.55e+128) or not (a <= 1.08e+82): tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.55e+128) || !(a <= 1.08e+82)) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.55e+128) || ~((a <= 1.08e+82))) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.55e+128], N[Not[LessEqual[a, 1.08e+82]], $MachinePrecision]], (-a), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{+128} \lor \neg \left(a \leq 1.08 \cdot 10^{+82}\right):\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.55000000000000002e128 or 1.08e82 < a Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 48.5%
Taylor expanded in x around 0 40.1%
neg-mul-140.1%
Simplified40.1%
if -1.55000000000000002e128 < a < 1.08e82Initial program 97.3%
sub-neg97.3%
+-commutative97.3%
associate-/r/99.5%
distribute-rgt-neg-in99.5%
associate-*l/96.7%
associate-/l*97.3%
fma-define97.3%
distribute-frac-neg97.3%
distribute-neg-frac297.3%
distribute-neg-in97.3%
sub-neg97.3%
distribute-neg-in97.3%
remove-double-neg97.3%
+-commutative97.3%
sub-neg97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in a around 0 74.9%
Final simplification64.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 98.0%
sub-neg98.0%
+-commutative98.0%
associate-/r/99.6%
distribute-rgt-neg-in99.6%
associate-*l/88.6%
associate-/l*98.0%
fma-define98.0%
distribute-frac-neg98.0%
distribute-neg-frac298.0%
distribute-neg-in98.0%
sub-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
+-commutative98.0%
sub-neg98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in a around 0 58.3%
(FPCore (x y z t a) :precision binary64 a)
double code(double x, double y, double z, double t, double a) {
return 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 = a
end function
public static double code(double x, double y, double z, double t, double a) {
return a;
}
def code(x, y, z, t, a): return a
function code(x, y, z, t, a) return a end
function tmp = code(x, y, z, t, a) tmp = a; end
code[x_, y_, z_, t_, a_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 98.0%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in z around inf 66.8%
Taylor expanded in x around 0 18.8%
neg-mul-118.8%
Simplified18.8%
neg-sub018.8%
sub-neg18.8%
add-sqr-sqrt8.2%
sqrt-unprod9.4%
sqr-neg9.4%
sqrt-unprod1.6%
add-sqr-sqrt3.1%
Applied egg-rr3.1%
+-lft-identity3.1%
Simplified3.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 2024181
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (- x (* (/ (- y z) (+ (- t z) 1)) a)))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))