
(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 (/ (- 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.7%
associate-/r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.95e+185)
(- x (/ a (/ t y)))
(if (<= t -7.8e+129)
(- x (* z (/ a (+ z (- -1.0 t)))))
(if (or (<= t -4.2e+35) (not (<= t 0.0085)))
(+ x (* a (/ (- z y) t)))
(+ x (* a (/ (- y z) (+ z -1.0))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.95e+185) {
tmp = x - (a / (t / y));
} else if (t <= -7.8e+129) {
tmp = x - (z * (a / (z + (-1.0 - t))));
} else if ((t <= -4.2e+35) || !(t <= 0.0085)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x + (a * ((y - z) / (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 (t <= (-1.95d+185)) then
tmp = x - (a / (t / y))
else if (t <= (-7.8d+129)) then
tmp = x - (z * (a / (z + ((-1.0d0) - t))))
else if ((t <= (-4.2d+35)) .or. (.not. (t <= 0.0085d0))) then
tmp = x + (a * ((z - y) / t))
else
tmp = x + (a * ((y - z) / (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 (t <= -1.95e+185) {
tmp = x - (a / (t / y));
} else if (t <= -7.8e+129) {
tmp = x - (z * (a / (z + (-1.0 - t))));
} else if ((t <= -4.2e+35) || !(t <= 0.0085)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x + (a * ((y - z) / (z + -1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.95e+185: tmp = x - (a / (t / y)) elif t <= -7.8e+129: tmp = x - (z * (a / (z + (-1.0 - t)))) elif (t <= -4.2e+35) or not (t <= 0.0085): tmp = x + (a * ((z - y) / t)) else: tmp = x + (a * ((y - z) / (z + -1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.95e+185) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (t <= -7.8e+129) tmp = Float64(x - Float64(z * Float64(a / Float64(z + Float64(-1.0 - t))))); elseif ((t <= -4.2e+35) || !(t <= 0.0085)) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); else tmp = Float64(x + Float64(a * Float64(Float64(y - z) / Float64(z + -1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.95e+185) tmp = x - (a / (t / y)); elseif (t <= -7.8e+129) tmp = x - (z * (a / (z + (-1.0 - t)))); elseif ((t <= -4.2e+35) || ~((t <= 0.0085))) tmp = x + (a * ((z - y) / t)); else tmp = x + (a * ((y - z) / (z + -1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.95e+185], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -7.8e+129], N[(x - N[(z * N[(a / N[(z + N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -4.2e+35], N[Not[LessEqual[t, 0.0085]], $MachinePrecision]], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{+185}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;t \leq -7.8 \cdot 10^{+129}:\\
\;\;\;\;x - z \cdot \frac{a}{z + \left(-1 - t\right)}\\
\mathbf{elif}\;t \leq -4.2 \cdot 10^{+35} \lor \neg \left(t \leq 0.0085\right):\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y - z}{z + -1}\\
\end{array}
\end{array}
if t < -1.9499999999999999e185Initial program 99.6%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 87.7%
*-commutative87.7%
clear-num87.6%
un-div-inv87.7%
Applied egg-rr87.7%
associate-/r/87.8%
Simplified87.8%
Taylor expanded in y around inf 68.2%
associate-*l/93.8%
associate-/r/93.8%
Simplified93.8%
if -1.9499999999999999e185 < t < -7.7999999999999994e129Initial program 99.7%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in y around 0 66.4%
mul-1-neg66.4%
*-commutative66.4%
associate--l+66.4%
+-commutative66.4%
associate-*r/99.9%
distribute-rgt-neg-in99.9%
distribute-neg-frac299.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
unsub-neg99.9%
associate--r-99.9%
Simplified99.9%
if -7.7999999999999994e129 < t < -4.1999999999999998e35 or 0.0085000000000000006 < t Initial program 94.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 85.4%
if -4.1999999999999998e35 < t < 0.0085000000000000006Initial program 98.6%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
Final simplification95.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.4e+45)
(- x a)
(if (<= z -2.7e-127)
(+ x (* z (/ a (+ t 1.0))))
(if (<= z -2.35e-281)
(- x (/ a (/ t y)))
(if (<= z 4.2e+17) (- x (* y a)) (- x a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.4e+45) {
tmp = x - a;
} else if (z <= -2.7e-127) {
tmp = x + (z * (a / (t + 1.0)));
} else if (z <= -2.35e-281) {
tmp = x - (a / (t / y));
} else if (z <= 4.2e+17) {
tmp = x - (y * a);
} 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 <= (-4.4d+45)) then
tmp = x - a
else if (z <= (-2.7d-127)) then
tmp = x + (z * (a / (t + 1.0d0)))
else if (z <= (-2.35d-281)) then
tmp = x - (a / (t / y))
else if (z <= 4.2d+17) then
tmp = x - (y * a)
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 <= -4.4e+45) {
tmp = x - a;
} else if (z <= -2.7e-127) {
tmp = x + (z * (a / (t + 1.0)));
} else if (z <= -2.35e-281) {
tmp = x - (a / (t / y));
} else if (z <= 4.2e+17) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.4e+45: tmp = x - a elif z <= -2.7e-127: tmp = x + (z * (a / (t + 1.0))) elif z <= -2.35e-281: tmp = x - (a / (t / y)) elif z <= 4.2e+17: tmp = x - (y * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.4e+45) tmp = Float64(x - a); elseif (z <= -2.7e-127) tmp = Float64(x + Float64(z * Float64(a / Float64(t + 1.0)))); elseif (z <= -2.35e-281) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (z <= 4.2e+17) tmp = Float64(x - Float64(y * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.4e+45) tmp = x - a; elseif (z <= -2.7e-127) tmp = x + (z * (a / (t + 1.0))); elseif (z <= -2.35e-281) tmp = x - (a / (t / y)); elseif (z <= 4.2e+17) tmp = x - (y * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.4e+45], N[(x - a), $MachinePrecision], If[LessEqual[z, -2.7e-127], N[(x + N[(z * N[(a / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.35e-281], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+17], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+45}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-127}:\\
\;\;\;\;x + z \cdot \frac{a}{t + 1}\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-281}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+17}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.4000000000000001e45 or 4.2e17 < z Initial program 96.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 82.8%
if -4.4000000000000001e45 < z < -2.7e-127Initial program 99.8%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in y around 0 74.5%
mul-1-neg74.5%
*-commutative74.5%
associate--l+74.5%
+-commutative74.5%
associate-*r/74.5%
distribute-rgt-neg-in74.5%
distribute-neg-frac274.5%
+-commutative74.5%
distribute-neg-in74.5%
metadata-eval74.5%
unsub-neg74.5%
associate--r-74.5%
Simplified74.5%
Taylor expanded in z around 0 71.8%
mul-1-neg71.8%
*-commutative71.8%
associate-/l*71.9%
distribute-rgt-neg-out71.9%
distribute-neg-frac271.9%
distribute-neg-in71.9%
metadata-eval71.9%
sub-neg71.9%
Simplified71.9%
if -2.7e-127 < z < -2.3500000000000001e-281Initial program 99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 85.3%
*-commutative85.3%
clear-num85.3%
un-div-inv85.4%
Applied egg-rr85.4%
associate-/r/85.3%
Simplified85.3%
Taylor expanded in y around inf 85.5%
associate-*l/85.3%
associate-/r/85.5%
Simplified85.5%
if -2.3500000000000001e-281 < z < 4.2e17Initial program 98.7%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 75.1%
Taylor expanded in z around 0 73.9%
Final simplification78.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6e+75)
(- x a)
(if (<= z 92000000000.0)
(+ x (* a (/ y (- -1.0 t))))
(- x (* z (/ a (+ z (- -1.0 t))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+75) {
tmp = x - a;
} else if (z <= 92000000000.0) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x - (z * (a / (z + (-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 <= (-6d+75)) then
tmp = x - a
else if (z <= 92000000000.0d0) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x - (z * (a / (z + ((-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 <= -6e+75) {
tmp = x - a;
} else if (z <= 92000000000.0) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x - (z * (a / (z + (-1.0 - t))));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e+75: tmp = x - a elif z <= 92000000000.0: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x - (z * (a / (z + (-1.0 - t)))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e+75) tmp = Float64(x - a); elseif (z <= 92000000000.0) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x - Float64(z * Float64(a / Float64(z + Float64(-1.0 - t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6e+75) tmp = x - a; elseif (z <= 92000000000.0) tmp = x + (a * (y / (-1.0 - t))); else tmp = x - (z * (a / (z + (-1.0 - t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+75], N[(x - a), $MachinePrecision], If[LessEqual[z, 92000000000.0], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(a / N[(z + N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+75}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 92000000000:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{a}{z + \left(-1 - t\right)}\\
\end{array}
\end{array}
if z < -6e75Initial program 93.6%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 90.5%
if -6e75 < z < 9.2e10Initial program 99.2%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around 0 88.9%
if 9.2e10 < z Initial program 98.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 67.8%
mul-1-neg67.8%
*-commutative67.8%
associate--l+67.8%
+-commutative67.8%
associate-*r/83.8%
distribute-rgt-neg-in83.8%
distribute-neg-frac283.8%
+-commutative83.8%
distribute-neg-in83.8%
metadata-eval83.8%
unsub-neg83.8%
associate--r-83.8%
Simplified83.8%
Final simplification88.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.05e+38)
(- x a)
(if (<= z -1e-280)
(+ x (* (/ a t) (- z y)))
(if (<= z 4.6e+17) (- x (* y a)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e+38) {
tmp = x - a;
} else if (z <= -1e-280) {
tmp = x + ((a / t) * (z - y));
} else if (z <= 4.6e+17) {
tmp = x - (y * a);
} 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 <= (-1.05d+38)) then
tmp = x - a
else if (z <= (-1d-280)) then
tmp = x + ((a / t) * (z - y))
else if (z <= 4.6d+17) then
tmp = x - (y * a)
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 <= -1.05e+38) {
tmp = x - a;
} else if (z <= -1e-280) {
tmp = x + ((a / t) * (z - y));
} else if (z <= 4.6e+17) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e+38: tmp = x - a elif z <= -1e-280: tmp = x + ((a / t) * (z - y)) elif z <= 4.6e+17: tmp = x - (y * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e+38) tmp = Float64(x - a); elseif (z <= -1e-280) tmp = Float64(x + Float64(Float64(a / t) * Float64(z - y))); elseif (z <= 4.6e+17) tmp = Float64(x - Float64(y * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.05e+38) tmp = x - a; elseif (z <= -1e-280) tmp = x + ((a / t) * (z - y)); elseif (z <= 4.6e+17) tmp = x - (y * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e+38], N[(x - a), $MachinePrecision], If[LessEqual[z, -1e-280], N[(x + N[(N[(a / t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e+17], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+38}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-280}:\\
\;\;\;\;x + \frac{a}{t} \cdot \left(z - y\right)\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+17}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.05e38 or 4.6e17 < z Initial program 96.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 83.1%
if -1.05e38 < z < -9.9999999999999996e-281Initial program 99.8%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in t around inf 71.3%
*-commutative71.3%
clear-num71.3%
un-div-inv71.4%
Applied egg-rr71.4%
associate-/r/71.4%
Simplified71.4%
if -9.9999999999999996e-281 < z < 4.6e17Initial program 98.7%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 75.1%
Taylor expanded in z around 0 73.9%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.8e+75) (not (<= z 8.4e+17))) (- x a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.8e+75) || !(z <= 8.4e+17)) {
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 <= (-6.8d+75)) .or. (.not. (z <= 8.4d+17))) 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 <= -6.8e+75) || !(z <= 8.4e+17)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.8e+75) or not (z <= 8.4e+17): 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 <= -6.8e+75) || !(z <= 8.4e+17)) 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 <= -6.8e+75) || ~((z <= 8.4e+17))) 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, -6.8e+75], N[Not[LessEqual[z, 8.4e+17]], $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 -6.8 \cdot 10^{+75} \lor \neg \left(z \leq 8.4 \cdot 10^{+17}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -6.80000000000000022e75 or 8.4e17 < z Initial program 95.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 84.6%
if -6.80000000000000022e75 < z < 8.4e17Initial program 99.2%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around 0 88.4%
Final simplification86.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.5e+25) (not (<= z 4.2e+17))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.5e+25) || !(z <= 4.2e+17)) {
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 <= (-5.5d+25)) .or. (.not. (z <= 4.2d+17))) 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 <= -5.5e+25) || !(z <= 4.2e+17)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.5e+25) or not (z <= 4.2e+17): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.5e+25) || !(z <= 4.2e+17)) 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 <= -5.5e+25) || ~((z <= 4.2e+17))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.5e+25], N[Not[LessEqual[z, 4.2e+17]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+25} \lor \neg \left(z \leq 4.2 \cdot 10^{+17}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -5.50000000000000018e25 or 4.2e17 < z Initial program 96.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.9%
if -5.50000000000000018e25 < z < 4.2e17Initial program 99.1%
associate-/r/99.8%
Simplified99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 74.2%
Taylor expanded in z around 0 70.6%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.2e-16) (not (<= z 7.4e+28))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e-16) || !(z <= 7.4e+28)) {
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.2d-16)) .or. (.not. (z <= 7.4d+28))) 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.2e-16) || !(z <= 7.4e+28)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.2e-16) or not (z <= 7.4e+28): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.2e-16) || !(z <= 7.4e+28)) 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.2e-16) || ~((z <= 7.4e+28))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.2e-16], N[Not[LessEqual[z, 7.4e+28]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-16} \lor \neg \left(z \leq 7.4 \cdot 10^{+28}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.20000000000000002e-16 or 7.3999999999999998e28 < z Initial program 96.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.9%
if -1.20000000000000002e-16 < z < 7.3999999999999998e28Initial program 99.1%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in x around inf 54.1%
Final simplification67.8%
(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(Float64(a / 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[(N[(a / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{a}{\left(t - z\right) + 1} \cdot \left(z - y\right)
\end{array}
Initial program 97.7%
clear-num97.6%
associate-/r/97.6%
clear-num97.9%
Applied egg-rr97.9%
Final simplification97.9%
(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.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 52.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 2024091
(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))))