
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* a (/ (- z y) (+ (- t z) 1.0)))))
double code(double x, double y, double z, double t, double a) {
return x + (a * ((z - y) / ((t - z) + 1.0)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (a * ((z - y) / ((t - z) + 1.0d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a * ((z - y) / ((t - z) + 1.0)));
}
def code(x, y, z, t, a): return x + (a * ((z - y) / ((t - z) + 1.0)))
function code(x, y, z, t, a) return Float64(x + Float64(a * Float64(Float64(z - y) / Float64(Float64(t - z) + 1.0)))) end
function tmp = code(x, y, z, t, a) tmp = x + (a * ((z - y) / ((t - z) + 1.0))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \frac{z - y}{\left(t - z\right) + 1}
\end{array}
Initial program 96.9%
associate-/r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ z (/ t a)))))
(if (<= z -4.8e+142)
(- x a)
(if (<= z -2.05e+82)
t_1
(if (<= z -2.5e+61)
(- x a)
(if (<= z 1.76e-90) x (if (<= z 2.25e+170) t_1 (- x a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z / (t / a));
double tmp;
if (z <= -4.8e+142) {
tmp = x - a;
} else if (z <= -2.05e+82) {
tmp = t_1;
} else if (z <= -2.5e+61) {
tmp = x - a;
} else if (z <= 1.76e-90) {
tmp = x;
} else if (z <= 2.25e+170) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (z / (t / a))
if (z <= (-4.8d+142)) then
tmp = x - a
else if (z <= (-2.05d+82)) then
tmp = t_1
else if (z <= (-2.5d+61)) then
tmp = x - a
else if (z <= 1.76d-90) then
tmp = x
else if (z <= 2.25d+170) then
tmp = t_1
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 t_1 = x + (z / (t / a));
double tmp;
if (z <= -4.8e+142) {
tmp = x - a;
} else if (z <= -2.05e+82) {
tmp = t_1;
} else if (z <= -2.5e+61) {
tmp = x - a;
} else if (z <= 1.76e-90) {
tmp = x;
} else if (z <= 2.25e+170) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z / (t / a)) tmp = 0 if z <= -4.8e+142: tmp = x - a elif z <= -2.05e+82: tmp = t_1 elif z <= -2.5e+61: tmp = x - a elif z <= 1.76e-90: tmp = x elif z <= 2.25e+170: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z / Float64(t / a))) tmp = 0.0 if (z <= -4.8e+142) tmp = Float64(x - a); elseif (z <= -2.05e+82) tmp = t_1; elseif (z <= -2.5e+61) tmp = Float64(x - a); elseif (z <= 1.76e-90) tmp = x; elseif (z <= 2.25e+170) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z / (t / a)); tmp = 0.0; if (z <= -4.8e+142) tmp = x - a; elseif (z <= -2.05e+82) tmp = t_1; elseif (z <= -2.5e+61) tmp = x - a; elseif (z <= 1.76e-90) tmp = x; elseif (z <= 2.25e+170) tmp = t_1; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+142], N[(x - a), $MachinePrecision], If[LessEqual[z, -2.05e+82], t$95$1, If[LessEqual[z, -2.5e+61], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.76e-90], x, If[LessEqual[z, 2.25e+170], t$95$1, N[(x - a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{\frac{t}{a}}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+142}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{+61}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.76 \cdot 10^{-90}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.7999999999999998e142 or -2.04999999999999998e82 < z < -2.50000000000000009e61 or 2.25000000000000011e170 < z Initial program 91.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 86.8%
if -4.7999999999999998e142 < z < -2.04999999999999998e82 or 1.7600000000000001e-90 < z < 2.25000000000000011e170Initial program 99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 63.2%
associate-/l*67.0%
Simplified67.0%
Taylor expanded in y around 0 69.2%
mul-1-neg69.2%
Simplified69.2%
Taylor expanded in x around 0 65.4%
associate-/l*69.2%
associate-/r/70.6%
Simplified70.6%
*-commutative70.6%
clear-num72.2%
div-inv72.2%
Applied egg-rr72.2%
if -2.50000000000000009e61 < z < 1.7600000000000001e-90Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 58.8%
Final simplification71.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ z (/ t a)))))
(if (<= z -4.8e+142)
(- x a)
(if (<= z -2.35e+82)
t_1
(if (<= z -1.42e+59)
(- x a)
(if (<= z 4e-89)
(- x (* y (/ a t)))
(if (<= z 2.25e+170) t_1 (- x a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z / (t / a));
double tmp;
if (z <= -4.8e+142) {
tmp = x - a;
} else if (z <= -2.35e+82) {
tmp = t_1;
} else if (z <= -1.42e+59) {
tmp = x - a;
} else if (z <= 4e-89) {
tmp = x - (y * (a / t));
} else if (z <= 2.25e+170) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (z / (t / a))
if (z <= (-4.8d+142)) then
tmp = x - a
else if (z <= (-2.35d+82)) then
tmp = t_1
else if (z <= (-1.42d+59)) then
tmp = x - a
else if (z <= 4d-89) then
tmp = x - (y * (a / t))
else if (z <= 2.25d+170) then
tmp = t_1
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 t_1 = x + (z / (t / a));
double tmp;
if (z <= -4.8e+142) {
tmp = x - a;
} else if (z <= -2.35e+82) {
tmp = t_1;
} else if (z <= -1.42e+59) {
tmp = x - a;
} else if (z <= 4e-89) {
tmp = x - (y * (a / t));
} else if (z <= 2.25e+170) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z / (t / a)) tmp = 0 if z <= -4.8e+142: tmp = x - a elif z <= -2.35e+82: tmp = t_1 elif z <= -1.42e+59: tmp = x - a elif z <= 4e-89: tmp = x - (y * (a / t)) elif z <= 2.25e+170: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z / Float64(t / a))) tmp = 0.0 if (z <= -4.8e+142) tmp = Float64(x - a); elseif (z <= -2.35e+82) tmp = t_1; elseif (z <= -1.42e+59) tmp = Float64(x - a); elseif (z <= 4e-89) tmp = Float64(x - Float64(y * Float64(a / t))); elseif (z <= 2.25e+170) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z / (t / a)); tmp = 0.0; if (z <= -4.8e+142) tmp = x - a; elseif (z <= -2.35e+82) tmp = t_1; elseif (z <= -1.42e+59) tmp = x - a; elseif (z <= 4e-89) tmp = x - (y * (a / t)); elseif (z <= 2.25e+170) tmp = t_1; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+142], N[(x - a), $MachinePrecision], If[LessEqual[z, -2.35e+82], t$95$1, If[LessEqual[z, -1.42e+59], N[(x - a), $MachinePrecision], If[LessEqual[z, 4e-89], N[(x - N[(y * N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e+170], t$95$1, N[(x - a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{\frac{t}{a}}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+142}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.42 \cdot 10^{+59}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-89}:\\
\;\;\;\;x - y \cdot \frac{a}{t}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.7999999999999998e142 or -2.35e82 < z < -1.42000000000000005e59 or 2.25000000000000011e170 < z Initial program 91.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 87.0%
if -4.7999999999999998e142 < z < -2.35e82 or 4.00000000000000015e-89 < z < 2.25000000000000011e170Initial program 99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 62.6%
associate-/l*66.5%
Simplified66.5%
Taylor expanded in y around 0 70.2%
mul-1-neg70.2%
Simplified70.2%
Taylor expanded in x around 0 66.3%
associate-/l*70.2%
associate-/r/71.6%
Simplified71.6%
*-commutative71.6%
clear-num73.2%
div-inv73.2%
Applied egg-rr73.2%
if -1.42000000000000005e59 < z < 4.00000000000000015e-89Initial program 99.9%
Taylor expanded in t around inf 64.5%
Taylor expanded in y around inf 62.5%
*-commutative62.5%
associate-*r/64.3%
Simplified64.3%
Final simplification74.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.55e+28) (not (<= z 4.6e-45))) (+ x (* a (/ z (+ (- t z) 1.0)))) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.55e+28) || !(z <= 4.6e-45)) {
tmp = x + (a * (z / ((t - z) + 1.0)));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.55d+28)) .or. (.not. (z <= 4.6d-45))) then
tmp = x + (a * (z / ((t - z) + 1.0d0)))
else
tmp = x - (a * (y / (t + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.55e+28) || !(z <= 4.6e-45)) {
tmp = x + (a * (z / ((t - z) + 1.0)));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.55e+28) or not (z <= 4.6e-45): tmp = x + (a * (z / ((t - z) + 1.0))) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.55e+28) || !(z <= 4.6e-45)) tmp = Float64(x + Float64(a * Float64(z / Float64(Float64(t - z) + 1.0)))); else tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.55e+28) || ~((z <= 4.6e-45))) tmp = x + (a * (z / ((t - z) + 1.0))); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.55e+28], N[Not[LessEqual[z, 4.6e-45]], $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[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.55 \cdot 10^{+28} \lor \neg \left(z \leq 4.6 \cdot 10^{-45}\right):\\
\;\;\;\;x + a \cdot \frac{z}{\left(t - z\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -3.55e28 or 4.59999999999999983e-45 < z Initial program 94.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 69.8%
mul-1-neg69.8%
*-commutative69.8%
associate--l+69.8%
+-commutative69.8%
associate-*r/87.3%
distribute-rgt-neg-in87.3%
distribute-neg-frac87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in x around 0 69.8%
+-commutative69.8%
associate-/l*90.6%
sub-neg90.6%
associate-+r+90.6%
mul-1-neg90.6%
+-commutative90.6%
mul-1-neg90.6%
sub-neg90.6%
associate--r-90.6%
sub-neg90.6%
metadata-eval90.6%
Simplified90.6%
div-inv90.6%
clear-num90.6%
associate--r+90.6%
sub-neg90.6%
metadata-eval90.6%
Applied egg-rr90.6%
if -3.55e28 < z < 4.59999999999999983e-45Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 93.1%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.55e+28) (not (<= z 6.5e-45))) (+ x (/ a (+ (/ (+ t 1.0) z) -1.0))) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.55e+28) || !(z <= 6.5e-45)) {
tmp = x + (a / (((t + 1.0) / z) + -1.0));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.55d+28)) .or. (.not. (z <= 6.5d-45))) then
tmp = x + (a / (((t + 1.0d0) / z) + (-1.0d0)))
else
tmp = x - (a * (y / (t + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.55e+28) || !(z <= 6.5e-45)) {
tmp = x + (a / (((t + 1.0) / z) + -1.0));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.55e+28) or not (z <= 6.5e-45): tmp = x + (a / (((t + 1.0) / z) + -1.0)) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.55e+28) || !(z <= 6.5e-45)) tmp = Float64(x + Float64(a / Float64(Float64(Float64(t + 1.0) / z) + -1.0))); else tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.55e+28) || ~((z <= 6.5e-45))) tmp = x + (a / (((t + 1.0) / z) + -1.0)); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.55e+28], N[Not[LessEqual[z, 6.5e-45]], $MachinePrecision]], N[(x + N[(a / N[(N[(N[(t + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.55 \cdot 10^{+28} \lor \neg \left(z \leq 6.5 \cdot 10^{-45}\right):\\
\;\;\;\;x + \frac{a}{\frac{t + 1}{z} + -1}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -3.55e28 or 6.4999999999999995e-45 < z Initial program 94.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 69.8%
mul-1-neg69.8%
*-commutative69.8%
associate--l+69.8%
+-commutative69.8%
associate-*r/87.3%
distribute-rgt-neg-in87.3%
distribute-neg-frac87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in x around 0 69.8%
+-commutative69.8%
associate-/l*90.6%
sub-neg90.6%
associate-+r+90.6%
mul-1-neg90.6%
+-commutative90.6%
mul-1-neg90.6%
sub-neg90.6%
associate--r-90.6%
sub-neg90.6%
metadata-eval90.6%
Simplified90.6%
Taylor expanded in a around 0 69.8%
associate-/l*90.6%
div-sub90.6%
*-inverses90.6%
Simplified90.6%
if -3.55e28 < z < 6.4999999999999995e-45Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 93.1%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.9e+28) (not (<= z 35000.0))) (+ x (/ a (+ (/ (+ t 1.0) z) -1.0))) (+ x (/ (- z y) (/ (+ t 1.0) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.9e+28) || !(z <= 35000.0)) {
tmp = x + (a / (((t + 1.0) / z) + -1.0));
} else {
tmp = x + ((z - y) / ((t + 1.0) / 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.9d+28)) .or. (.not. (z <= 35000.0d0))) then
tmp = x + (a / (((t + 1.0d0) / z) + (-1.0d0)))
else
tmp = x + ((z - y) / ((t + 1.0d0) / 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.9e+28) || !(z <= 35000.0)) {
tmp = x + (a / (((t + 1.0) / z) + -1.0));
} else {
tmp = x + ((z - y) / ((t + 1.0) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.9e+28) or not (z <= 35000.0): tmp = x + (a / (((t + 1.0) / z) + -1.0)) else: tmp = x + ((z - y) / ((t + 1.0) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.9e+28) || !(z <= 35000.0)) tmp = Float64(x + Float64(a / Float64(Float64(Float64(t + 1.0) / z) + -1.0))); else tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(t + 1.0) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.9e+28) || ~((z <= 35000.0))) tmp = x + (a / (((t + 1.0) / z) + -1.0)); else tmp = x + ((z - y) / ((t + 1.0) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.9e+28], N[Not[LessEqual[z, 35000.0]], $MachinePrecision]], N[(x + N[(a / N[(N[(N[(t + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - y), $MachinePrecision] / N[(N[(t + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+28} \lor \neg \left(z \leq 35000\right):\\
\;\;\;\;x + \frac{a}{\frac{t + 1}{z} + -1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{t + 1}{a}}\\
\end{array}
\end{array}
if z < -2.9000000000000001e28 or 35000 < z Initial program 94.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 69.4%
mul-1-neg69.4%
*-commutative69.4%
associate--l+69.4%
+-commutative69.4%
associate-*r/88.3%
distribute-rgt-neg-in88.3%
distribute-neg-frac88.3%
+-commutative88.3%
Simplified88.3%
Taylor expanded in x around 0 69.4%
+-commutative69.4%
associate-/l*91.9%
sub-neg91.9%
associate-+r+91.9%
mul-1-neg91.9%
+-commutative91.9%
mul-1-neg91.9%
sub-neg91.9%
associate--r-91.9%
sub-neg91.9%
metadata-eval91.9%
Simplified91.9%
Taylor expanded in a around 0 69.4%
associate-/l*91.9%
div-sub91.9%
*-inverses91.9%
Simplified91.9%
if -2.9000000000000001e28 < z < 35000Initial program 99.8%
Taylor expanded in z around 0 97.1%
Final simplification94.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e+55) (not (<= z 4.3e+45))) (+ x (/ (- z y) (/ (- z) a))) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+55) || !(z <= 4.3e+45)) {
tmp = x + ((z - y) / (-z / a));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.9d+55)) .or. (.not. (z <= 4.3d+45))) then
tmp = x + ((z - y) / (-z / a))
else
tmp = x - (a * (y / (t + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+55) || !(z <= 4.3e+45)) {
tmp = x + ((z - y) / (-z / a));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e+55) or not (z <= 4.3e+45): tmp = x + ((z - y) / (-z / a)) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e+55) || !(z <= 4.3e+45)) tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(-z) / a))); else tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.9e+55) || ~((z <= 4.3e+45))) tmp = x + ((z - y) / (-z / a)); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e+55], N[Not[LessEqual[z, 4.3e+45]], $MachinePrecision]], N[(x + N[(N[(z - y), $MachinePrecision] / N[((-z) / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+55} \lor \neg \left(z \leq 4.3 \cdot 10^{+45}\right):\\
\;\;\;\;x + \frac{z - y}{\frac{-z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -1.9e55 or 4.3000000000000003e45 < z Initial program 93.7%
Taylor expanded in z around inf 82.2%
mul-1-neg82.2%
Simplified82.2%
if -1.9e55 < z < 4.3000000000000003e45Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 88.7%
Final simplification85.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e+142) (not (<= z 6.8e+45))) (- x a) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e+142) || !(z <= 6.8e+45)) {
tmp = x - a;
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-7.2d+142)) .or. (.not. (z <= 6.8d+45))) then
tmp = x - a
else
tmp = x - (a * (y / (t + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e+142) || !(z <= 6.8e+45)) {
tmp = x - a;
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e+142) or not (z <= 6.8e+45): tmp = x - a else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e+142) || !(z <= 6.8e+45)) tmp = Float64(x - a); else tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.2e+142) || ~((z <= 6.8e+45))) tmp = x - a; else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e+142], N[Not[LessEqual[z, 6.8e+45]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+142} \lor \neg \left(z \leq 6.8 \cdot 10^{+45}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -7.2000000000000003e142 or 6.8e45 < z Initial program 92.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.9%
if -7.2000000000000003e142 < z < 6.8e45Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 87.0%
Final simplification84.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e+142) (not (<= z 2.25e+170))) (- x a) (+ x (* z (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e+142) || !(z <= 2.25e+170)) {
tmp = x - a;
} else {
tmp = x + (z * (a / 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 <= (-4.8d+142)) .or. (.not. (z <= 2.25d+170))) then
tmp = x - a
else
tmp = x + (z * (a / 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 <= -4.8e+142) || !(z <= 2.25e+170)) {
tmp = x - a;
} else {
tmp = x + (z * (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e+142) or not (z <= 2.25e+170): tmp = x - a else: tmp = x + (z * (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e+142) || !(z <= 2.25e+170)) tmp = Float64(x - a); else tmp = Float64(x + Float64(z * Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.8e+142) || ~((z <= 2.25e+170))) tmp = x - a; else tmp = x + (z * (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e+142], N[Not[LessEqual[z, 2.25e+170]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(z * N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+142} \lor \neg \left(z \leq 2.25 \cdot 10^{+170}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{a}{t}\\
\end{array}
\end{array}
if z < -4.7999999999999998e142 or 2.25000000000000011e170 < z Initial program 90.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 86.2%
if -4.7999999999999998e142 < z < 2.25000000000000011e170Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 61.0%
associate-/l*62.9%
Simplified62.9%
Taylor expanded in y around 0 60.0%
mul-1-neg60.0%
Simplified60.0%
Taylor expanded in x around 0 59.2%
associate-/l*60.0%
associate-/r/59.9%
Simplified59.9%
Final simplification68.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.8e+129) (not (<= z 3.4e+47))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.8e+129) || !(z <= 3.4e+47)) {
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 <= (-8.8d+129)) .or. (.not. (z <= 3.4d+47))) 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 <= -8.8e+129) || !(z <= 3.4e+47)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.8e+129) or not (z <= 3.4e+47): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.8e+129) || !(z <= 3.4e+47)) 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 <= -8.8e+129) || ~((z <= 3.4e+47))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.8e+129], N[Not[LessEqual[z, 3.4e+47]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+129} \lor \neg \left(z \leq 3.4 \cdot 10^{+47}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.7999999999999997e129 or 3.3999999999999998e47 < z Initial program 92.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.9%
if -8.7999999999999997e129 < z < 3.3999999999999998e47Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 58.1%
Final simplification67.7%
(FPCore (x y z t a) :precision binary64 (if (<= a 4.2e+206) x (- a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 4.2e+206) {
tmp = x;
} else {
tmp = -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 (a <= 4.2d+206) then
tmp = x
else
tmp = -a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 4.2e+206) {
tmp = x;
} else {
tmp = -a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 4.2e+206: tmp = x else: tmp = -a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 4.2e+206) tmp = x; else tmp = Float64(-a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 4.2e+206) tmp = x; else tmp = -a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 4.2e+206], x, (-a)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.2 \cdot 10^{+206}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-a\\
\end{array}
\end{array}
if a < 4.19999999999999974e206Initial program 96.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 60.9%
if 4.19999999999999974e206 < a Initial program 99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around 0 18.2%
mul-1-neg18.2%
*-commutative18.2%
associate--l+18.2%
+-commutative18.2%
associate-*r/72.3%
distribute-rgt-neg-in72.3%
distribute-neg-frac72.3%
+-commutative72.3%
Simplified72.3%
Taylor expanded in x around 0 9.9%
Taylor expanded in z around inf 44.4%
neg-mul-144.4%
Simplified44.4%
Final simplification59.1%
(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%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 55.9%
Final simplification55.9%
(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 2024034
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:herbie-target
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))