
(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 (/ (- 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 98.7%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* a (/ y t)))))
(if (<= z -1.6e+128)
(- x a)
(if (<= z -30000000.0)
(+ x (* a (/ y z)))
(if (<= z -2.85e-129)
t_1
(if (<= z 4.6e-72)
(- x (* a y))
(if (<= z 1.66e+22) t_1 (- x a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * (y / t));
double tmp;
if (z <= -1.6e+128) {
tmp = x - a;
} else if (z <= -30000000.0) {
tmp = x + (a * (y / z));
} else if (z <= -2.85e-129) {
tmp = t_1;
} else if (z <= 4.6e-72) {
tmp = x - (a * y);
} else if (z <= 1.66e+22) {
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 - (a * (y / t))
if (z <= (-1.6d+128)) then
tmp = x - a
else if (z <= (-30000000.0d0)) then
tmp = x + (a * (y / z))
else if (z <= (-2.85d-129)) then
tmp = t_1
else if (z <= 4.6d-72) then
tmp = x - (a * y)
else if (z <= 1.66d+22) 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 - (a * (y / t));
double tmp;
if (z <= -1.6e+128) {
tmp = x - a;
} else if (z <= -30000000.0) {
tmp = x + (a * (y / z));
} else if (z <= -2.85e-129) {
tmp = t_1;
} else if (z <= 4.6e-72) {
tmp = x - (a * y);
} else if (z <= 1.66e+22) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (y / t)) tmp = 0 if z <= -1.6e+128: tmp = x - a elif z <= -30000000.0: tmp = x + (a * (y / z)) elif z <= -2.85e-129: tmp = t_1 elif z <= 4.6e-72: tmp = x - (a * y) elif z <= 1.66e+22: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a * Float64(y / t))) tmp = 0.0 if (z <= -1.6e+128) tmp = Float64(x - a); elseif (z <= -30000000.0) tmp = Float64(x + Float64(a * Float64(y / z))); elseif (z <= -2.85e-129) tmp = t_1; elseif (z <= 4.6e-72) tmp = Float64(x - Float64(a * y)); elseif (z <= 1.66e+22) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a * (y / t)); tmp = 0.0; if (z <= -1.6e+128) tmp = x - a; elseif (z <= -30000000.0) tmp = x + (a * (y / z)); elseif (z <= -2.85e-129) tmp = t_1; elseif (z <= 4.6e-72) tmp = x - (a * y); elseif (z <= 1.66e+22) 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[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+128], N[(x - a), $MachinePrecision], If[LessEqual[z, -30000000.0], N[(x + N[(a * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.85e-129], t$95$1, If[LessEqual[z, 4.6e-72], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.66e+22], t$95$1, N[(x - a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \frac{y}{t}\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+128}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -30000000:\\
\;\;\;\;x + a \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq -2.85 \cdot 10^{-129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-72}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{elif}\;z \leq 1.66 \cdot 10^{+22}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.59999999999999993e128 or 1.66e22 < z Initial program 97.7%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 81.8%
if -1.59999999999999993e128 < z < -3e7Initial program 95.7%
Taylor expanded in z around inf 78.2%
mul-1-neg78.2%
distribute-neg-frac78.2%
Simplified78.2%
Taylor expanded in a around -inf 82.4%
mul-1-neg82.4%
unsub-neg82.4%
Simplified82.4%
Taylor expanded in y around inf 69.6%
mul-1-neg69.6%
associate-*r/69.7%
*-commutative69.7%
distribute-rgt-neg-in69.7%
Simplified69.7%
if -3e7 < z < -2.85e-129 or 4.59999999999999989e-72 < z < 1.66e22Initial program 99.8%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 84.0%
Taylor expanded in t around inf 72.8%
if -2.85e-129 < z < 4.59999999999999989e-72Initial program 99.8%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 81.3%
Taylor expanded in z around 0 74.8%
Final simplification76.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* a (/ y t)))) (t_2 (+ x (* a (+ (/ y z) -1.0)))))
(if (<= z -22000000.0)
t_2
(if (<= z -7.6e-129)
t_1
(if (<= z 1.75e-72) (- x (* a y)) (if (<= z 3.4e+14) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * (y / t));
double t_2 = x + (a * ((y / z) + -1.0));
double tmp;
if (z <= -22000000.0) {
tmp = t_2;
} else if (z <= -7.6e-129) {
tmp = t_1;
} else if (z <= 1.75e-72) {
tmp = x - (a * y);
} else if (z <= 3.4e+14) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x - (a * (y / t))
t_2 = x + (a * ((y / z) + (-1.0d0)))
if (z <= (-22000000.0d0)) then
tmp = t_2
else if (z <= (-7.6d-129)) then
tmp = t_1
else if (z <= 1.75d-72) then
tmp = x - (a * y)
else if (z <= 3.4d+14) then
tmp = t_1
else
tmp = t_2
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 * (y / t));
double t_2 = x + (a * ((y / z) + -1.0));
double tmp;
if (z <= -22000000.0) {
tmp = t_2;
} else if (z <= -7.6e-129) {
tmp = t_1;
} else if (z <= 1.75e-72) {
tmp = x - (a * y);
} else if (z <= 3.4e+14) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (y / t)) t_2 = x + (a * ((y / z) + -1.0)) tmp = 0 if z <= -22000000.0: tmp = t_2 elif z <= -7.6e-129: tmp = t_1 elif z <= 1.75e-72: tmp = x - (a * y) elif z <= 3.4e+14: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a * Float64(y / t))) t_2 = Float64(x + Float64(a * Float64(Float64(y / z) + -1.0))) tmp = 0.0 if (z <= -22000000.0) tmp = t_2; elseif (z <= -7.6e-129) tmp = t_1; elseif (z <= 1.75e-72) tmp = Float64(x - Float64(a * y)); elseif (z <= 3.4e+14) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a * (y / t)); t_2 = x + (a * ((y / z) + -1.0)); tmp = 0.0; if (z <= -22000000.0) tmp = t_2; elseif (z <= -7.6e-129) tmp = t_1; elseif (z <= 1.75e-72) tmp = x - (a * y); elseif (z <= 3.4e+14) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(a * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -22000000.0], t$95$2, If[LessEqual[z, -7.6e-129], t$95$1, If[LessEqual[z, 1.75e-72], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+14], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \frac{y}{t}\\
t_2 := x + a \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{if}\;z \leq -22000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-72}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.2e7 or 3.4e14 < z Initial program 97.4%
Taylor expanded in z around inf 88.5%
mul-1-neg88.5%
distribute-neg-frac88.5%
Simplified88.5%
Taylor expanded in a around -inf 90.3%
mul-1-neg90.3%
unsub-neg90.3%
Simplified90.3%
if -2.2e7 < z < -7.59999999999999969e-129 or 1.75e-72 < z < 3.4e14Initial program 99.8%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 85.6%
Taylor expanded in t around inf 72.3%
if -7.59999999999999969e-129 < z < 1.75e-72Initial program 99.8%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 81.3%
Taylor expanded in z around 0 74.8%
Final simplification81.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* a (/ y t)))))
(if (<= z -4.3e+38)
(- x a)
(if (<= z -3.6e-128)
t_1
(if (<= z 6.5e-74) (- x (* a y)) (if (<= z 3e+22) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * (y / t));
double tmp;
if (z <= -4.3e+38) {
tmp = x - a;
} else if (z <= -3.6e-128) {
tmp = t_1;
} else if (z <= 6.5e-74) {
tmp = x - (a * y);
} else if (z <= 3e+22) {
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 - (a * (y / t))
if (z <= (-4.3d+38)) then
tmp = x - a
else if (z <= (-3.6d-128)) then
tmp = t_1
else if (z <= 6.5d-74) then
tmp = x - (a * y)
else if (z <= 3d+22) 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 - (a * (y / t));
double tmp;
if (z <= -4.3e+38) {
tmp = x - a;
} else if (z <= -3.6e-128) {
tmp = t_1;
} else if (z <= 6.5e-74) {
tmp = x - (a * y);
} else if (z <= 3e+22) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (y / t)) tmp = 0 if z <= -4.3e+38: tmp = x - a elif z <= -3.6e-128: tmp = t_1 elif z <= 6.5e-74: tmp = x - (a * y) elif z <= 3e+22: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a * Float64(y / t))) tmp = 0.0 if (z <= -4.3e+38) tmp = Float64(x - a); elseif (z <= -3.6e-128) tmp = t_1; elseif (z <= 6.5e-74) tmp = Float64(x - Float64(a * y)); elseif (z <= 3e+22) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a * (y / t)); tmp = 0.0; if (z <= -4.3e+38) tmp = x - a; elseif (z <= -3.6e-128) tmp = t_1; elseif (z <= 6.5e-74) tmp = x - (a * y); elseif (z <= 3e+22) 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[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e+38], N[(x - a), $MachinePrecision], If[LessEqual[z, -3.6e-128], t$95$1, If[LessEqual[z, 6.5e-74], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+22], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \frac{y}{t}\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{+38}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-128}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-74}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+22}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.2999999999999997e38 or 3e22 < z Initial program 97.2%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 77.1%
if -4.2999999999999997e38 < z < -3.60000000000000025e-128 or 6.5000000000000002e-74 < z < 3e22Initial program 99.8%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 80.4%
Taylor expanded in t around inf 69.8%
if -3.60000000000000025e-128 < z < 6.5000000000000002e-74Initial program 99.8%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 81.3%
Taylor expanded in z around 0 74.8%
Final simplification74.7%
(FPCore (x y z t a)
:precision binary64
(if (<= t -35000000.0)
(- x (* a (/ y (+ t 1.0))))
(if (<= t 6.8e+43)
(- x (/ a (/ (- 1.0 z) (- y z))))
(- x (* a (/ (- y z) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -35000000.0) {
tmp = x - (a * (y / (t + 1.0)));
} else if (t <= 6.8e+43) {
tmp = x - (a / ((1.0 - z) / (y - z)));
} else {
tmp = x - (a * ((y - z) / 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 (t <= (-35000000.0d0)) then
tmp = x - (a * (y / (t + 1.0d0)))
else if (t <= 6.8d+43) then
tmp = x - (a / ((1.0d0 - z) / (y - z)))
else
tmp = x - (a * ((y - z) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -35000000.0) {
tmp = x - (a * (y / (t + 1.0)));
} else if (t <= 6.8e+43) {
tmp = x - (a / ((1.0 - z) / (y - z)));
} else {
tmp = x - (a * ((y - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -35000000.0: tmp = x - (a * (y / (t + 1.0))) elif t <= 6.8e+43: tmp = x - (a / ((1.0 - z) / (y - z))) else: tmp = x - (a * ((y - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -35000000.0) tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); elseif (t <= 6.8e+43) tmp = Float64(x - Float64(a / Float64(Float64(1.0 - z) / Float64(y - z)))); else tmp = Float64(x - Float64(a * Float64(Float64(y - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -35000000.0) tmp = x - (a * (y / (t + 1.0))); elseif (t <= 6.8e+43) tmp = x - (a / ((1.0 - z) / (y - z))); else tmp = x - (a * ((y - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -35000000.0], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e+43], N[(x - N[(a / N[(N[(1.0 - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -35000000:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+43}:\\
\;\;\;\;x - \frac{a}{\frac{1 - z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y - z}{t}\\
\end{array}
\end{array}
if t < -3.5e7Initial program 98.4%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around 0 85.5%
if -3.5e7 < t < 6.80000000000000024e43Initial program 98.5%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 88.9%
associate-/l*99.1%
Simplified99.1%
if 6.80000000000000024e43 < t Initial program 99.7%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 89.0%
Final simplification93.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -10000000.0) (not (<= z 3.9e+14))) (+ x (* a (+ (/ y 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 <= -10000000.0) || !(z <= 3.9e+14)) {
tmp = x + (a * ((y / 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 <= (-10000000.0d0)) .or. (.not. (z <= 3.9d+14))) then
tmp = x + (a * ((y / 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 <= -10000000.0) || !(z <= 3.9e+14)) {
tmp = x + (a * ((y / z) + -1.0));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -10000000.0) or not (z <= 3.9e+14): tmp = x + (a * ((y / 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 <= -10000000.0) || !(z <= 3.9e+14)) tmp = Float64(x + Float64(a * Float64(Float64(y / 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 <= -10000000.0) || ~((z <= 3.9e+14))) tmp = x + (a * ((y / 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, -10000000.0], N[Not[LessEqual[z, 3.9e+14]], $MachinePrecision]], N[(x + N[(a * N[(N[(y / 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 -10000000 \lor \neg \left(z \leq 3.9 \cdot 10^{+14}\right):\\
\;\;\;\;x + a \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -1e7 or 3.9e14 < z Initial program 97.4%
Taylor expanded in z around inf 88.5%
mul-1-neg88.5%
distribute-neg-frac88.5%
Simplified88.5%
Taylor expanded in a around -inf 90.3%
mul-1-neg90.3%
unsub-neg90.3%
Simplified90.3%
if -1e7 < z < 3.9e14Initial program 99.8%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around 0 90.0%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.5e-20) (- x a) (if (<= z 61000000000000.0) (- x (* a y)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e-20) {
tmp = x - a;
} else if (z <= 61000000000000.0) {
tmp = x - (a * y);
} 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 <= (-7.5d-20)) then
tmp = x - a
else if (z <= 61000000000000.0d0) then
tmp = x - (a * y)
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 <= -7.5e-20) {
tmp = x - a;
} else if (z <= 61000000000000.0) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.5e-20: tmp = x - a elif z <= 61000000000000.0: tmp = x - (a * y) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5e-20) tmp = Float64(x - a); elseif (z <= 61000000000000.0) tmp = Float64(x - Float64(a * y)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.5e-20) tmp = x - a; elseif (z <= 61000000000000.0) tmp = x - (a * y); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5e-20], N[(x - a), $MachinePrecision], If[LessEqual[z, 61000000000000.0], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-20}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 61000000000000:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -7.49999999999999981e-20 or 6.1e13 < z Initial program 97.6%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 72.7%
if -7.49999999999999981e-20 < z < 6.1e13Initial program 99.8%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 72.9%
Taylor expanded in z around 0 68.4%
Final simplification70.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.5e+50) (- x a) (if (<= z 4.3e+14) x (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.5e+50) {
tmp = x - a;
} else if (z <= 4.3e+14) {
tmp = x;
} 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.5d+50)) then
tmp = x - a
else if (z <= 4.3d+14) then
tmp = x
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.5e+50) {
tmp = x - a;
} else if (z <= 4.3e+14) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.5e+50: tmp = x - a elif z <= 4.3e+14: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.5e+50) tmp = Float64(x - a); elseif (z <= 4.3e+14) tmp = x; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.5e+50) tmp = x - a; elseif (z <= 4.3e+14) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.5e+50], N[(x - a), $MachinePrecision], If[LessEqual[z, 4.3e+14], x, N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+50}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -2.5e50 or 4.3e14 < z Initial program 97.2%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 77.5%
if -2.5e50 < z < 4.3e14Initial program 99.8%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 50.6%
Final simplification62.0%
(FPCore (x y z t a) :precision binary64 (if (<= a 1.35e+126) x (- a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1.35e+126) {
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 <= 1.35d+126) 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 <= 1.35e+126) {
tmp = x;
} else {
tmp = -a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 1.35e+126: tmp = x else: tmp = -a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 1.35e+126) tmp = x; else tmp = Float64(-a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 1.35e+126) tmp = x; else tmp = -a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 1.35e+126], x, (-a)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.35 \cdot 10^{+126}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-a\\
\end{array}
\end{array}
if a < 1.35000000000000001e126Initial program 98.5%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 59.6%
if 1.35000000000000001e126 < a Initial program 99.7%
Taylor expanded in z around inf 46.4%
mul-1-neg46.4%
distribute-neg-frac46.4%
Simplified46.4%
Taylor expanded in x around 0 25.0%
associate-/l*43.2%
Simplified43.2%
Taylor expanded in z around inf 30.5%
mul-1-neg30.5%
Simplified30.5%
Final simplification53.8%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 98.7%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 50.6%
Final simplification50.6%
(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 2023271
(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))))