
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
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) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
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) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(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(Float64(Float64(y - z) / Float64(a - 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[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - z}{a - z} \cdot t
\end{array}
Initial program 87.0%
associate-*l/98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.7e-47)
(+ x t)
(if (<= z 1.7e-13)
(+ x (* y (/ t a)))
(if (<= z 1.72e+78) (- x (/ y (/ z t))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.7e-47) {
tmp = x + t;
} else if (z <= 1.7e-13) {
tmp = x + (y * (t / a));
} else if (z <= 1.72e+78) {
tmp = x - (y / (z / t));
} else {
tmp = x + 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 <= (-3.7d-47)) then
tmp = x + t
else if (z <= 1.7d-13) then
tmp = x + (y * (t / a))
else if (z <= 1.72d+78) then
tmp = x - (y / (z / t))
else
tmp = x + 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 <= -3.7e-47) {
tmp = x + t;
} else if (z <= 1.7e-13) {
tmp = x + (y * (t / a));
} else if (z <= 1.72e+78) {
tmp = x - (y / (z / t));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.7e-47: tmp = x + t elif z <= 1.7e-13: tmp = x + (y * (t / a)) elif z <= 1.72e+78: tmp = x - (y / (z / t)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.7e-47) tmp = Float64(x + t); elseif (z <= 1.7e-13) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 1.72e+78) tmp = Float64(x - Float64(y / Float64(z / t))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.7e-47) tmp = x + t; elseif (z <= 1.7e-13) tmp = x + (y * (t / a)); elseif (z <= 1.72e+78) tmp = x - (y / (z / t)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.7e-47], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.7e-13], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.72e+78], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-47}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-13}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1.72 \cdot 10^{+78}:\\
\;\;\;\;x - \frac{y}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -3.7e-47 or 1.71999999999999997e78 < z Initial program 73.3%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 83.2%
if -3.7e-47 < z < 1.70000000000000008e-13Initial program 98.2%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in z around 0 79.4%
associate-/l*79.4%
div-inv79.4%
clear-num79.4%
Applied egg-rr79.4%
if 1.70000000000000008e-13 < z < 1.71999999999999997e78Initial program 99.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around inf 93.3%
Taylor expanded in a around 0 89.5%
+-commutative89.5%
mul-1-neg89.5%
unsub-neg89.5%
associate-/l*89.5%
Simplified89.5%
Final simplification82.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.15e-48)
(+ x t)
(if (<= z 1.85e-133)
(+ x (* y (/ t a)))
(if (<= z 8.2e+77) (- x (/ (* y t) z)) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.15e-48) {
tmp = x + t;
} else if (z <= 1.85e-133) {
tmp = x + (y * (t / a));
} else if (z <= 8.2e+77) {
tmp = x - ((y * t) / z);
} else {
tmp = x + 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 <= (-2.15d-48)) then
tmp = x + t
else if (z <= 1.85d-133) then
tmp = x + (y * (t / a))
else if (z <= 8.2d+77) then
tmp = x - ((y * t) / z)
else
tmp = x + 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 <= -2.15e-48) {
tmp = x + t;
} else if (z <= 1.85e-133) {
tmp = x + (y * (t / a));
} else if (z <= 8.2e+77) {
tmp = x - ((y * t) / z);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.15e-48: tmp = x + t elif z <= 1.85e-133: tmp = x + (y * (t / a)) elif z <= 8.2e+77: tmp = x - ((y * t) / z) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.15e-48) tmp = Float64(x + t); elseif (z <= 1.85e-133) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 8.2e+77) tmp = Float64(x - Float64(Float64(y * t) / z)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.15e-48) tmp = x + t; elseif (z <= 1.85e-133) tmp = x + (y * (t / a)); elseif (z <= 8.2e+77) tmp = x - ((y * t) / z); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.15e-48], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.85e-133], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e+77], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{-48}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-133}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+77}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.15e-48 or 8.2000000000000002e77 < z Initial program 73.3%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 83.2%
if -2.15e-48 < z < 1.85000000000000018e-133Initial program 97.7%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in z around 0 81.3%
associate-/l*82.3%
div-inv82.3%
clear-num82.4%
Applied egg-rr82.4%
if 1.85000000000000018e-133 < z < 8.2000000000000002e77Initial program 99.8%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in a around 0 78.4%
associate-*r/78.4%
neg-mul-178.4%
Simplified78.4%
Taylor expanded in y around inf 79.3%
associate-*r/79.3%
neg-mul-179.3%
distribute-rgt-neg-in79.3%
Simplified79.3%
div-inv79.2%
add-sqr-sqrt37.5%
sqrt-unprod61.6%
sqr-neg61.6%
sqrt-unprod28.9%
add-sqr-sqrt53.5%
distribute-rgt-neg-in53.5%
cancel-sign-sub-inv53.5%
div-inv53.5%
add-sqr-sqrt28.9%
sqrt-unprod61.6%
sqr-neg61.6%
sqrt-unprod37.6%
add-sqr-sqrt79.3%
Applied egg-rr79.3%
Final simplification82.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.4e+95) (not (<= z 6.5e+86))) (+ x t) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.4e+95) || !(z <= 6.5e+86)) {
tmp = x + t;
} else {
tmp = x + (t * (y / (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 <= (-1.4d+95)) .or. (.not. (z <= 6.5d+86))) then
tmp = x + t
else
tmp = x + (t * (y / (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 <= -1.4e+95) || !(z <= 6.5e+86)) {
tmp = x + t;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.4e+95) or not (z <= 6.5e+86): tmp = x + t else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.4e+95) || !(z <= 6.5e+86)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.4e+95) || ~((z <= 6.5e+86))) tmp = x + t; else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.4e+95], N[Not[LessEqual[z, 6.5e+86]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+95} \lor \neg \left(z \leq 6.5 \cdot 10^{+86}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.3999999999999999e95 or 6.49999999999999996e86 < z Initial program 67.3%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 89.9%
if -1.3999999999999999e95 < z < 6.49999999999999996e86Initial program 97.6%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in y around inf 88.3%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e-23) (not (<= z 0.0016))) (+ x (- t (/ y (/ z t)))) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e-23) || !(z <= 0.0016)) {
tmp = x + (t - (y / (z / t)));
} else {
tmp = x + ((y * t) / (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 <= (-3.5d-23)) .or. (.not. (z <= 0.0016d0))) then
tmp = x + (t - (y / (z / t)))
else
tmp = x + ((y * t) / (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 <= -3.5e-23) || !(z <= 0.0016)) {
tmp = x + (t - (y / (z / t)));
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e-23) or not (z <= 0.0016): tmp = x + (t - (y / (z / t))) else: tmp = x + ((y * t) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.5e-23) || !(z <= 0.0016)) tmp = Float64(x + Float64(t - Float64(y / Float64(z / t)))); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.5e-23) || ~((z <= 0.0016))) tmp = x + (t - (y / (z / t))); else tmp = x + ((y * t) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.5e-23], N[Not[LessEqual[z, 0.0016]], $MachinePrecision]], N[(x + N[(t - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-23} \lor \neg \left(z \leq 0.0016\right):\\
\;\;\;\;x + \left(t - \frac{y}{\frac{z}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -3.49999999999999993e-23 or 0.00160000000000000008 < z Initial program 76.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 92.0%
associate-*r/92.0%
neg-mul-192.0%
Simplified92.0%
Taylor expanded in y around 0 83.9%
associate-+r+83.9%
+-commutative83.9%
mul-1-neg83.9%
unsub-neg83.9%
associate-/l*92.0%
Simplified92.0%
if -3.49999999999999993e-23 < z < 0.00160000000000000008Initial program 98.3%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in y around inf 91.6%
Final simplification91.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -8e+93) (+ x t) (if (<= z 4.6e+88) (+ x (/ (* y t) (- a z))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e+93) {
tmp = x + t;
} else if (z <= 4.6e+88) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + 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 <= (-8d+93)) then
tmp = x + t
else if (z <= 4.6d+88) then
tmp = x + ((y * t) / (a - z))
else
tmp = x + 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 <= -8e+93) {
tmp = x + t;
} else if (z <= 4.6e+88) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8e+93: tmp = x + t elif z <= 4.6e+88: tmp = x + ((y * t) / (a - z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e+93) tmp = Float64(x + t); elseif (z <= 4.6e+88) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8e+93) tmp = x + t; elseif (z <= 4.6e+88) tmp = x + ((y * t) / (a - z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e+93], N[(x + t), $MachinePrecision], If[LessEqual[z, 4.6e+88], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+93}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+88}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -8.00000000000000035e93 or 4.6000000000000003e88 < z Initial program 67.3%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 89.9%
if -8.00000000000000035e93 < z < 4.6000000000000003e88Initial program 97.6%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in y around inf 89.0%
Final simplification89.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.5e+71) (not (<= t 7e+200))) (* t (- 1.0 (/ y z))) (+ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.5e+71) || !(t <= 7e+200)) {
tmp = t * (1.0 - (y / z));
} else {
tmp = x + 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 <= (-4.5d+71)) .or. (.not. (t <= 7d+200))) then
tmp = t * (1.0d0 - (y / z))
else
tmp = x + 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 <= -4.5e+71) || !(t <= 7e+200)) {
tmp = t * (1.0 - (y / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.5e+71) or not (t <= 7e+200): tmp = t * (1.0 - (y / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.5e+71) || !(t <= 7e+200)) tmp = Float64(t * Float64(1.0 - Float64(y / z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.5e+71) || ~((t <= 7e+200))) tmp = t * (1.0 - (y / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.5e+71], N[Not[LessEqual[t, 7e+200]], $MachinePrecision]], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+71} \lor \neg \left(t \leq 7 \cdot 10^{+200}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if t < -4.50000000000000043e71 or 7.00000000000000013e200 < t Initial program 60.6%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in a around 0 66.3%
associate-*r/66.3%
neg-mul-166.3%
Simplified66.3%
Taylor expanded in t around inf 57.5%
if -4.50000000000000043e71 < t < 7.00000000000000013e200Initial program 94.2%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in z around inf 70.1%
Final simplification67.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.05e-47) (not (<= z 65000000000000.0))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.05e-47) || !(z <= 65000000000000.0)) {
tmp = x + t;
} 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 <= (-2.05d-47)) .or. (.not. (z <= 65000000000000.0d0))) then
tmp = x + t
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 <= -2.05e-47) || !(z <= 65000000000000.0)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.05e-47) or not (z <= 65000000000000.0): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.05e-47) || !(z <= 65000000000000.0)) tmp = Float64(x + t); 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 <= -2.05e-47) || ~((z <= 65000000000000.0))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.05e-47], N[Not[LessEqual[z, 65000000000000.0]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{-47} \lor \neg \left(z \leq 65000000000000\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.05000000000000001e-47 or 6.5e13 < z Initial program 76.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.5%
if -2.05000000000000001e-47 < z < 6.5e13Initial program 98.3%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in z around 0 77.8%
associate-/l*77.8%
div-inv77.8%
clear-num77.8%
Applied egg-rr77.8%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -8e-48) (+ x t) (if (<= z 1.55e-5) (+ x (* t (/ y a))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e-48) {
tmp = x + t;
} else if (z <= 1.55e-5) {
tmp = x + (t * (y / a));
} else {
tmp = x + 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 <= (-8d-48)) then
tmp = x + t
else if (z <= 1.55d-5) then
tmp = x + (t * (y / a))
else
tmp = x + 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 <= -8e-48) {
tmp = x + t;
} else if (z <= 1.55e-5) {
tmp = x + (t * (y / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8e-48: tmp = x + t elif z <= 1.55e-5: tmp = x + (t * (y / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e-48) tmp = Float64(x + t); elseif (z <= 1.55e-5) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8e-48) tmp = x + t; elseif (z <= 1.55e-5) tmp = x + (t * (y / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e-48], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.55e-5], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-48}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-5}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -7.9999999999999998e-48 or 1.55000000000000007e-5 < z Initial program 77.0%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.5%
if -7.9999999999999998e-48 < z < 1.55000000000000007e-5Initial program 98.3%
associate-*l/95.9%
Simplified95.9%
Taylor expanded in z around 0 75.9%
Final simplification78.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.05e-97) (+ x t) (if (<= z 1.35e+25) x (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.05e-97) {
tmp = x + t;
} else if (z <= 1.35e+25) {
tmp = x;
} else {
tmp = x + 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 <= (-2.05d-97)) then
tmp = x + t
else if (z <= 1.35d+25) then
tmp = x
else
tmp = x + 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 <= -2.05e-97) {
tmp = x + t;
} else if (z <= 1.35e+25) {
tmp = x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.05e-97: tmp = x + t elif z <= 1.35e+25: tmp = x else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.05e-97) tmp = Float64(x + t); elseif (z <= 1.35e+25) tmp = x; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.05e-97) tmp = x + t; elseif (z <= 1.35e+25) tmp = x; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.05e-97], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.35e+25], x, N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{-97}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+25}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.04999999999999996e-97 or 1.35e25 < z Initial program 77.3%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.0%
if -2.04999999999999996e-97 < z < 1.35e25Initial program 98.2%
associate-*l/95.9%
Simplified95.9%
Taylor expanded in x around inf 54.7%
Final simplification67.3%
(FPCore (x y z t a) :precision binary64 (if (<= x -5.8e-163) x (if (<= x 2.4e-88) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -5.8e-163) {
tmp = x;
} else if (x <= 2.4e-88) {
tmp = t;
} 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 (x <= (-5.8d-163)) then
tmp = x
else if (x <= 2.4d-88) then
tmp = t
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 (x <= -5.8e-163) {
tmp = x;
} else if (x <= 2.4e-88) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -5.8e-163: tmp = x elif x <= 2.4e-88: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -5.8e-163) tmp = x; elseif (x <= 2.4e-88) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -5.8e-163) tmp = x; elseif (x <= 2.4e-88) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -5.8e-163], x, If[LessEqual[x, 2.4e-88], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-163}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-88}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.8000000000000002e-163 or 2.4e-88 < x Initial program 88.2%
associate-*l/98.9%
Simplified98.9%
Taylor expanded in x around inf 66.7%
if -5.8000000000000002e-163 < x < 2.4e-88Initial program 84.2%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in a around 0 61.7%
associate-*r/61.7%
neg-mul-161.7%
Simplified61.7%
Taylor expanded in t around inf 53.8%
Taylor expanded in y around 0 36.7%
Final simplification57.6%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 87.0%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in a around 0 70.3%
associate-*r/70.3%
neg-mul-170.3%
Simplified70.3%
Taylor expanded in t around inf 31.1%
Taylor expanded in y around 0 18.6%
Final simplification18.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
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 + (((y - z) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023240
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))