
(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 97.6%
associate-/r/98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6e+63) (not (<= z 2600000.0))) (+ x (/ (- y z) (/ z a))) (+ x (/ a (/ (- -1.0 t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6e+63) || !(z <= 2600000.0)) {
tmp = x + ((y - z) / (z / a));
} else {
tmp = x + (a / ((-1.0 - t) / y));
}
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+63)) .or. (.not. (z <= 2600000.0d0))) then
tmp = x + ((y - z) / (z / a))
else
tmp = x + (a / (((-1.0d0) - t) / y))
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+63) || !(z <= 2600000.0)) {
tmp = x + ((y - z) / (z / a));
} else {
tmp = x + (a / ((-1.0 - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6e+63) or not (z <= 2600000.0): tmp = x + ((y - z) / (z / a)) else: tmp = x + (a / ((-1.0 - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6e+63) || !(z <= 2600000.0)) tmp = Float64(x + Float64(Float64(y - z) / Float64(z / a))); else tmp = Float64(x + Float64(a / Float64(Float64(-1.0 - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6e+63) || ~((z <= 2600000.0))) tmp = x + ((y - z) / (z / a)); else tmp = x + (a / ((-1.0 - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6e+63], N[Not[LessEqual[z, 2600000.0]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a / N[(N[(-1.0 - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+63} \lor \neg \left(z \leq 2600000\right):\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{\frac{-1 - t}{y}}\\
\end{array}
\end{array}
if z < -5.99999999999999998e63 or 2.6e6 < z Initial program 95.2%
Taylor expanded in z around inf 84.7%
associate-*r/84.7%
neg-mul-184.7%
Simplified84.7%
if -5.99999999999999998e63 < z < 2.6e6Initial program 99.2%
associate-/r/98.1%
Simplified98.1%
*-commutative98.1%
clear-num98.0%
un-div-inv98.0%
Applied egg-rr98.0%
Taylor expanded in z around 0 90.6%
Final simplification88.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.3e+48) (not (<= z 3.3e+18))) (- x a) (+ x (/ a (/ (- -1.0 t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e+48) || !(z <= 3.3e+18)) {
tmp = x - a;
} else {
tmp = x + (a / ((-1.0 - t) / y));
}
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 <= (-4.3d+48)) .or. (.not. (z <= 3.3d+18))) then
tmp = x - a
else
tmp = x + (a / (((-1.0d0) - t) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e+48) || !(z <= 3.3e+18)) {
tmp = x - a;
} else {
tmp = x + (a / ((-1.0 - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.3e+48) or not (z <= 3.3e+18): tmp = x - a else: tmp = x + (a / ((-1.0 - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.3e+48) || !(z <= 3.3e+18)) tmp = Float64(x - a); else tmp = Float64(x + Float64(a / Float64(Float64(-1.0 - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.3e+48) || ~((z <= 3.3e+18))) tmp = x - a; else tmp = x + (a / ((-1.0 - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.3e+48], N[Not[LessEqual[z, 3.3e+18]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(a / N[(N[(-1.0 - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+48} \lor \neg \left(z \leq 3.3 \cdot 10^{+18}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{\frac{-1 - t}{y}}\\
\end{array}
\end{array}
if z < -4.29999999999999978e48 or 3.3e18 < z Initial program 95.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 82.2%
if -4.29999999999999978e48 < z < 3.3e18Initial program 99.2%
associate-/r/98.1%
Simplified98.1%
*-commutative98.1%
clear-num98.0%
un-div-inv98.0%
Applied egg-rr98.0%
Taylor expanded in z around 0 90.5%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -300000000000.0) (not (<= t 6.5))) (+ x (* a (/ (- z y) t))) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -300000000000.0) || !(t <= 6.5)) {
tmp = x + (a * ((z - y) / t));
} 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 ((t <= (-300000000000.0d0)) .or. (.not. (t <= 6.5d0))) then
tmp = x + (a * ((z - y) / t))
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 ((t <= -300000000000.0) || !(t <= 6.5)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -300000000000.0) or not (t <= 6.5): tmp = x + (a * ((z - y) / t)) else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -300000000000.0) || !(t <= 6.5)) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); else tmp = Float64(x - Float64(y * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -300000000000.0) || ~((t <= 6.5))) tmp = x + (a * ((z - y) / t)); else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -300000000000.0], N[Not[LessEqual[t, 6.5]], $MachinePrecision]], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -300000000000 \lor \neg \left(t \leq 6.5\right):\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if t < -3e11 or 6.5 < t Initial program 96.9%
associate-/r/97.7%
Simplified97.7%
Taylor expanded in t around inf 86.3%
if -3e11 < t < 6.5Initial program 98.4%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 72.0%
Taylor expanded in t around 0 70.8%
Final simplification78.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -500000000000.0) (not (<= t 1.0))) (- x (/ y (/ t a))) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -500000000000.0) || !(t <= 1.0)) {
tmp = x - (y / (t / 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 ((t <= (-500000000000.0d0)) .or. (.not. (t <= 1.0d0))) then
tmp = x - (y / (t / 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 ((t <= -500000000000.0) || !(t <= 1.0)) {
tmp = x - (y / (t / a));
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -500000000000.0) or not (t <= 1.0): tmp = x - (y / (t / a)) else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -500000000000.0) || !(t <= 1.0)) tmp = Float64(x - Float64(y / Float64(t / 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 ((t <= -500000000000.0) || ~((t <= 1.0))) tmp = x - (y / (t / a)); else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -500000000000.0], N[Not[LessEqual[t, 1.0]], $MachinePrecision]], N[(x - N[(y / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -500000000000 \lor \neg \left(t \leq 1\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{a}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if t < -5e11 or 1 < t Initial program 96.9%
Taylor expanded in t around inf 87.7%
Taylor expanded in y around inf 81.9%
if -5e11 < t < 1Initial program 98.4%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 72.0%
Taylor expanded in t around 0 70.8%
Final simplification76.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1e+37) (not (<= z 1.4e+18))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e+37) || !(z <= 1.4e+18)) {
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 <= (-1d+37)) .or. (.not. (z <= 1.4d+18))) 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 <= -1e+37) || !(z <= 1.4e+18)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1e+37) or not (z <= 1.4e+18): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1e+37) || !(z <= 1.4e+18)) 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 <= -1e+37) || ~((z <= 1.4e+18))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1e+37], N[Not[LessEqual[z, 1.4e+18]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+37} \lor \neg \left(z \leq 1.4 \cdot 10^{+18}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -9.99999999999999954e36 or 1.4e18 < z Initial program 95.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.8%
if -9.99999999999999954e36 < z < 1.4e18Initial program 99.2%
associate-/r/98.1%
Simplified98.1%
*-commutative98.1%
clear-num98.0%
un-div-inv98.0%
Applied egg-rr98.0%
Taylor expanded in z around 0 90.3%
Taylor expanded in t around 0 66.2%
Final simplification72.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e+45) (not (<= z 7.2e+18))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e+45) || !(z <= 7.2e+18)) {
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 <= (-9d+45)) .or. (.not. (z <= 7.2d+18))) 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 <= -9e+45) || !(z <= 7.2e+18)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e+45) or not (z <= 7.2e+18): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e+45) || !(z <= 7.2e+18)) 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 <= -9e+45) || ~((z <= 7.2e+18))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e+45], N[Not[LessEqual[z, 7.2e+18]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+45} \lor \neg \left(z \leq 7.2 \cdot 10^{+18}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.9999999999999997e45 or 7.2e18 < z Initial program 95.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 82.2%
if -8.9999999999999997e45 < z < 7.2e18Initial program 99.2%
sub-neg99.2%
+-commutative99.2%
associate-/r/98.1%
distribute-rgt-neg-in98.1%
associate-*l/96.3%
associate-/l*99.3%
fma-define99.3%
distribute-frac-neg99.3%
distribute-neg-frac299.3%
distribute-neg-in99.3%
sub-neg99.3%
distribute-neg-in99.3%
remove-double-neg99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in a around 0 57.7%
Final simplification67.5%
(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 97.6%
clear-num97.5%
associate-/r/97.6%
clear-num97.7%
Applied egg-rr97.7%
Final simplification97.7%
(FPCore (x y z t a) :precision binary64 (if (<= x -6.5e-146) x (if (<= x 5.5e-189) (- a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6.5e-146) {
tmp = x;
} else if (x <= 5.5e-189) {
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 (x <= (-6.5d-146)) then
tmp = x
else if (x <= 5.5d-189) 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 (x <= -6.5e-146) {
tmp = x;
} else if (x <= 5.5e-189) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -6.5e-146: tmp = x elif x <= 5.5e-189: tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -6.5e-146) tmp = x; elseif (x <= 5.5e-189) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -6.5e-146) tmp = x; elseif (x <= 5.5e-189) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -6.5e-146], x, If[LessEqual[x, 5.5e-189], (-a), x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-146}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-189}:\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.4999999999999999e-146 or 5.4999999999999999e-189 < x Initial program 99.0%
sub-neg99.0%
+-commutative99.0%
associate-/r/99.5%
distribute-rgt-neg-in99.5%
associate-*l/87.0%
associate-/l*99.0%
fma-define99.0%
distribute-frac-neg99.0%
distribute-neg-frac299.0%
distribute-neg-in99.0%
sub-neg99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in a around 0 68.7%
if -6.4999999999999999e-146 < x < 5.4999999999999999e-189Initial program 92.3%
sub-neg92.3%
+-commutative92.3%
associate-/r/96.1%
distribute-rgt-neg-in96.1%
associate-*l/83.2%
associate-/l*92.6%
fma-define92.6%
distribute-frac-neg92.6%
distribute-neg-frac292.6%
distribute-neg-in92.6%
sub-neg92.6%
distribute-neg-in92.6%
remove-double-neg92.6%
+-commutative92.6%
sub-neg92.6%
metadata-eval92.6%
Simplified92.6%
Taylor expanded in a around -inf 75.9%
Taylor expanded in z around inf 27.5%
neg-mul-127.5%
Simplified27.5%
(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 97.6%
sub-neg97.6%
+-commutative97.6%
associate-/r/98.8%
distribute-rgt-neg-in98.8%
associate-*l/86.3%
associate-/l*97.7%
fma-define97.7%
distribute-frac-neg97.7%
distribute-neg-frac297.7%
distribute-neg-in97.7%
sub-neg97.7%
distribute-neg-in97.7%
remove-double-neg97.7%
+-commutative97.7%
sub-neg97.7%
metadata-eval97.7%
Simplified97.7%
Taylor expanded in a around 0 57.1%
(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 97.6%
sub-neg97.6%
+-commutative97.6%
associate-/r/98.8%
distribute-rgt-neg-in98.8%
associate-*l/86.3%
associate-/l*97.7%
fma-define97.7%
distribute-frac-neg97.7%
distribute-neg-frac297.7%
distribute-neg-in97.7%
sub-neg97.7%
distribute-neg-in97.7%
remove-double-neg97.7%
+-commutative97.7%
sub-neg97.7%
metadata-eval97.7%
Simplified97.7%
Taylor expanded in a around -inf 34.4%
Taylor expanded in z around inf 14.0%
neg-mul-114.0%
Simplified14.0%
neg-sub014.0%
sub-neg14.0%
add-sqr-sqrt7.1%
sqrt-unprod7.5%
sqr-neg7.5%
sqrt-unprod1.8%
add-sqr-sqrt3.4%
Applied egg-rr3.4%
+-lft-identity3.4%
Simplified3.4%
(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 2024170
(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))))