
(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 96.9%
associate-/r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ a t) (- z y)))))
(if (<= t -1450.0)
t_1
(if (<= t -7.4e-300) (- x a) (if (<= t 2.5e+36) (- x (* y a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((a / t) * (z - y));
double tmp;
if (t <= -1450.0) {
tmp = t_1;
} else if (t <= -7.4e-300) {
tmp = x - a;
} else if (t <= 2.5e+36) {
tmp = x - (y * a);
} else {
tmp = 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 = x + ((a / t) * (z - y))
if (t <= (-1450.0d0)) then
tmp = t_1
else if (t <= (-7.4d-300)) then
tmp = x - a
else if (t <= 2.5d+36) then
tmp = x - (y * a)
else
tmp = 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 = x + ((a / t) * (z - y));
double tmp;
if (t <= -1450.0) {
tmp = t_1;
} else if (t <= -7.4e-300) {
tmp = x - a;
} else if (t <= 2.5e+36) {
tmp = x - (y * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((a / t) * (z - y)) tmp = 0 if t <= -1450.0: tmp = t_1 elif t <= -7.4e-300: tmp = x - a elif t <= 2.5e+36: tmp = x - (y * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(a / t) * Float64(z - y))) tmp = 0.0 if (t <= -1450.0) tmp = t_1; elseif (t <= -7.4e-300) tmp = Float64(x - a); elseif (t <= 2.5e+36) tmp = Float64(x - Float64(y * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((a / t) * (z - y)); tmp = 0.0; if (t <= -1450.0) tmp = t_1; elseif (t <= -7.4e-300) tmp = x - a; elseif (t <= 2.5e+36) tmp = x - (y * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(a / t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1450.0], t$95$1, If[LessEqual[t, -7.4e-300], N[(x - a), $MachinePrecision], If[LessEqual[t, 2.5e+36], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{a}{t} \cdot \left(z - y\right)\\
\mathbf{if}\;t \leq -1450:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -7.4 \cdot 10^{-300}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+36}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1450 or 2.49999999999999988e36 < t Initial program 99.1%
clear-num99.0%
associate-/r/98.9%
clear-num99.0%
Applied egg-rr99.0%
Taylor expanded in t around inf 86.8%
if -1450 < t < -7.4000000000000003e-300Initial program 92.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 66.4%
if -7.4000000000000003e-300 < t < 2.49999999999999988e36Initial program 97.3%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around 0 70.7%
Taylor expanded in t around 0 70.7%
Final simplification76.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6500000000000.0) (not (<= z 3.0))) (+ x (* a (+ -1.0 (/ (+ y -1.0) z)))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6500000000000.0) || !(z <= 3.0)) {
tmp = x + (a * (-1.0 + ((y + -1.0) / 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 <= (-6500000000000.0d0)) .or. (.not. (z <= 3.0d0))) then
tmp = x + (a * ((-1.0d0) + ((y + (-1.0d0)) / 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 <= -6500000000000.0) || !(z <= 3.0)) {
tmp = x + (a * (-1.0 + ((y + -1.0) / z)));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6500000000000.0) or not (z <= 3.0): tmp = x + (a * (-1.0 + ((y + -1.0) / z))) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6500000000000.0) || !(z <= 3.0)) tmp = Float64(x + Float64(a * Float64(-1.0 + Float64(Float64(y + -1.0) / 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 <= -6500000000000.0) || ~((z <= 3.0))) tmp = x + (a * (-1.0 + ((y + -1.0) / z))); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6500000000000.0], N[Not[LessEqual[z, 3.0]], $MachinePrecision]], N[(x + N[(a * N[(-1.0 + N[(N[(y + -1.0), $MachinePrecision] / z), $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 -6500000000000 \lor \neg \left(z \leq 3\right):\\
\;\;\;\;x + a \cdot \left(-1 + \frac{y + -1}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -6.5e12 or 3 < z Initial program 93.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 84.8%
Taylor expanded in z around inf 84.3%
+-commutative84.3%
mul-1-neg84.3%
sub-neg84.3%
div-sub84.3%
sub-neg84.3%
+-commutative84.3%
neg-mul-184.3%
metadata-eval84.3%
distribute-lft-in84.3%
metadata-eval84.3%
sub-neg84.3%
associate-*r/84.3%
mul-1-neg84.3%
unsub-neg84.3%
sub-neg84.3%
metadata-eval84.3%
Simplified84.3%
if -6.5e12 < z < 3Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 88.3%
Final simplification86.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -155000000000.0)
(+ x (* a (+ -1.0 (/ (+ y -1.0) z))))
(if (<= z 1.16e-32)
(+ x (* a (/ y (- -1.0 t))))
(+ x (* a (/ z (+ (- t z) 1.0)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -155000000000.0) {
tmp = x + (a * (-1.0 + ((y + -1.0) / z)));
} else if (z <= 1.16e-32) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + (a * (z / ((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 <= (-155000000000.0d0)) then
tmp = x + (a * ((-1.0d0) + ((y + (-1.0d0)) / z)))
else if (z <= 1.16d-32) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x + (a * (z / ((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 <= -155000000000.0) {
tmp = x + (a * (-1.0 + ((y + -1.0) / z)));
} else if (z <= 1.16e-32) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + (a * (z / ((t - z) + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -155000000000.0: tmp = x + (a * (-1.0 + ((y + -1.0) / z))) elif z <= 1.16e-32: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x + (a * (z / ((t - z) + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -155000000000.0) tmp = Float64(x + Float64(a * Float64(-1.0 + Float64(Float64(y + -1.0) / z)))); elseif (z <= 1.16e-32) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x + Float64(a * Float64(z / Float64(Float64(t - z) + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -155000000000.0) tmp = x + (a * (-1.0 + ((y + -1.0) / z))); elseif (z <= 1.16e-32) tmp = x + (a * (y / (-1.0 - t))); else tmp = x + (a * (z / ((t - z) + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -155000000000.0], N[(x + N[(a * N[(-1.0 + N[(N[(y + -1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.16e-32], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(z / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -155000000000:\\
\;\;\;\;x + a \cdot \left(-1 + \frac{y + -1}{z}\right)\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-32}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z}{\left(t - z\right) + 1}\\
\end{array}
\end{array}
if z < -1.55e11Initial program 96.5%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around 0 86.8%
Taylor expanded in z around inf 86.8%
+-commutative86.8%
mul-1-neg86.8%
sub-neg86.8%
div-sub86.8%
sub-neg86.8%
+-commutative86.8%
neg-mul-186.8%
metadata-eval86.8%
distribute-lft-in86.8%
metadata-eval86.8%
sub-neg86.8%
associate-*r/86.8%
mul-1-neg86.8%
unsub-neg86.8%
sub-neg86.8%
metadata-eval86.8%
Simplified86.8%
if -1.55e11 < z < 1.16000000000000001e-32Initial program 99.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 89.5%
if 1.16000000000000001e-32 < z Initial program 93.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 83.6%
mul-1-neg83.6%
associate--l+83.6%
+-commutative83.6%
distribute-neg-frac283.6%
+-commutative83.6%
distribute-neg-in83.6%
metadata-eval83.6%
unsub-neg83.6%
Simplified83.6%
Final simplification87.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2400.0)
(+ x (* (/ a t) (- z y)))
(if (<= t 8e+56)
(+ x (* a (/ (- y z) (+ z -1.0))))
(+ x (/ (- z y) (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2400.0) {
tmp = x + ((a / t) * (z - y));
} else if (t <= 8e+56) {
tmp = x + (a * ((y - z) / (z + -1.0)));
} else {
tmp = x + ((z - y) / (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 (t <= (-2400.0d0)) then
tmp = x + ((a / t) * (z - y))
else if (t <= 8d+56) then
tmp = x + (a * ((y - z) / (z + (-1.0d0))))
else
tmp = x + ((z - y) / (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 (t <= -2400.0) {
tmp = x + ((a / t) * (z - y));
} else if (t <= 8e+56) {
tmp = x + (a * ((y - z) / (z + -1.0)));
} else {
tmp = x + ((z - y) / (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2400.0: tmp = x + ((a / t) * (z - y)) elif t <= 8e+56: tmp = x + (a * ((y - z) / (z + -1.0))) else: tmp = x + ((z - y) / (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2400.0) tmp = Float64(x + Float64(Float64(a / t) * Float64(z - y))); elseif (t <= 8e+56) tmp = Float64(x + Float64(a * Float64(Float64(y - z) / Float64(z + -1.0)))); else tmp = Float64(x + Float64(Float64(z - y) / Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2400.0) tmp = x + ((a / t) * (z - y)); elseif (t <= 8e+56) tmp = x + (a * ((y - z) / (z + -1.0))); else tmp = x + ((z - y) / (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2400.0], N[(x + N[(N[(a / t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8e+56], N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - y), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2400:\\
\;\;\;\;x + \frac{a}{t} \cdot \left(z - y\right)\\
\mathbf{elif}\;t \leq 8 \cdot 10^{+56}:\\
\;\;\;\;x + a \cdot \frac{y - z}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{t}{a}}\\
\end{array}
\end{array}
if t < -2400Initial program 98.4%
clear-num98.3%
associate-/r/98.3%
clear-num98.3%
Applied egg-rr98.3%
Taylor expanded in t around inf 83.2%
if -2400 < t < 8.00000000000000074e56Initial program 95.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 99.2%
if 8.00000000000000074e56 < t Initial program 99.9%
Taylor expanded in t around inf 92.8%
Final simplification94.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.4e+126) (not (<= z 3.3e+115))) (- x a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.4e+126) || !(z <= 3.3e+115)) {
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 <= (-1.4d+126)) .or. (.not. (z <= 3.3d+115))) 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 <= -1.4e+126) || !(z <= 3.3e+115)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.4e+126) or not (z <= 3.3e+115): 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 <= -1.4e+126) || !(z <= 3.3e+115)) 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 <= -1.4e+126) || ~((z <= 3.3e+115))) 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, -1.4e+126], N[Not[LessEqual[z, 3.3e+115]], $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 -1.4 \cdot 10^{+126} \lor \neg \left(z \leq 3.3 \cdot 10^{+115}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -1.40000000000000005e126 or 3.30000000000000005e115 < z Initial program 89.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 86.1%
if -1.40000000000000005e126 < z < 3.30000000000000005e115Initial program 99.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 79.6%
Final simplification81.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.1e+21) (- x (* (/ a z) (- z y))) (if (<= z 2.4e+118) (+ x (* a (/ y (- -1.0 t)))) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e+21) {
tmp = x - ((a / z) * (z - y));
} else if (z <= 2.4e+118) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x - a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.1d+21)) then
tmp = x - ((a / z) * (z - y))
else if (z <= 2.4d+118) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e+21) {
tmp = x - ((a / z) * (z - y));
} else if (z <= 2.4e+118) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.1e+21: tmp = x - ((a / z) * (z - y)) elif z <= 2.4e+118: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.1e+21) tmp = Float64(x - Float64(Float64(a / z) * Float64(z - y))); elseif (z <= 2.4e+118) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.1e+21) tmp = x - ((a / z) * (z - y)); elseif (z <= 2.4e+118) tmp = x + (a * (y / (-1.0 - t))); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.1e+21], N[(x - N[(N[(a / z), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+118], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+21}:\\
\;\;\;\;x - \frac{a}{z} \cdot \left(z - y\right)\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+118}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -2.1e21Initial program 96.3%
clear-num96.2%
associate-/r/96.3%
clear-num96.5%
Applied egg-rr96.5%
Taylor expanded in z around inf 84.7%
mul-1-neg84.7%
distribute-neg-frac284.7%
Simplified84.7%
if -2.1e21 < z < 2.4e118Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 82.1%
if 2.4e118 < z Initial program 81.6%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around inf 89.7%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (<= z 1.7e+121) (+ x (* (/ a (+ (- t z) 1.0)) (- z y))) (+ x (* a (+ -1.0 (/ (+ y -1.0) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.7e+121) {
tmp = x + ((a / ((t - z) + 1.0)) * (z - y));
} else {
tmp = x + (a * (-1.0 + ((y + -1.0) / 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.7d+121) then
tmp = x + ((a / ((t - z) + 1.0d0)) * (z - y))
else
tmp = x + (a * ((-1.0d0) + ((y + (-1.0d0)) / 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.7e+121) {
tmp = x + ((a / ((t - z) + 1.0)) * (z - y));
} else {
tmp = x + (a * (-1.0 + ((y + -1.0) / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 1.7e+121: tmp = x + ((a / ((t - z) + 1.0)) * (z - y)) else: tmp = x + (a * (-1.0 + ((y + -1.0) / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.7e+121) tmp = Float64(x + Float64(Float64(a / Float64(Float64(t - z) + 1.0)) * Float64(z - y))); else tmp = Float64(x + Float64(a * Float64(-1.0 + Float64(Float64(y + -1.0) / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 1.7e+121) tmp = x + ((a / ((t - z) + 1.0)) * (z - y)); else tmp = x + (a * (-1.0 + ((y + -1.0) / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 1.7e+121], N[(x + N[(N[(a / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(-1.0 + N[(N[(y + -1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.7 \cdot 10^{+121}:\\
\;\;\;\;x + \frac{a}{\left(t - z\right) + 1} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(-1 + \frac{y + -1}{z}\right)\\
\end{array}
\end{array}
if z < 1.70000000000000005e121Initial program 99.0%
clear-num98.9%
associate-/r/98.9%
clear-num99.0%
Applied egg-rr99.0%
if 1.70000000000000005e121 < z Initial program 81.6%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around 0 98.9%
Taylor expanded in z around inf 98.9%
+-commutative98.9%
mul-1-neg98.9%
sub-neg98.9%
div-sub98.9%
sub-neg98.9%
+-commutative98.9%
neg-mul-198.9%
metadata-eval98.9%
distribute-lft-in98.9%
metadata-eval98.9%
sub-neg98.9%
associate-*r/98.9%
mul-1-neg98.9%
unsub-neg98.9%
sub-neg98.9%
metadata-eval98.9%
Simplified98.9%
Final simplification99.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.4e-6) (not (<= z 1.6))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e-6) || !(z <= 1.6)) {
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 <= (-2.4d-6)) .or. (.not. (z <= 1.6d0))) 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 <= -2.4e-6) || !(z <= 1.6)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.4e-6) or not (z <= 1.6): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.4e-6) || !(z <= 1.6)) 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 <= -2.4e-6) || ~((z <= 1.6))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.4e-6], N[Not[LessEqual[z, 1.6]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-6} \lor \neg \left(z \leq 1.6\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -2.3999999999999999e-6 or 1.6000000000000001 < z Initial program 94.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 71.4%
if -2.3999999999999999e-6 < z < 1.6000000000000001Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 89.2%
Taylor expanded in t around 0 71.3%
Final simplification71.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.3e+21) (not (<= z 7.2e-7))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.3e+21) || !(z <= 7.2e-7)) {
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.3d+21)) .or. (.not. (z <= 7.2d-7))) 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.3e+21) || !(z <= 7.2e-7)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.3e+21) or not (z <= 7.2e-7): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.3e+21) || !(z <= 7.2e-7)) 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.3e+21) || ~((z <= 7.2e-7))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.3e+21], N[Not[LessEqual[z, 7.2e-7]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+21} \lor \neg \left(z \leq 7.2 \cdot 10^{-7}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.3e21 or 7.19999999999999989e-7 < z Initial program 94.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 73.5%
if -1.3e21 < z < 7.19999999999999989e-7Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
associate-/r/99.9%
distribute-rgt-neg-in99.9%
associate-*l/97.7%
associate-/l*99.9%
fma-define99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
distribute-neg-in99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around 0 52.9%
Final simplification63.4%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.9%
sub-neg96.9%
+-commutative96.9%
associate-/r/99.9%
distribute-rgt-neg-in99.9%
associate-*l/87.5%
associate-/l*96.9%
fma-define96.9%
distribute-frac-neg96.9%
distribute-neg-frac296.9%
distribute-neg-in96.9%
sub-neg96.9%
distribute-neg-in96.9%
remove-double-neg96.9%
+-commutative96.9%
sub-neg96.9%
metadata-eval96.9%
Simplified96.9%
Taylor expanded in a around 0 50.0%
Final simplification50.0%
(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 2024115
(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))))