
(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 11 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 88.1%
associate-*l/98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.9e-63) (not (<= a 3.45e-136))) (+ x (/ y (/ (- a z) t))) (+ x (* t (- 1.0 (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.9e-63) || !(a <= 3.45e-136)) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + (t * (1.0 - (y / 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 <= (-6.9d-63)) .or. (.not. (a <= 3.45d-136))) then
tmp = x + (y / ((a - z) / t))
else
tmp = x + (t * (1.0d0 - (y / 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 <= -6.9e-63) || !(a <= 3.45e-136)) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + (t * (1.0 - (y / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6.9e-63) or not (a <= 3.45e-136): tmp = x + (y / ((a - z) / t)) else: tmp = x + (t * (1.0 - (y / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.9e-63) || !(a <= 3.45e-136)) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); else tmp = Float64(x + Float64(t * Float64(1.0 - Float64(y / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -6.9e-63) || ~((a <= 3.45e-136))) tmp = x + (y / ((a - z) / t)); else tmp = x + (t * (1.0 - (y / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.9e-63], N[Not[LessEqual[a, 3.45e-136]], $MachinePrecision]], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.9 \cdot 10^{-63} \lor \neg \left(a \leq 3.45 \cdot 10^{-136}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if a < -6.9e-63 or 3.4500000000000002e-136 < a Initial program 87.5%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in y around inf 81.1%
associate-/l*86.6%
Simplified86.6%
if -6.9e-63 < a < 3.4500000000000002e-136Initial program 89.3%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in a around 0 91.3%
associate-*r/91.3%
neg-mul-191.3%
neg-sub091.3%
associate--r-91.3%
neg-sub091.3%
Simplified91.3%
Taylor expanded in y around 0 91.3%
+-commutative91.3%
mul-1-neg91.3%
unsub-neg91.3%
Simplified91.3%
Final simplification88.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.45e+76) (+ x (* y (/ t a))) (if (<= a 2050000000.0) (+ x (* t (- 1.0 (/ y z)))) (+ x (* t (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.45e+76) {
tmp = x + (y * (t / a));
} else if (a <= 2050000000.0) {
tmp = x + (t * (1.0 - (y / 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 (a <= (-2.45d+76)) then
tmp = x + (y * (t / a))
else if (a <= 2050000000.0d0) then
tmp = x + (t * (1.0d0 - (y / 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 (a <= -2.45e+76) {
tmp = x + (y * (t / a));
} else if (a <= 2050000000.0) {
tmp = x + (t * (1.0 - (y / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.45e+76: tmp = x + (y * (t / a)) elif a <= 2050000000.0: tmp = x + (t * (1.0 - (y / z))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.45e+76) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (a <= 2050000000.0) tmp = Float64(x + Float64(t * Float64(1.0 - Float64(y / 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 (a <= -2.45e+76) tmp = x + (y * (t / a)); elseif (a <= 2050000000.0) tmp = x + (t * (1.0 - (y / z))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.45e+76], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2050000000.0], N[(x + N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.45 \cdot 10^{+76}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;a \leq 2050000000:\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if a < -2.45000000000000013e76Initial program 90.9%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in z around 0 83.7%
associate-/l*88.3%
Simplified88.3%
clear-num88.2%
associate-/r/88.2%
clear-num88.3%
Applied egg-rr88.3%
if -2.45000000000000013e76 < a < 2.05e9Initial program 89.4%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in a around 0 87.3%
associate-*r/87.3%
neg-mul-187.3%
neg-sub087.3%
associate--r-87.3%
neg-sub087.3%
Simplified87.3%
Taylor expanded in y around 0 87.3%
+-commutative87.3%
mul-1-neg87.3%
unsub-neg87.3%
Simplified87.3%
if 2.05e9 < a Initial program 83.7%
associate-*l/99.5%
Simplified99.5%
Taylor expanded in z around 0 82.5%
Final simplification86.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.4e+76) (+ x (* y (/ t a))) (if (<= a 5.3e-136) (+ x (* t (- 1.0 (/ y z)))) (+ x (* t (/ y (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.4e+76) {
tmp = x + (y * (t / a));
} else if (a <= 5.3e-136) {
tmp = x + (t * (1.0 - (y / z)));
} 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 (a <= (-4.4d+76)) then
tmp = x + (y * (t / a))
else if (a <= 5.3d-136) then
tmp = x + (t * (1.0d0 - (y / z)))
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 (a <= -4.4e+76) {
tmp = x + (y * (t / a));
} else if (a <= 5.3e-136) {
tmp = x + (t * (1.0 - (y / z)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.4e+76: tmp = x + (y * (t / a)) elif a <= 5.3e-136: tmp = x + (t * (1.0 - (y / z))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.4e+76) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (a <= 5.3e-136) tmp = Float64(x + Float64(t * Float64(1.0 - Float64(y / z)))); 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 (a <= -4.4e+76) tmp = x + (y * (t / a)); elseif (a <= 5.3e-136) tmp = x + (t * (1.0 - (y / z))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.4e+76], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.3e-136], N[(x + N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.4 \cdot 10^{+76}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;a \leq 5.3 \cdot 10^{-136}:\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if a < -4.4000000000000001e76Initial program 90.9%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in z around 0 83.7%
associate-/l*88.3%
Simplified88.3%
clear-num88.2%
associate-/r/88.2%
clear-num88.3%
Applied egg-rr88.3%
if -4.4000000000000001e76 < a < 5.30000000000000018e-136Initial program 89.2%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in a around 0 90.0%
associate-*r/90.0%
neg-mul-190.0%
neg-sub090.0%
associate--r-90.0%
neg-sub090.0%
Simplified90.0%
Taylor expanded in y around 0 90.0%
+-commutative90.0%
mul-1-neg90.0%
unsub-neg90.0%
Simplified90.0%
if 5.30000000000000018e-136 < a Initial program 85.6%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in y around inf 85.3%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.8e+76) (+ x (/ t (/ a (- y z)))) (if (<= a 5.6e-135) (+ x (* t (- 1.0 (/ y z)))) (+ x (* t (/ y (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.8e+76) {
tmp = x + (t / (a / (y - z)));
} else if (a <= 5.6e-135) {
tmp = x + (t * (1.0 - (y / z)));
} 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 (a <= (-3.8d+76)) then
tmp = x + (t / (a / (y - z)))
else if (a <= 5.6d-135) then
tmp = x + (t * (1.0d0 - (y / z)))
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 (a <= -3.8e+76) {
tmp = x + (t / (a / (y - z)));
} else if (a <= 5.6e-135) {
tmp = x + (t * (1.0 - (y / z)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.8e+76: tmp = x + (t / (a / (y - z))) elif a <= 5.6e-135: tmp = x + (t * (1.0 - (y / z))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.8e+76) tmp = Float64(x + Float64(t / Float64(a / Float64(y - z)))); elseif (a <= 5.6e-135) tmp = Float64(x + Float64(t * Float64(1.0 - Float64(y / z)))); 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 (a <= -3.8e+76) tmp = x + (t / (a / (y - z))); elseif (a <= 5.6e-135) tmp = x + (t * (1.0 - (y / z))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.8e+76], N[(x + N[(t / N[(a / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.6e-135], N[(x + N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+76}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y - z}}\\
\mathbf{elif}\;a \leq 5.6 \cdot 10^{-135}:\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if a < -3.80000000000000024e76Initial program 90.9%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in a around inf 86.3%
associate-/l*88.6%
Simplified88.6%
if -3.80000000000000024e76 < a < 5.60000000000000047e-135Initial program 89.2%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in a around 0 90.0%
associate-*r/90.0%
neg-mul-190.0%
neg-sub090.0%
associate--r-90.0%
neg-sub090.0%
Simplified90.0%
Taylor expanded in y around 0 90.0%
+-commutative90.0%
mul-1-neg90.0%
unsub-neg90.0%
Simplified90.0%
if 5.60000000000000047e-135 < a Initial program 85.6%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in y around inf 85.3%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e-35) (not (<= z 1.25e+51))) (+ x t) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e-35) || !(z <= 1.25e+51)) {
tmp = x + t;
} 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 <= (-1.9d-35)) .or. (.not. (z <= 1.25d+51))) then
tmp = x + t
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 <= -1.9e-35) || !(z <= 1.25e+51)) {
tmp = x + t;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e-35) or not (z <= 1.25e+51): tmp = x + t else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e-35) || !(z <= 1.25e+51)) tmp = Float64(x + t); 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 <= -1.9e-35) || ~((z <= 1.25e+51))) tmp = x + t; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e-35], N[Not[LessEqual[z, 1.25e+51]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-35} \lor \neg \left(z \leq 1.25 \cdot 10^{+51}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.9000000000000001e-35 or 1.25e51 < z Initial program 79.8%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 79.9%
if -1.9000000000000001e-35 < z < 1.25e51Initial program 96.9%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in z around 0 77.4%
associate-/l*78.5%
Simplified78.5%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.5e-38) (+ x t) (if (<= z 2.8e+50) (+ x (* y (/ t a))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e-38) {
tmp = x + t;
} else if (z <= 2.8e+50) {
tmp = x + (y * (t / 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 <= (-8.5d-38)) then
tmp = x + t
else if (z <= 2.8d+50) then
tmp = x + (y * (t / 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 <= -8.5e-38) {
tmp = x + t;
} else if (z <= 2.8e+50) {
tmp = x + (y * (t / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.5e-38: tmp = x + t elif z <= 2.8e+50: tmp = x + (y * (t / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e-38) tmp = Float64(x + t); elseif (z <= 2.8e+50) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.5e-38) tmp = x + t; elseif (z <= 2.8e+50) tmp = x + (y * (t / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e-38], N[(x + t), $MachinePrecision], If[LessEqual[z, 2.8e+50], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-38}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+50}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -8.50000000000000046e-38 or 2.7999999999999998e50 < z Initial program 79.8%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 79.9%
if -8.50000000000000046e-38 < z < 2.7999999999999998e50Initial program 96.9%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in z around 0 77.4%
associate-/l*78.5%
Simplified78.5%
clear-num78.5%
associate-/r/78.5%
clear-num78.5%
Applied egg-rr78.5%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.2e+201) (+ x (* t (/ z a))) (if (<= a 1.15e+156) (+ x t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.2e+201) {
tmp = x + (t * (z / a));
} else if (a <= 1.15e+156) {
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.2d+201)) then
tmp = x + (t * (z / a))
else if (a <= 1.15d+156) 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.2e+201) {
tmp = x + (t * (z / a));
} else if (a <= 1.15e+156) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.2e+201: tmp = x + (t * (z / a)) elif a <= 1.15e+156: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.2e+201) tmp = Float64(x + Float64(t * Float64(z / a))); elseif (a <= 1.15e+156) 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.2e+201) tmp = x + (t * (z / a)); elseif (a <= 1.15e+156) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.2e+201], N[(x + N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.15e+156], N[(x + t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{+201}:\\
\;\;\;\;x + t \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{+156}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.1999999999999998e201Initial program 94.7%
associate-*l/91.7%
Simplified91.7%
Taylor expanded in a around inf 94.7%
Taylor expanded in y around 0 62.3%
associate-*r/62.3%
associate-*r*62.3%
neg-mul-162.3%
Simplified62.3%
expm1-log1p-u62.3%
expm1-udef62.2%
associate-/l*62.2%
add-sqr-sqrt39.4%
sqrt-unprod56.1%
sqr-neg56.1%
sqrt-unprod22.7%
add-sqr-sqrt62.2%
Applied egg-rr62.2%
expm1-def62.2%
expm1-log1p62.6%
associate-/l*62.7%
associate-*r/62.6%
Simplified62.6%
if -4.1999999999999998e201 < a < 1.1499999999999999e156Initial program 87.9%
associate-*l/98.5%
Simplified98.5%
Taylor expanded in z around inf 67.2%
if 1.1499999999999999e156 < a Initial program 86.1%
associate-*l/99.2%
Simplified99.2%
Taylor expanded in z around 0 83.6%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in x around inf 80.2%
Final simplification69.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.6e+203) (+ x (* z (/ t a))) (if (<= a 1e+156) (+ x t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.6e+203) {
tmp = x + (z * (t / a));
} else if (a <= 1e+156) {
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 <= (-2.6d+203)) then
tmp = x + (z * (t / a))
else if (a <= 1d+156) 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 <= -2.6e+203) {
tmp = x + (z * (t / a));
} else if (a <= 1e+156) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.6e+203: tmp = x + (z * (t / a)) elif a <= 1e+156: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.6e+203) tmp = Float64(x + Float64(z * Float64(t / a))); elseif (a <= 1e+156) 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 <= -2.6e+203) tmp = x + (z * (t / a)); elseif (a <= 1e+156) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.6e+203], N[(x + N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1e+156], N[(x + t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{+203}:\\
\;\;\;\;x + z \cdot \frac{t}{a}\\
\mathbf{elif}\;a \leq 10^{+156}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.5999999999999998e203Initial program 94.7%
associate-*l/91.7%
Simplified91.7%
Taylor expanded in a around inf 94.7%
Taylor expanded in y around 0 62.3%
associate-*r/62.3%
associate-*r*62.3%
neg-mul-162.3%
Simplified62.3%
div-inv62.3%
*-commutative62.3%
associate-*l*62.3%
add-sqr-sqrt39.4%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod23.3%
add-sqr-sqrt62.7%
div-inv62.7%
Applied egg-rr62.7%
if -2.5999999999999998e203 < a < 9.9999999999999998e155Initial program 87.9%
associate-*l/98.5%
Simplified98.5%
Taylor expanded in z around inf 67.2%
if 9.9999999999999998e155 < a Initial program 86.1%
associate-*l/99.2%
Simplified99.2%
Taylor expanded in z around 0 83.6%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in x around inf 80.2%
Final simplification69.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.6e+222) x (if (<= a 4.2e+156) (+ x t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.6e+222) {
tmp = x;
} else if (a <= 4.2e+156) {
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 <= (-3.6d+222)) then
tmp = x
else if (a <= 4.2d+156) 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 <= -3.6e+222) {
tmp = x;
} else if (a <= 4.2e+156) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.6e+222: tmp = x elif a <= 4.2e+156: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.6e+222) tmp = x; elseif (a <= 4.2e+156) 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 <= -3.6e+222) tmp = x; elseif (a <= 4.2e+156) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.6e+222], x, If[LessEqual[a, 4.2e+156], N[(x + t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.6 \cdot 10^{+222}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{+156}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3.6000000000000002e222 or 4.19999999999999963e156 < a Initial program 87.2%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in z around 0 84.9%
associate-/l*92.2%
Simplified92.2%
Taylor expanded in x around inf 76.9%
if -3.6000000000000002e222 < a < 4.19999999999999963e156Initial program 88.4%
associate-*l/98.5%
Simplified98.5%
Taylor expanded in z around inf 67.0%
Final simplification69.0%
(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 88.1%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in z around 0 61.6%
associate-/l*62.6%
Simplified62.6%
Taylor expanded in x around inf 56.3%
Final simplification56.3%
(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 2023257
(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))))