
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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 - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - 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 a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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 - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ (- z t) (- z a))))) (if (<= t_1 1e+308) (+ x t_1) (- x (/ (* y t) (- z a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (z - a));
double tmp;
if (t_1 <= 1e+308) {
tmp = x + t_1;
} else {
tmp = x - ((y * t) / (z - 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 = y * ((z - t) / (z - a))
if (t_1 <= 1d+308) then
tmp = x + t_1
else
tmp = x - ((y * t) / (z - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (z - a));
double tmp;
if (t_1 <= 1e+308) {
tmp = x + t_1;
} else {
tmp = x - ((y * t) / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z - t) / (z - a)) tmp = 0 if t_1 <= 1e+308: tmp = x + t_1 else: tmp = x - ((y * t) / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(z - a))) tmp = 0.0 if (t_1 <= 1e+308) tmp = Float64(x + t_1); else tmp = Float64(x - Float64(Float64(y * t) / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z - t) / (z - a)); tmp = 0.0; if (t_1 <= 1e+308) tmp = x + t_1; else tmp = x - ((y * t) / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+308], N[(x + t$95$1), $MachinePrecision], N[(x - N[(N[(y * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 10^{+308}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot t}{z - a}\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < 1e308Initial program 98.7%
if 1e308 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) Initial program 67.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
mul-1-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.8e+46) (not (<= z 5.2e-46))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.8e+46) || !(z <= 5.2e-46)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (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.8d+46)) .or. (.not. (z <= 5.2d-46))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (t * (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.8e+46) || !(z <= 5.2e-46)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.8e+46) or not (z <= 5.2e-46): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.8e+46) || !(z <= 5.2e-46)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.8e+46) || ~((z <= 5.2e-46))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.8e+46], N[Not[LessEqual[z, 5.2e-46]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+46} \lor \neg \left(z \leq 5.2 \cdot 10^{-46}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -5.8000000000000004e46 or 5.2000000000000004e-46 < z Initial program 99.9%
Taylor expanded in a around 0 67.8%
associate-/l*88.1%
div-sub88.2%
*-inverses88.2%
Simplified88.2%
if -5.8000000000000004e46 < z < 5.2000000000000004e-46Initial program 93.9%
Taylor expanded in z around 0 70.6%
+-commutative70.6%
associate-/l*74.2%
Simplified74.2%
Final simplification81.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.9e+40) (+ x (/ y (/ (- z a) z))) (if (<= a 29500000000.0) (+ x (- y (* t (/ y z)))) (+ x (/ y (/ a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.9e+40) {
tmp = x + (y / ((z - a) / z));
} else if (a <= 29500000000.0) {
tmp = x + (y - (t * (y / z)));
} else {
tmp = x + (y / (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 (a <= (-6.9d+40)) then
tmp = x + (y / ((z - a) / z))
else if (a <= 29500000000.0d0) then
tmp = x + (y - (t * (y / z)))
else
tmp = x + (y / (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 (a <= -6.9e+40) {
tmp = x + (y / ((z - a) / z));
} else if (a <= 29500000000.0) {
tmp = x + (y - (t * (y / z)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.9e+40: tmp = x + (y / ((z - a) / z)) elif a <= 29500000000.0: tmp = x + (y - (t * (y / z))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.9e+40) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (a <= 29500000000.0) tmp = Float64(x + Float64(y - Float64(t * Float64(y / z)))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6.9e+40) tmp = x + (y / ((z - a) / z)); elseif (a <= 29500000000.0) tmp = x + (y - (t * (y / z))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.9e+40], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 29500000000.0], N[(x + N[(y - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.9 \cdot 10^{+40}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;a \leq 29500000000:\\
\;\;\;\;x + \left(y - t \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if a < -6.9000000000000003e40Initial program 99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 87.7%
if -6.9000000000000003e40 < a < 2.95e10Initial program 94.8%
Taylor expanded in y around 0 85.2%
*-lft-identity85.2%
associate-*l/85.1%
associate-*r*96.5%
associate-/r/96.5%
associate-*l/97.2%
*-lft-identity97.2%
Simplified97.2%
Taylor expanded in z around inf 83.5%
Taylor expanded in z around inf 79.8%
mul-1-neg79.8%
associate-*r/83.6%
unsub-neg83.6%
Simplified83.6%
if 2.95e10 < a Initial program 99.8%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 75.9%
Final simplification82.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.46e+41) (+ x (/ y (/ (- z a) z))) (if (<= a 5000000.0) (+ x (- y (* t (/ y z)))) (+ x (* (/ y a) (- t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.46e+41) {
tmp = x + (y / ((z - a) / z));
} else if (a <= 5000000.0) {
tmp = x + (y - (t * (y / z)));
} else {
tmp = x + ((y / a) * (t - 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 (a <= (-1.46d+41)) then
tmp = x + (y / ((z - a) / z))
else if (a <= 5000000.0d0) then
tmp = x + (y - (t * (y / z)))
else
tmp = x + ((y / a) * (t - z))
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.46e+41) {
tmp = x + (y / ((z - a) / z));
} else if (a <= 5000000.0) {
tmp = x + (y - (t * (y / z)));
} else {
tmp = x + ((y / a) * (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.46e+41: tmp = x + (y / ((z - a) / z)) elif a <= 5000000.0: tmp = x + (y - (t * (y / z))) else: tmp = x + ((y / a) * (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.46e+41) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (a <= 5000000.0) tmp = Float64(x + Float64(y - Float64(t * Float64(y / z)))); else tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.46e+41) tmp = x + (y / ((z - a) / z)); elseif (a <= 5000000.0) tmp = x + (y - (t * (y / z))); else tmp = x + ((y / a) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.46e+41], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5000000.0], N[(x + N[(y - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.46 \cdot 10^{+41}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;a \leq 5000000:\\
\;\;\;\;x + \left(y - t \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if a < -1.4600000000000001e41Initial program 99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 87.7%
if -1.4600000000000001e41 < a < 5e6Initial program 94.8%
Taylor expanded in y around 0 85.2%
*-lft-identity85.2%
associate-*l/85.1%
associate-*r*96.5%
associate-/r/96.5%
associate-*l/97.2%
*-lft-identity97.2%
Simplified97.2%
Taylor expanded in z around inf 83.5%
Taylor expanded in z around inf 79.8%
mul-1-neg79.8%
associate-*r/83.6%
unsub-neg83.6%
Simplified83.6%
if 5e6 < a Initial program 99.8%
Taylor expanded in a around inf 70.7%
mul-1-neg70.7%
unsub-neg70.7%
*-commutative70.7%
associate-/l*88.7%
Simplified88.7%
Final simplification85.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.2e+46) (+ x (* y (- 1.0 (/ t z)))) (if (<= z 1.05e+15) (+ x (* t (/ y (- a z)))) (+ x (/ y (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+46) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= 1.05e+15) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / ((z - a) / 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 <= (-5.2d+46)) then
tmp = x + (y * (1.0d0 - (t / z)))
else if (z <= 1.05d+15) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y / ((z - a) / 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 <= -5.2e+46) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= 1.05e+15) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.2e+46: tmp = x + (y * (1.0 - (t / z))) elif z <= 1.05e+15: tmp = x + (t * (y / (a - z))) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e+46) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); elseif (z <= 1.05e+15) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.2e+46) tmp = x + (y * (1.0 - (t / z))); elseif (z <= 1.05e+15) tmp = x + (t * (y / (a - z))); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+46], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e+15], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+46}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+15}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -5.20000000000000027e46Initial program 99.9%
Taylor expanded in a around 0 71.4%
associate-/l*94.1%
div-sub94.1%
*-inverses94.1%
Simplified94.1%
if -5.20000000000000027e46 < z < 1.05e15Initial program 94.4%
Taylor expanded in t around inf 87.3%
mul-1-neg87.3%
associate-/l*91.1%
Simplified91.1%
if 1.05e15 < z Initial program 99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 85.6%
Final simplification90.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.05e-265) (+ x y) (if (<= z 3.8e-292) (/ t (/ a y)) (if (<= z 4.1e-240) x (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e-265) {
tmp = x + y;
} else if (z <= 3.8e-292) {
tmp = t / (a / y);
} else if (z <= 4.1e-240) {
tmp = x;
} else {
tmp = x + y;
}
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-265)) then
tmp = x + y
else if (z <= 3.8d-292) then
tmp = t / (a / y)
else if (z <= 4.1d-240) then
tmp = x
else
tmp = x + y
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-265) {
tmp = x + y;
} else if (z <= 3.8e-292) {
tmp = t / (a / y);
} else if (z <= 4.1e-240) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e-265: tmp = x + y elif z <= 3.8e-292: tmp = t / (a / y) elif z <= 4.1e-240: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e-265) tmp = Float64(x + y); elseif (z <= 3.8e-292) tmp = Float64(t / Float64(a / y)); elseif (z <= 4.1e-240) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.05e-265) tmp = x + y; elseif (z <= 3.8e-292) tmp = t / (a / y); elseif (z <= 4.1e-240) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e-265], N[(x + y), $MachinePrecision], If[LessEqual[z, 3.8e-292], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e-240], x, N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-265}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-292}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-240}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.05000000000000002e-265 or 4.1000000000000001e-240 < z Initial program 97.9%
Taylor expanded in z around inf 65.0%
+-commutative65.0%
Simplified65.0%
if -1.05000000000000002e-265 < z < 3.8000000000000002e-292Initial program 79.4%
Taylor expanded in z around 0 89.5%
+-commutative89.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 79.4%
+-commutative79.4%
Simplified79.4%
Taylor expanded in x around 0 69.1%
*-commutative69.1%
associate-/r/89.5%
Applied egg-rr89.5%
if 3.8000000000000002e-292 < z < 4.1000000000000001e-240Initial program 91.6%
Taylor expanded in x around inf 73.2%
Final simplification66.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e+46) (not (<= z 1.05e-43))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+46) || !(z <= 1.05e-43)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-5.2d+46)) .or. (.not. (z <= 1.05d-43))) then
tmp = x + y
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+46) || !(z <= 1.05e-43)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.2e+46) or not (z <= 1.05e-43): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e+46) || !(z <= 1.05e-43)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.2e+46) || ~((z <= 1.05e-43))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e+46], N[Not[LessEqual[z, 1.05e-43]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+46} \lor \neg \left(z \leq 1.05 \cdot 10^{-43}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -5.20000000000000027e46 or 1.05e-43 < z Initial program 99.9%
Taylor expanded in z around inf 80.3%
+-commutative80.3%
Simplified80.3%
if -5.20000000000000027e46 < z < 1.05e-43Initial program 93.9%
Taylor expanded in z around 0 70.6%
*-commutative70.6%
associate-/l*72.2%
Simplified72.2%
Final simplification76.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e+46) (not (<= z 6e-43))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+46) || !(z <= 6e-43)) {
tmp = x + y;
} else {
tmp = x + (y / (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 <= (-5.2d+46)) .or. (.not. (z <= 6d-43))) then
tmp = x + y
else
tmp = x + (y / (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 <= -5.2e+46) || !(z <= 6e-43)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.2e+46) or not (z <= 6e-43): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e+46) || !(z <= 6e-43)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.2e+46) || ~((z <= 6e-43))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e+46], N[Not[LessEqual[z, 6e-43]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+46} \lor \neg \left(z \leq 6 \cdot 10^{-43}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -5.20000000000000027e46 or 6.00000000000000007e-43 < z Initial program 99.9%
Taylor expanded in z around inf 80.3%
+-commutative80.3%
Simplified80.3%
if -5.20000000000000027e46 < z < 6.00000000000000007e-43Initial program 93.9%
clear-num93.9%
un-div-inv94.9%
Applied egg-rr94.9%
Taylor expanded in z around 0 73.2%
Final simplification76.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e+46) (not (<= z 1.55e-45))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+46) || !(z <= 1.55e-45)) {
tmp = x + y;
} else {
tmp = x + (t * (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.2d+46)) .or. (.not. (z <= 1.55d-45))) then
tmp = x + y
else
tmp = x + (t * (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.2e+46) || !(z <= 1.55e-45)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.2e+46) or not (z <= 1.55e-45): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e+46) || !(z <= 1.55e-45)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.2e+46) || ~((z <= 1.55e-45))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e+46], N[Not[LessEqual[z, 1.55e-45]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+46} \lor \neg \left(z \leq 1.55 \cdot 10^{-45}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -5.20000000000000027e46 or 1.55e-45 < z Initial program 99.9%
Taylor expanded in z around inf 80.3%
+-commutative80.3%
Simplified80.3%
if -5.20000000000000027e46 < z < 1.55e-45Initial program 93.9%
Taylor expanded in z around 0 70.6%
+-commutative70.6%
associate-/l*74.2%
Simplified74.2%
Final simplification77.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y 1.65e+76) (not (<= y 5e+199))) (+ x y) (* y (/ t a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= 1.65e+76) || !(y <= 5e+199)) {
tmp = x + y;
} else {
tmp = y * (t / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= 1.65d+76) .or. (.not. (y <= 5d+199))) then
tmp = x + y
else
tmp = y * (t / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= 1.65e+76) || !(y <= 5e+199)) {
tmp = x + y;
} else {
tmp = y * (t / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= 1.65e+76) or not (y <= 5e+199): tmp = x + y else: tmp = y * (t / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= 1.65e+76) || !(y <= 5e+199)) tmp = Float64(x + y); else tmp = Float64(y * Float64(t / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= 1.65e+76) || ~((y <= 5e+199))) tmp = x + y; else tmp = y * (t / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, 1.65e+76], N[Not[LessEqual[y, 5e+199]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.65 \cdot 10^{+76} \lor \neg \left(y \leq 5 \cdot 10^{+199}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if y < 1.65e76 or 4.9999999999999998e199 < y Initial program 96.7%
Taylor expanded in z around inf 65.8%
+-commutative65.8%
Simplified65.8%
if 1.65e76 < y < 4.9999999999999998e199Initial program 99.8%
Taylor expanded in z around 0 54.8%
+-commutative54.8%
associate-/l*71.1%
Simplified71.1%
Taylor expanded in y around inf 71.3%
+-commutative71.3%
Simplified71.3%
Taylor expanded in x around 0 54.3%
Final simplification64.5%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (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 + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
Initial program 97.0%
clear-num97.0%
un-div-inv97.5%
Applied egg-rr97.5%
Final simplification97.5%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + 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 + y
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 97.0%
Taylor expanded in z around inf 61.2%
+-commutative61.2%
Simplified61.2%
Final simplification61.2%
(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.0%
Taylor expanded in x around inf 49.4%
Final simplification49.4%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (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 + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024077
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))