
(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 13 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.6%
associate-/r/99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -60.0)
(- x (/ z (/ (+ -1.0 (- z t)) a)))
(if (<= t 3e+101)
(+ x (/ a (/ (+ z -1.0) (- y z))))
(- x (/ (- y z) (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -60.0) {
tmp = x - (z / ((-1.0 + (z - t)) / a));
} else if (t <= 3e+101) {
tmp = x + (a / ((z + -1.0) / (y - z)));
} else {
tmp = x - ((y - z) / (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 <= (-60.0d0)) then
tmp = x - (z / (((-1.0d0) + (z - t)) / a))
else if (t <= 3d+101) then
tmp = x + (a / ((z + (-1.0d0)) / (y - z)))
else
tmp = x - ((y - z) / (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 <= -60.0) {
tmp = x - (z / ((-1.0 + (z - t)) / a));
} else if (t <= 3e+101) {
tmp = x + (a / ((z + -1.0) / (y - z)));
} else {
tmp = x - ((y - z) / (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -60.0: tmp = x - (z / ((-1.0 + (z - t)) / a)) elif t <= 3e+101: tmp = x + (a / ((z + -1.0) / (y - z))) else: tmp = x - ((y - z) / (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -60.0) tmp = Float64(x - Float64(z / Float64(Float64(-1.0 + Float64(z - t)) / a))); elseif (t <= 3e+101) tmp = Float64(x + Float64(a / Float64(Float64(z + -1.0) / Float64(y - z)))); else tmp = Float64(x - Float64(Float64(y - z) / Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -60.0) tmp = x - (z / ((-1.0 + (z - t)) / a)); elseif (t <= 3e+101) tmp = x + (a / ((z + -1.0) / (y - z))); else tmp = x - ((y - z) / (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -60.0], N[(x - N[(z / N[(N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+101], N[(x + N[(a / N[(N[(z + -1.0), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - z), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -60:\\
\;\;\;\;x - \frac{z}{\frac{-1 + \left(z - t\right)}{a}}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+101}:\\
\;\;\;\;x + \frac{a}{\frac{z + -1}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - z}{\frac{t}{a}}\\
\end{array}
\end{array}
if t < -60Initial program 98.0%
Taylor expanded in y around 0 84.8%
neg-mul-184.8%
Simplified84.8%
if -60 < t < 2.99999999999999993e101Initial program 96.8%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 98.4%
if 2.99999999999999993e101 < t Initial program 99.8%
Taylor expanded in t around inf 89.4%
Final simplification94.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2000.0)
(+ x (/ a (/ (- t (+ z -1.0)) z)))
(if (<= t 2.5e+95)
(+ x (/ a (/ (+ z -1.0) (- y z))))
(- x (/ (- y z) (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2000.0) {
tmp = x + (a / ((t - (z + -1.0)) / z));
} else if (t <= 2.5e+95) {
tmp = x + (a / ((z + -1.0) / (y - z)));
} else {
tmp = x - ((y - z) / (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 <= (-2000.0d0)) then
tmp = x + (a / ((t - (z + (-1.0d0))) / z))
else if (t <= 2.5d+95) then
tmp = x + (a / ((z + (-1.0d0)) / (y - z)))
else
tmp = x - ((y - z) / (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 <= -2000.0) {
tmp = x + (a / ((t - (z + -1.0)) / z));
} else if (t <= 2.5e+95) {
tmp = x + (a / ((z + -1.0) / (y - z)));
} else {
tmp = x - ((y - z) / (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2000.0: tmp = x + (a / ((t - (z + -1.0)) / z)) elif t <= 2.5e+95: tmp = x + (a / ((z + -1.0) / (y - z))) else: tmp = x - ((y - z) / (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2000.0) tmp = Float64(x + Float64(a / Float64(Float64(t - Float64(z + -1.0)) / z))); elseif (t <= 2.5e+95) tmp = Float64(x + Float64(a / Float64(Float64(z + -1.0) / Float64(y - z)))); else tmp = Float64(x - Float64(Float64(y - z) / Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2000.0) tmp = x + (a / ((t - (z + -1.0)) / z)); elseif (t <= 2.5e+95) tmp = x + (a / ((z + -1.0) / (y - z))); else tmp = x - ((y - z) / (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2000.0], N[(x + N[(a / N[(N[(t - N[(z + -1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e+95], N[(x + N[(a / N[(N[(z + -1.0), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - z), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2000:\\
\;\;\;\;x + \frac{a}{\frac{t - \left(z + -1\right)}{z}}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+95}:\\
\;\;\;\;x + \frac{a}{\frac{z + -1}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - z}{\frac{t}{a}}\\
\end{array}
\end{array}
if t < -2e3Initial program 98.0%
associate-/r/98.0%
Simplified98.0%
Taylor expanded in y around 0 73.7%
sub-neg73.7%
mul-1-neg73.7%
*-commutative73.7%
associate--l+73.7%
+-commutative73.7%
associate-*r/84.7%
remove-double-neg84.7%
associate-*r/73.7%
*-commutative73.7%
+-commutative73.7%
associate--l+73.7%
associate-/l*82.9%
associate--l+82.9%
+-commutative82.9%
metadata-eval82.9%
sub-neg82.9%
associate--r+82.9%
+-commutative82.9%
Simplified82.9%
clear-num82.9%
un-div-inv83.0%
+-commutative83.0%
Applied egg-rr83.0%
if -2e3 < t < 2.50000000000000012e95Initial program 96.8%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 98.4%
if 2.50000000000000012e95 < t Initial program 99.8%
Taylor expanded in t around inf 89.4%
Final simplification93.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1050.0)
(+ x (/ (- y z) (/ z a)))
(if (<= z 1.7e-102)
(+ x (* a (/ y (- -1.0 t))))
(+ x (* a (/ z (+ t (- 1.0 z))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1050.0) {
tmp = x + ((y - z) / (z / a));
} else if (z <= 1.7e-102) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + (a * (z / (t + (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 <= (-1050.0d0)) then
tmp = x + ((y - z) / (z / a))
else if (z <= 1.7d-102) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x + (a * (z / (t + (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 <= -1050.0) {
tmp = x + ((y - z) / (z / a));
} else if (z <= 1.7e-102) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + (a * (z / (t + (1.0 - z))));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1050.0: tmp = x + ((y - z) / (z / a)) elif z <= 1.7e-102: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x + (a * (z / (t + (1.0 - z)))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1050.0) tmp = Float64(x + Float64(Float64(y - z) / Float64(z / a))); elseif (z <= 1.7e-102) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x + Float64(a * Float64(z / Float64(t + Float64(1.0 - z))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1050.0) tmp = x + ((y - z) / (z / a)); elseif (z <= 1.7e-102) tmp = x + (a * (y / (-1.0 - t))); else tmp = x + (a * (z / (t + (1.0 - z)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1050.0], N[(x + N[(N[(y - z), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-102], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(z / N[(t + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1050:\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-102}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z}{t + \left(1 - z\right)}\\
\end{array}
\end{array}
if z < -1050Initial program 97.1%
Taylor expanded in z around inf 93.2%
associate-*r/93.2%
neg-mul-193.2%
Simplified93.2%
if -1050 < z < 1.70000000000000006e-102Initial program 98.8%
associate-/r/98.9%
Simplified98.9%
Taylor expanded in z around 0 95.2%
if 1.70000000000000006e-102 < z Initial program 96.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 65.1%
sub-neg65.1%
mul-1-neg65.1%
*-commutative65.1%
associate--l+65.1%
+-commutative65.1%
associate-*r/82.2%
remove-double-neg82.2%
associate-*r/65.1%
*-commutative65.1%
+-commutative65.1%
associate--l+65.1%
associate-/l*83.3%
associate--l+83.3%
+-commutative83.3%
metadata-eval83.3%
sub-neg83.3%
associate--r+83.3%
+-commutative83.3%
Simplified83.3%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e+19) (not (<= z 8e-21))) (- x (* a (/ z (- z t)))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e+19) || !(z <= 8e-21)) {
tmp = x - (a * (z / (z - t)));
} 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.75d+19)) .or. (.not. (z <= 8d-21))) then
tmp = x - (a * (z / (z - t)))
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.75e+19) || !(z <= 8e-21)) {
tmp = x - (a * (z / (z - t)));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e+19) or not (z <= 8e-21): tmp = x - (a * (z / (z - t))) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e+19) || !(z <= 8e-21)) tmp = Float64(x - Float64(a * Float64(z / Float64(z - t)))); 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.75e+19) || ~((z <= 8e-21))) tmp = x - (a * (z / (z - t))); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e+19], N[Not[LessEqual[z, 8e-21]], $MachinePrecision]], N[(x - N[(a * N[(z / N[(z - t), $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 -1.75 \cdot 10^{+19} \lor \neg \left(z \leq 8 \cdot 10^{-21}\right):\\
\;\;\;\;x - a \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -1.75e19 or 7.99999999999999926e-21 < z Initial program 96.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 61.1%
sub-neg61.1%
mul-1-neg61.1%
*-commutative61.1%
associate--l+61.1%
+-commutative61.1%
associate-*r/81.5%
remove-double-neg81.5%
associate-*r/61.1%
*-commutative61.1%
+-commutative61.1%
associate--l+61.1%
associate-/l*83.8%
associate--l+83.8%
+-commutative83.8%
metadata-eval83.8%
sub-neg83.8%
associate--r+83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in z around inf 83.4%
if -1.75e19 < z < 7.99999999999999926e-21Initial program 99.0%
associate-/r/99.1%
Simplified99.1%
Taylor expanded in z around 0 90.6%
Final simplification86.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -86000.0) (not (<= z 6.8e-63))) (- x (* a (/ z (- z t)))) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -86000.0) || !(z <= 6.8e-63)) {
tmp = x - (a * (z / (z - t)));
} 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 <= (-86000.0d0)) .or. (.not. (z <= 6.8d-63))) then
tmp = x - (a * (z / (z - t)))
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 <= -86000.0) || !(z <= 6.8e-63)) {
tmp = x - (a * (z / (z - t)));
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -86000.0) or not (z <= 6.8e-63): tmp = x - (a * (z / (z - t))) else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -86000.0) || !(z <= 6.8e-63)) tmp = Float64(x - Float64(a * Float64(z / Float64(z - t)))); 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 <= -86000.0) || ~((z <= 6.8e-63))) tmp = x - (a * (z / (z - t))); else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -86000.0], N[Not[LessEqual[z, 6.8e-63]], $MachinePrecision]], N[(x - N[(a * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -86000 \lor \neg \left(z \leq 6.8 \cdot 10^{-63}\right):\\
\;\;\;\;x - a \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -86000 or 6.79999999999999997e-63 < z Initial program 96.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 63.2%
sub-neg63.2%
mul-1-neg63.2%
*-commutative63.2%
associate--l+63.2%
+-commutative63.2%
associate-*r/81.9%
remove-double-neg81.9%
associate-*r/63.2%
*-commutative63.2%
+-commutative63.2%
associate--l+63.2%
associate-/l*83.9%
associate--l+83.9%
+-commutative83.9%
metadata-eval83.9%
sub-neg83.9%
associate--r+83.9%
+-commutative83.9%
Simplified83.9%
Taylor expanded in z around inf 82.8%
if -86000 < z < 6.79999999999999997e-63Initial program 98.9%
associate-/r/99.0%
Simplified99.0%
*-commutative99.0%
clear-num98.9%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in t around 0 79.1%
Taylor expanded in z around 0 74.9%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -300.0) (not (<= z 1.7e-102))) (- x (* a (/ z (+ z -1.0)))) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -300.0) || !(z <= 1.7e-102)) {
tmp = x - (a * (z / (z + -1.0)));
} 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 <= (-300.0d0)) .or. (.not. (z <= 1.7d-102))) then
tmp = x - (a * (z / (z + (-1.0d0))))
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 <= -300.0) || !(z <= 1.7e-102)) {
tmp = x - (a * (z / (z + -1.0)));
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -300.0) or not (z <= 1.7e-102): tmp = x - (a * (z / (z + -1.0))) else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -300.0) || !(z <= 1.7e-102)) tmp = Float64(x - Float64(a * Float64(z / Float64(z + -1.0)))); 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 <= -300.0) || ~((z <= 1.7e-102))) tmp = x - (a * (z / (z + -1.0))); else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -300.0], N[Not[LessEqual[z, 1.7e-102]], $MachinePrecision]], N[(x - N[(a * N[(z / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -300 \lor \neg \left(z \leq 1.7 \cdot 10^{-102}\right):\\
\;\;\;\;x - a \cdot \frac{z}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -300 or 1.70000000000000006e-102 < z Initial program 96.9%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 89.1%
Taylor expanded in y around 0 57.8%
sub-neg57.8%
mul-1-neg57.8%
remove-double-neg57.8%
associate-/l*75.7%
Simplified75.7%
if -300 < z < 1.70000000000000006e-102Initial program 98.8%
associate-/r/98.9%
Simplified98.9%
*-commutative98.9%
clear-num98.8%
un-div-inv98.8%
Applied egg-rr98.8%
Taylor expanded in t around 0 79.2%
Taylor expanded in z around 0 77.8%
Final simplification76.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -6800.0) (+ x (/ (- y z) (/ z a))) (if (<= z 8e-21) (+ x (* a (/ y (- -1.0 t)))) (- x (* a (/ z (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6800.0) {
tmp = x + ((y - z) / (z / a));
} else if (z <= 8e-21) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x - (a * (z / (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 (z <= (-6800.0d0)) then
tmp = x + ((y - z) / (z / a))
else if (z <= 8d-21) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x - (a * (z / (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 (z <= -6800.0) {
tmp = x + ((y - z) / (z / a));
} else if (z <= 8e-21) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x - (a * (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6800.0: tmp = x + ((y - z) / (z / a)) elif z <= 8e-21: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x - (a * (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6800.0) tmp = Float64(x + Float64(Float64(y - z) / Float64(z / a))); elseif (z <= 8e-21) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x - Float64(a * Float64(z / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6800.0) tmp = x + ((y - z) / (z / a)); elseif (z <= 8e-21) tmp = x + (a * (y / (-1.0 - t))); else tmp = x - (a * (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6800.0], N[(x + N[(N[(y - z), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-21], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6800:\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-21}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -6800Initial program 97.1%
Taylor expanded in z around inf 93.2%
associate-*r/93.2%
neg-mul-193.2%
Simplified93.2%
if -6800 < z < 7.99999999999999926e-21Initial program 98.9%
associate-/r/99.1%
Simplified99.1%
Taylor expanded in z around 0 91.8%
if 7.99999999999999926e-21 < z Initial program 95.9%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around 0 59.7%
sub-neg59.7%
mul-1-neg59.7%
*-commutative59.7%
associate--l+59.7%
+-commutative59.7%
associate-*r/81.4%
remove-double-neg81.4%
associate-*r/59.7%
*-commutative59.7%
+-commutative59.7%
associate--l+59.7%
associate-/l*82.9%
associate--l+82.9%
+-commutative82.9%
metadata-eval82.9%
sub-neg82.9%
associate--r+82.9%
+-commutative82.9%
Simplified82.9%
Taylor expanded in z around inf 82.1%
Final simplification89.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3300000.0) (not (<= z 0.0006))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3300000.0) || !(z <= 0.0006)) {
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 <= (-3300000.0d0)) .or. (.not. (z <= 0.0006d0))) 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 <= -3300000.0) || !(z <= 0.0006)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3300000.0) or not (z <= 0.0006): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3300000.0) || !(z <= 0.0006)) 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 <= -3300000.0) || ~((z <= 0.0006))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3300000.0], N[Not[LessEqual[z, 0.0006]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3300000 \lor \neg \left(z \leq 0.0006\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -3.3e6 or 5.99999999999999947e-4 < z Initial program 96.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 75.6%
if -3.3e6 < z < 5.99999999999999947e-4Initial program 99.0%
associate-/r/99.1%
Simplified99.1%
*-commutative99.1%
clear-num99.0%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in t around 0 79.6%
Taylor expanded in z around 0 75.0%
Final simplification75.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -75.0) (not (<= z 8.2e+42))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -75.0) || !(z <= 8.2e+42)) {
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 <= (-75.0d0)) .or. (.not. (z <= 8.2d+42))) 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 <= -75.0) || !(z <= 8.2e+42)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -75.0) or not (z <= 8.2e+42): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -75.0) || !(z <= 8.2e+42)) 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 <= -75.0) || ~((z <= 8.2e+42))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -75.0], N[Not[LessEqual[z, 8.2e+42]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -75 \lor \neg \left(z \leq 8.2 \cdot 10^{+42}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -75 or 8.2000000000000001e42 < z Initial program 96.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.6%
if -75 < z < 8.2000000000000001e42Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
associate-/r/99.1%
distribute-rgt-neg-in99.1%
associate-*l/95.6%
associate-/l*99.8%
fma-define99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
distribute-neg-in99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around 0 55.9%
Final simplification66.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.7e+113) (not (<= a 5.6e+199))) (- a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.7e+113) || !(a <= 5.6e+199)) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2.7d+113)) .or. (.not. (a <= 5.6d+199))) then
tmp = -a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.7e+113) || !(a <= 5.6e+199)) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.7e+113) or not (a <= 5.6e+199): tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.7e+113) || !(a <= 5.6e+199)) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.7e+113) || ~((a <= 5.6e+199))) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.7e+113], N[Not[LessEqual[a, 5.6e+199]], $MachinePrecision]], (-a), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{+113} \lor \neg \left(a \leq 5.6 \cdot 10^{+199}\right):\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.70000000000000011e113 or 5.6000000000000002e199 < a Initial program 99.7%
associate-/r/98.2%
Simplified98.2%
Taylor expanded in z around inf 43.3%
Taylor expanded in x around 0 37.7%
neg-mul-137.7%
Simplified37.7%
if -2.70000000000000011e113 < a < 5.6000000000000002e199Initial program 97.0%
sub-neg97.0%
+-commutative97.0%
associate-/r/99.9%
distribute-rgt-neg-in99.9%
associate-*l/91.8%
associate-/l*97.9%
fma-define97.9%
distribute-frac-neg97.9%
distribute-neg-frac297.9%
distribute-neg-in97.9%
sub-neg97.9%
distribute-neg-in97.9%
remove-double-neg97.9%
+-commutative97.9%
sub-neg97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in a around 0 63.7%
Final simplification58.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 97.6%
sub-neg97.6%
+-commutative97.6%
associate-/r/99.5%
distribute-rgt-neg-in99.5%
associate-*l/82.6%
associate-/l*98.3%
fma-define98.3%
distribute-frac-neg98.3%
distribute-neg-frac298.3%
distribute-neg-in98.3%
sub-neg98.3%
distribute-neg-in98.3%
remove-double-neg98.3%
+-commutative98.3%
sub-neg98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in a around 0 52.8%
(FPCore (x y z t a) :precision binary64 a)
double code(double x, double y, double z, double t, double a) {
return 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 = a
end function
public static double code(double x, double y, double z, double t, double a) {
return a;
}
def code(x, y, z, t, a): return a
function code(x, y, z, t, a) return a end
function tmp = code(x, y, z, t, a) tmp = a; end
code[x_, y_, z_, t_, a_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 97.6%
associate-/r/99.5%
Simplified99.5%
Taylor expanded in z around inf 61.5%
Taylor expanded in x around 0 18.0%
neg-mul-118.0%
Simplified18.0%
neg-sub018.0%
sub-neg18.0%
add-sqr-sqrt9.4%
sqrt-unprod8.2%
sqr-neg8.2%
sqrt-unprod1.5%
add-sqr-sqrt3.3%
Applied egg-rr3.3%
+-lft-identity3.3%
Simplified3.3%
(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 2024185
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (- x (* (/ (- y z) (+ (- t z) 1)) a)))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))