
(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 10 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 (/ (+ (- t z) 1.0) (- z y)))))
double code(double x, double y, double z, double t, double a) {
return x + (a / (((t - z) + 1.0) / (z - y)));
}
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 / (((t - z) + 1.0d0) / (z - y)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a / (((t - z) + 1.0) / (z - y)));
}
def code(x, y, z, t, a): return x + (a / (((t - z) + 1.0) / (z - y)))
function code(x, y, z, t, a) return Float64(x + Float64(a / Float64(Float64(Float64(t - z) + 1.0) / Float64(z - y)))) end
function tmp = code(x, y, z, t, a) tmp = x + (a / (((t - z) + 1.0) / (z - y))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{a}{\frac{\left(t - z\right) + 1}{z - y}}
\end{array}
Initial program 97.8%
associate-/r/99.8%
Simplified99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -26.0) (not (<= z 2.7e+47))) (- x (* a (/ (- z y) z))) (+ x (/ (- y z) (/ (- -1.0 t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -26.0) || !(z <= 2.7e+47)) {
tmp = x - (a * ((z - y) / z));
} else {
tmp = x + ((y - z) / ((-1.0 - t) / 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 <= (-26.0d0)) .or. (.not. (z <= 2.7d+47))) then
tmp = x - (a * ((z - y) / z))
else
tmp = x + ((y - z) / (((-1.0d0) - t) / 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 <= -26.0) || !(z <= 2.7e+47)) {
tmp = x - (a * ((z - y) / z));
} else {
tmp = x + ((y - z) / ((-1.0 - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -26.0) or not (z <= 2.7e+47): tmp = x - (a * ((z - y) / z)) else: tmp = x + ((y - z) / ((-1.0 - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -26.0) || !(z <= 2.7e+47)) tmp = Float64(x - Float64(a * Float64(Float64(z - y) / z))); else tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(-1.0 - t) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -26.0) || ~((z <= 2.7e+47))) tmp = x - (a * ((z - y) / z)); else tmp = x + ((y - z) / ((-1.0 - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -26.0], N[Not[LessEqual[z, 2.7e+47]], $MachinePrecision]], N[(x - N[(a * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(-1.0 - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -26 \lor \neg \left(z \leq 2.7 \cdot 10^{+47}\right):\\
\;\;\;\;x - a \cdot \frac{z - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - z}{\frac{-1 - t}{a}}\\
\end{array}
\end{array}
if z < -26 or 2.69999999999999996e47 < z Initial program 95.9%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around inf 92.7%
mul-1-neg92.7%
Simplified92.7%
if -26 < z < 2.69999999999999996e47Initial program 99.6%
Taylor expanded in z around 0 98.6%
Final simplification95.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -10.5) (not (<= z 2.7e+47))) (- x (* a (/ (- z y) z))) (+ x (/ a (/ (- -1.0 t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -10.5) || !(z <= 2.7e+47)) {
tmp = x - (a * ((z - y) / z));
} 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 <= (-10.5d0)) .or. (.not. (z <= 2.7d+47))) then
tmp = x - (a * ((z - y) / z))
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 <= -10.5) || !(z <= 2.7e+47)) {
tmp = x - (a * ((z - y) / z));
} else {
tmp = x + (a / ((-1.0 - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -10.5) or not (z <= 2.7e+47): tmp = x - (a * ((z - y) / z)) else: tmp = x + (a / ((-1.0 - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -10.5) || !(z <= 2.7e+47)) tmp = Float64(x - Float64(a * Float64(Float64(z - y) / z))); 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 <= -10.5) || ~((z <= 2.7e+47))) tmp = x - (a * ((z - y) / z)); else tmp = x + (a / ((-1.0 - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -10.5], N[Not[LessEqual[z, 2.7e+47]], $MachinePrecision]], N[(x - N[(a * N[(N[(z - y), $MachinePrecision] / z), $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 -10.5 \lor \neg \left(z \leq 2.7 \cdot 10^{+47}\right):\\
\;\;\;\;x - a \cdot \frac{z - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{\frac{-1 - t}{y}}\\
\end{array}
\end{array}
if z < -10.5 or 2.69999999999999996e47 < z Initial program 95.9%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around inf 92.7%
mul-1-neg92.7%
Simplified92.7%
if -10.5 < z < 2.69999999999999996e47Initial program 99.6%
associate-/r/99.8%
Simplified99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 92.6%
Final simplification92.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -18500000.0) (not (<= z 2.7e+47))) (- x a) (+ x (/ a (/ (- -1.0 t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -18500000.0) || !(z <= 2.7e+47)) {
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 <= (-18500000.0d0)) .or. (.not. (z <= 2.7d+47))) 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 <= -18500000.0) || !(z <= 2.7e+47)) {
tmp = x - a;
} else {
tmp = x + (a / ((-1.0 - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -18500000.0) or not (z <= 2.7e+47): 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 <= -18500000.0) || !(z <= 2.7e+47)) 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 <= -18500000.0) || ~((z <= 2.7e+47))) 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, -18500000.0], N[Not[LessEqual[z, 2.7e+47]], $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 -18500000 \lor \neg \left(z \leq 2.7 \cdot 10^{+47}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{\frac{-1 - t}{y}}\\
\end{array}
\end{array}
if z < -1.85e7 or 2.69999999999999996e47 < z Initial program 95.9%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around inf 81.1%
if -1.85e7 < z < 2.69999999999999996e47Initial program 99.6%
associate-/r/99.8%
Simplified99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 92.0%
Final simplification86.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -70000000.0) (not (<= z 8e+47))) (- x a) (+ x (* a (/ (- z y) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -70000000.0) || !(z <= 8e+47)) {
tmp = x - a;
} else {
tmp = x + (a * ((z - y) / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-70000000.0d0)) .or. (.not. (z <= 8d+47))) then
tmp = x - a
else
tmp = x + (a * ((z - y) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -70000000.0) || !(z <= 8e+47)) {
tmp = x - a;
} else {
tmp = x + (a * ((z - y) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -70000000.0) or not (z <= 8e+47): tmp = x - a else: tmp = x + (a * ((z - y) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -70000000.0) || !(z <= 8e+47)) tmp = Float64(x - a); else tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -70000000.0) || ~((z <= 8e+47))) tmp = x - a; else tmp = x + (a * ((z - y) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -70000000.0], N[Not[LessEqual[z, 8e+47]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -70000000 \lor \neg \left(z \leq 8 \cdot 10^{+47}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\end{array}
\end{array}
if z < -7e7 or 8.0000000000000004e47 < z Initial program 95.9%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around inf 81.1%
if -7e7 < z < 8.0000000000000004e47Initial program 99.6%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 65.3%
Final simplification72.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -11200000.0) (not (<= z 3e+47))) (- x a) (- x (* a (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -11200000.0) || !(z <= 3e+47)) {
tmp = x - a;
} else {
tmp = x - (a * (y / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-11200000.0d0)) .or. (.not. (z <= 3d+47))) then
tmp = x - a
else
tmp = x - (a * (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -11200000.0) || !(z <= 3e+47)) {
tmp = x - a;
} else {
tmp = x - (a * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -11200000.0) or not (z <= 3e+47): tmp = x - a else: tmp = x - (a * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -11200000.0) || !(z <= 3e+47)) tmp = Float64(x - a); else tmp = Float64(x - Float64(a * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -11200000.0) || ~((z <= 3e+47))) tmp = x - a; else tmp = x - (a * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -11200000.0], N[Not[LessEqual[z, 3e+47]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -11200000 \lor \neg \left(z \leq 3 \cdot 10^{+47}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -1.12e7 or 3.0000000000000001e47 < z Initial program 95.9%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around inf 81.1%
if -1.12e7 < z < 3.0000000000000001e47Initial program 99.6%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 60.6%
Taylor expanded in y around inf 60.6%
associate-/l*64.6%
Simplified64.6%
Final simplification72.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -21.0) (not (<= z 1.95e+49))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -21.0) || !(z <= 1.95e+49)) {
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 <= (-21.0d0)) .or. (.not. (z <= 1.95d+49))) 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 <= -21.0) || !(z <= 1.95e+49)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -21.0) or not (z <= 1.95e+49): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -21.0) || !(z <= 1.95e+49)) 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 <= -21.0) || ~((z <= 1.95e+49))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -21.0], N[Not[LessEqual[z, 1.95e+49]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -21 \lor \neg \left(z \leq 1.95 \cdot 10^{+49}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -21 or 1.95e49 < z Initial program 95.9%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around inf 80.7%
if -21 < z < 1.95e49Initial program 99.6%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in x around inf 52.7%
Final simplification66.1%
(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.8%
associate-/r/99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -2.6e-68) x (if (<= x 6e-263) (- a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.6e-68) {
tmp = x;
} else if (x <= 6e-263) {
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 <= (-2.6d-68)) then
tmp = x
else if (x <= 6d-263) 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 <= -2.6e-68) {
tmp = x;
} else if (x <= 6e-263) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.6e-68: tmp = x elif x <= 6e-263: tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.6e-68) tmp = x; elseif (x <= 6e-263) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.6e-68) tmp = x; elseif (x <= 6e-263) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.6e-68], x, If[LessEqual[x, 6e-263], (-a), x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-68}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-263}:\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.5999999999999998e-68 or 6.0000000000000001e-263 < x Initial program 99.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 60.1%
if -2.5999999999999998e-68 < x < 6.0000000000000001e-263Initial program 93.2%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in x around 0 62.7%
mul-1-neg62.7%
associate--l+62.7%
+-commutative62.7%
associate-*l/78.8%
*-commutative78.8%
distribute-rgt-neg-out78.8%
distribute-neg-frac278.8%
associate-+l-78.8%
sub-neg78.8%
metadata-eval78.8%
+-commutative78.8%
Simplified78.8%
Taylor expanded in z around inf 41.5%
neg-mul-141.5%
Simplified41.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.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in x around inf 49.2%
(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 2024087
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))