
(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 9 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 84.5%
associate-*l/98.9%
Simplified98.9%
Final simplification98.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.7e-102) (not (<= z 1.4e-15))) (+ x (* t (- 1.0 (/ y z)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.7e-102) || !(z <= 1.4e-15)) {
tmp = x + (t * (1.0 - (y / z)));
} 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.7d-102)) .or. (.not. (z <= 1.4d-15))) then
tmp = x + (t * (1.0d0 - (y / z)))
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.7e-102) || !(z <= 1.4e-15)) {
tmp = x + (t * (1.0 - (y / z)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.7e-102) or not (z <= 1.4e-15): tmp = x + (t * (1.0 - (y / z))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.7e-102) || !(z <= 1.4e-15)) tmp = Float64(x + Float64(t * Float64(1.0 - Float64(y / z)))); 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.7e-102) || ~((z <= 1.4e-15))) tmp = x + (t * (1.0 - (y / z))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.7e-102], N[Not[LessEqual[z, 1.4e-15]], $MachinePrecision]], N[(x + N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-102} \lor \neg \left(z \leq 1.4 \cdot 10^{-15}\right):\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.7e-102 or 1.40000000000000007e-15 < z Initial program 76.4%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 84.4%
associate-*r/84.4%
neg-mul-184.4%
Simplified84.4%
Taylor expanded in y around 0 84.4%
mul-1-neg84.4%
unsub-neg84.4%
Simplified84.4%
if -2.7e-102 < z < 1.40000000000000007e-15Initial program 97.0%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around 0 80.9%
associate-/l*79.2%
associate-/r/79.9%
Simplified79.9%
Final simplification82.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.2e-106) (not (<= z 8e+36))) (+ x (* t (- 1.0 (/ y z)))) (+ x (* (- y z) (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e-106) || !(z <= 8e+36)) {
tmp = x + (t * (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 ((z <= (-3.2d-106)) .or. (.not. (z <= 8d+36))) then
tmp = x + (t * (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 ((z <= -3.2e-106) || !(z <= 8e+36)) {
tmp = x + (t * (1.0 - (y / z)));
} else {
tmp = x + ((y - z) * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.2e-106) or not (z <= 8e+36): tmp = x + (t * (1.0 - (y / z))) else: tmp = x + ((y - z) * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.2e-106) || !(z <= 8e+36)) tmp = Float64(x + Float64(t * Float64(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 ((z <= -3.2e-106) || ~((z <= 8e+36))) tmp = x + (t * (1.0 - (y / z))); else tmp = x + ((y - z) * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e-106], N[Not[LessEqual[z, 8e+36]], $MachinePrecision]], N[(x + N[(t * N[(1.0 - 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}\;z \leq -3.2 \cdot 10^{-106} \lor \neg \left(z \leq 8 \cdot 10^{+36}\right):\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.2e-106 or 8.00000000000000034e36 < z Initial program 74.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 87.0%
associate-*r/87.0%
neg-mul-187.0%
Simplified87.0%
Taylor expanded in y around 0 87.0%
mul-1-neg87.0%
unsub-neg87.0%
Simplified87.0%
if -3.2e-106 < z < 8.00000000000000034e36Initial program 96.5%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in a around inf 79.6%
associate-/l*78.9%
associate-/r/79.4%
Simplified79.4%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -6.2e+70) (not (<= y 1.4e-25))) (+ x (* t (/ y (- a z)))) (+ x (/ t (- 1.0 (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -6.2e+70) || !(y <= 1.4e-25)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (t / (1.0 - (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 ((y <= (-6.2d+70)) .or. (.not. (y <= 1.4d-25))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (t / (1.0d0 - (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 ((y <= -6.2e+70) || !(y <= 1.4e-25)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (t / (1.0 - (a / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -6.2e+70) or not (y <= 1.4e-25): tmp = x + (t * (y / (a - z))) else: tmp = x + (t / (1.0 - (a / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -6.2e+70) || !(y <= 1.4e-25)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(t / Float64(1.0 - Float64(a / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -6.2e+70) || ~((y <= 1.4e-25))) tmp = x + (t * (y / (a - z))); else tmp = x + (t / (1.0 - (a / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -6.2e+70], N[Not[LessEqual[y, 1.4e-25]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+70} \lor \neg \left(y \leq 1.4 \cdot 10^{-25}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{1 - \frac{a}{z}}\\
\end{array}
\end{array}
if y < -6.2000000000000006e70 or 1.39999999999999994e-25 < y Initial program 81.7%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in y around inf 86.4%
if -6.2000000000000006e70 < y < 1.39999999999999994e-25Initial program 86.4%
associate-*l/99.4%
Simplified99.4%
Taylor expanded in y around 0 80.6%
mul-1-neg80.6%
associate-/l*93.5%
distribute-neg-frac93.5%
div-sub93.5%
*-inverses93.5%
Simplified93.5%
frac-2neg93.5%
div-inv93.5%
remove-double-neg93.5%
sub-neg93.5%
distribute-neg-in93.5%
metadata-eval93.5%
metadata-eval93.5%
Applied egg-rr93.5%
associate-*r/93.5%
*-rgt-identity93.5%
+-commutative93.5%
unsub-neg93.5%
Simplified93.5%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.7e-102) (+ x (* t (- 1.0 (/ y z)))) (if (<= z 6e+34) (+ x (* (- y z) (/ t a))) (+ x (* (/ t z) (- z y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e-102) {
tmp = x + (t * (1.0 - (y / z)));
} else if (z <= 6e+34) {
tmp = x + ((y - z) * (t / a));
} else {
tmp = x + ((t / z) * (z - 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 <= (-2.7d-102)) then
tmp = x + (t * (1.0d0 - (y / z)))
else if (z <= 6d+34) then
tmp = x + ((y - z) * (t / a))
else
tmp = x + ((t / z) * (z - 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 <= -2.7e-102) {
tmp = x + (t * (1.0 - (y / z)));
} else if (z <= 6e+34) {
tmp = x + ((y - z) * (t / a));
} else {
tmp = x + ((t / z) * (z - y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.7e-102: tmp = x + (t * (1.0 - (y / z))) elif z <= 6e+34: tmp = x + ((y - z) * (t / a)) else: tmp = x + ((t / z) * (z - y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.7e-102) tmp = Float64(x + Float64(t * Float64(1.0 - Float64(y / z)))); elseif (z <= 6e+34) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / a))); else tmp = Float64(x + Float64(Float64(t / z) * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.7e-102) tmp = x + (t * (1.0 - (y / z))); elseif (z <= 6e+34) tmp = x + ((y - z) * (t / a)); else tmp = x + ((t / z) * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.7e-102], N[(x + N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+34], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / z), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-102}:\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+34}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{z} \cdot \left(z - y\right)\\
\end{array}
\end{array}
if z < -2.7e-102Initial program 74.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 86.6%
associate-*r/86.6%
neg-mul-186.6%
Simplified86.6%
Taylor expanded in y around 0 86.6%
mul-1-neg86.6%
unsub-neg86.6%
Simplified86.6%
if -2.7e-102 < z < 6.00000000000000037e34Initial program 96.5%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in a around inf 79.6%
associate-/l*78.9%
associate-/r/79.4%
Simplified79.4%
if 6.00000000000000037e34 < z Initial program 74.6%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in a around 0 87.7%
associate-*r/87.7%
neg-mul-187.7%
Simplified87.7%
Taylor expanded in t around 0 63.5%
associate-/l*87.7%
associate-/r/89.0%
Simplified89.0%
Final simplification83.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.5e+21) (+ x (* t (- 1.0 (/ y z)))) (if (<= z 3.4e-15) (+ x (* t (/ y (- a z)))) (+ x (* (/ t z) (- z y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+21) {
tmp = x + (t * (1.0 - (y / z)));
} else if (z <= 3.4e-15) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + ((t / z) * (z - 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 <= (-8.5d+21)) then
tmp = x + (t * (1.0d0 - (y / z)))
else if (z <= 3.4d-15) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + ((t / z) * (z - 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 <= -8.5e+21) {
tmp = x + (t * (1.0 - (y / z)));
} else if (z <= 3.4e-15) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + ((t / z) * (z - y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.5e+21: tmp = x + (t * (1.0 - (y / z))) elif z <= 3.4e-15: tmp = x + (t * (y / (a - z))) else: tmp = x + ((t / z) * (z - y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+21) tmp = Float64(x + Float64(t * Float64(1.0 - Float64(y / z)))); elseif (z <= 3.4e-15) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(Float64(t / z) * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.5e+21) tmp = x + (t * (1.0 - (y / z))); elseif (z <= 3.4e-15) tmp = x + (t * (y / (a - z))); else tmp = x + ((t / z) * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+21], N[(x + N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e-15], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / z), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+21}:\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-15}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{z} \cdot \left(z - y\right)\\
\end{array}
\end{array}
if z < -8.5e21Initial program 69.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 87.5%
associate-*r/87.5%
neg-mul-187.5%
Simplified87.5%
Taylor expanded in y around 0 87.5%
mul-1-neg87.5%
unsub-neg87.5%
Simplified87.5%
if -8.5e21 < z < 3.4e-15Initial program 97.4%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in y around inf 89.7%
if 3.4e-15 < z Initial program 78.5%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in a around 0 81.5%
associate-*r/81.5%
neg-mul-181.5%
Simplified81.5%
Taylor expanded in t around 0 62.4%
associate-/l*81.4%
associate-/r/82.5%
Simplified82.5%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.5e-8) (not (<= z 1.18e-15))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.5e-8) || !(z <= 1.18e-15)) {
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.5d-8)) .or. (.not. (z <= 1.18d-15))) 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.5e-8) || !(z <= 1.18e-15)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.5e-8) or not (z <= 1.18e-15): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.5e-8) || !(z <= 1.18e-15)) 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.5e-8) || ~((z <= 1.18e-15))) 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.5e-8], N[Not[LessEqual[z, 1.18e-15]], $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.5 \cdot 10^{-8} \lor \neg \left(z \leq 1.18 \cdot 10^{-15}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.4999999999999999e-8 or 1.18000000000000004e-15 < z Initial program 74.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 72.3%
if -2.4999999999999999e-8 < z < 1.18000000000000004e-15Initial program 97.3%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in z around 0 81.0%
associate-/l*79.5%
associate-/r/80.1%
Simplified80.1%
Final simplification75.7%
(FPCore (x y z t a) :precision binary64 (if (<= a 4.5e+54) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 4.5e+54) {
tmp = x + 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 (a <= 4.5d+54) then
tmp = x + 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 (a <= 4.5e+54) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 4.5e+54: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 4.5e+54) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 4.5e+54) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 4.5e+54], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.5 \cdot 10^{+54}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 4.49999999999999984e54Initial program 84.0%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around inf 63.4%
if 4.49999999999999984e54 < a Initial program 86.4%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around 0 75.9%
associate-/l*75.9%
Simplified75.9%
Taylor expanded in x around inf 70.5%
Final simplification64.7%
(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 84.5%
associate-*l/98.9%
Simplified98.9%
Taylor expanded in z around 0 58.0%
associate-/l*57.8%
Simplified57.8%
Taylor expanded in x around inf 49.7%
Final simplification49.7%
(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 2023318
(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))))