
(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
(let* ((t_1 (/ (* (- y z) t) (- a z))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+272)))
(+ x (* (- y z) (/ t (- a z))))
(+ t_1 x))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+272)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = t_1 + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+272)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = t_1 + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) * t) / (a - z) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+272): tmp = x + ((y - z) * (t / (a - z))) else: tmp = t_1 + x return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+272)) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); else tmp = Float64(t_1 + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) * t) / (a - z); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 2e+272))) tmp = x + ((y - z) * (t / (a - z))); else tmp = t_1 + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+272]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+272}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 2.0000000000000001e272 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 39.1%
associate-/l*99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 2.0000000000000001e272Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.5e+114)
(+ t x)
(if (<= z -1.8e-13)
(- x (/ t (/ z y)))
(if (<= z 5.6e-14) (+ x (* t (/ y a))) (+ t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+114) {
tmp = t + x;
} else if (z <= -1.8e-13) {
tmp = x - (t / (z / y));
} else if (z <= 5.6e-14) {
tmp = x + (t * (y / a));
} else {
tmp = t + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.5d+114)) then
tmp = t + x
else if (z <= (-1.8d-13)) then
tmp = x - (t / (z / y))
else if (z <= 5.6d-14) then
tmp = x + (t * (y / a))
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+114) {
tmp = t + x;
} else if (z <= -1.8e-13) {
tmp = x - (t / (z / y));
} else if (z <= 5.6e-14) {
tmp = x + (t * (y / a));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.5e+114: tmp = t + x elif z <= -1.8e-13: tmp = x - (t / (z / y)) elif z <= 5.6e-14: tmp = x + (t * (y / a)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e+114) tmp = Float64(t + x); elseif (z <= -1.8e-13) tmp = Float64(x - Float64(t / Float64(z / y))); elseif (z <= 5.6e-14) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.5e+114) tmp = t + x; elseif (z <= -1.8e-13) tmp = x - (t / (z / y)); elseif (z <= 5.6e-14) tmp = x + (t * (y / a)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e+114], N[(t + x), $MachinePrecision], If[LessEqual[z, -1.8e-13], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e-14], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+114}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-13}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-14}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -3.5000000000000001e114 or 5.6000000000000001e-14 < z Initial program 78.8%
associate-/l*90.8%
Simplified90.8%
Taylor expanded in z around inf 80.2%
if -3.5000000000000001e114 < z < -1.7999999999999999e-13Initial program 99.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 80.8%
mul-1-neg80.8%
unsub-neg80.8%
associate-/l*80.8%
Simplified80.8%
clear-num80.8%
un-div-inv80.8%
Applied egg-rr80.8%
Taylor expanded in z around 0 78.9%
if -1.7999999999999999e-13 < z < 5.6000000000000001e-14Initial program 96.1%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in z around 0 73.4%
+-commutative73.4%
associate-/l*74.0%
Simplified74.0%
Final simplification77.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.9e+117)
(+ t x)
(if (<= z -2.95e-16)
(- x (* y (/ t z)))
(if (<= z 1.9e-13) (+ x (* t (/ y a))) (+ t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+117) {
tmp = t + x;
} else if (z <= -2.95e-16) {
tmp = x - (y * (t / z));
} else if (z <= 1.9e-13) {
tmp = x + (t * (y / a));
} else {
tmp = t + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.9d+117)) then
tmp = t + x
else if (z <= (-2.95d-16)) then
tmp = x - (y * (t / z))
else if (z <= 1.9d-13) then
tmp = x + (t * (y / a))
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+117) {
tmp = t + x;
} else if (z <= -2.95e-16) {
tmp = x - (y * (t / z));
} else if (z <= 1.9e-13) {
tmp = x + (t * (y / a));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.9e+117: tmp = t + x elif z <= -2.95e-16: tmp = x - (y * (t / z)) elif z <= 1.9e-13: tmp = x + (t * (y / a)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e+117) tmp = Float64(t + x); elseif (z <= -2.95e-16) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 1.9e-13) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.9e+117) tmp = t + x; elseif (z <= -2.95e-16) tmp = x - (y * (t / z)); elseif (z <= 1.9e-13) tmp = x + (t * (y / a)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+117], N[(t + x), $MachinePrecision], If[LessEqual[z, -2.95e-16], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-13], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+117}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq -2.95 \cdot 10^{-16}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-13}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -1.9000000000000001e117 or 1.9e-13 < z Initial program 78.8%
associate-/l*90.8%
Simplified90.8%
Taylor expanded in z around inf 80.2%
if -1.9000000000000001e117 < z < -2.95000000000000011e-16Initial program 99.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 80.8%
mul-1-neg80.8%
unsub-neg80.8%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in y around inf 78.8%
*-commutative78.8%
associate-/l*78.8%
Applied egg-rr78.8%
if -2.95000000000000011e-16 < z < 1.9e-13Initial program 96.1%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in z around 0 73.4%
+-commutative73.4%
associate-/l*74.0%
Simplified74.0%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.1e+94) (not (<= y 880000000000.0))) (+ x (* y (/ t (- a z)))) (- x (* t (/ z (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.1e+94) || !(y <= 880000000000.0)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x - (t * (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 ((y <= (-2.1d+94)) .or. (.not. (y <= 880000000000.0d0))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x - (t * (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 ((y <= -2.1e+94) || !(y <= 880000000000.0)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x - (t * (z / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.1e+94) or not (y <= 880000000000.0): tmp = x + (y * (t / (a - z))) else: tmp = x - (t * (z / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.1e+94) || !(y <= 880000000000.0)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x - Float64(t * Float64(z / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.1e+94) || ~((y <= 880000000000.0))) tmp = x + (y * (t / (a - z))); else tmp = x - (t * (z / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.1e+94], N[Not[LessEqual[y, 880000000000.0]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+94} \lor \neg \left(y \leq 880000000000\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{z}{a - z}\\
\end{array}
\end{array}
if y < -2.09999999999999989e94 or 8.8e11 < y Initial program 89.5%
associate-/l*91.9%
Simplified91.9%
Taylor expanded in y around inf 86.8%
if -2.09999999999999989e94 < y < 8.8e11Initial program 88.5%
associate-/l*95.5%
Simplified95.5%
associate-*r/88.5%
clear-num88.4%
*-commutative88.4%
associate-/r*95.4%
Applied egg-rr95.4%
Taylor expanded in y around 0 80.6%
mul-1-neg80.6%
unsub-neg80.6%
associate-/l*90.1%
Simplified90.1%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1e+141) (not (<= y 3.4e-19))) (+ x (* y (/ t (- a z)))) (+ x (* z (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1e+141) || !(y <= 3.4e-19)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (z * (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) :: tmp
if ((y <= (-1d+141)) .or. (.not. (y <= 3.4d-19))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (z * (t / (z - 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 <= -1e+141) || !(y <= 3.4e-19)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (z * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1e+141) or not (y <= 3.4e-19): tmp = x + (y * (t / (a - z))) else: tmp = x + (z * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1e+141) || !(y <= 3.4e-19)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(z * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1e+141) || ~((y <= 3.4e-19))) tmp = x + (y * (t / (a - z))); else tmp = x + (z * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1e+141], N[Not[LessEqual[y, 3.4e-19]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+141} \lor \neg \left(y \leq 3.4 \cdot 10^{-19}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if y < -1.00000000000000002e141 or 3.4000000000000002e-19 < y Initial program 89.1%
associate-/l*89.5%
Simplified89.5%
Taylor expanded in y around inf 86.3%
if -1.00000000000000002e141 < y < 3.4000000000000002e-19Initial program 88.7%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in y around 0 79.8%
associate-*r/79.8%
mul-1-neg79.8%
distribute-rgt-neg-out79.8%
associate-*l/90.0%
*-commutative90.0%
distribute-lft-neg-out90.0%
distribute-rgt-neg-in90.0%
distribute-frac-neg290.0%
neg-sub090.0%
sub-neg90.0%
+-commutative90.0%
associate--r+90.0%
neg-sub090.0%
remove-double-neg90.0%
Simplified90.0%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e+123) (not (<= z 1.25e-6))) (+ t x) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e+123) || !(z <= 1.25e-6)) {
tmp = t + x;
} 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+123)) .or. (.not. (z <= 1.25d-6))) then
tmp = t + x
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+123) || !(z <= 1.25e-6)) {
tmp = t + x;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e+123) or not (z <= 1.25e-6): tmp = t + x else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.5e+123) || !(z <= 1.25e-6)) tmp = Float64(t + x); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.5e+123) || ~((z <= 1.25e-6))) tmp = t + x; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.5e+123], N[Not[LessEqual[z, 1.25e-6]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+123} \lor \neg \left(z \leq 1.25 \cdot 10^{-6}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -3.5e123 or 1.2500000000000001e-6 < z Initial program 79.0%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in z around inf 81.4%
if -3.5e123 < z < 1.2500000000000001e-6Initial program 96.0%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in y around inf 84.0%
Final simplification82.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.6e-179) (+ t x) (if (<= a 6.5e-291) (* t (- 1.0 (/ y z))) (if (<= a 1.9e+42) (+ t x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.6e-179) {
tmp = t + x;
} else if (a <= 6.5e-291) {
tmp = t * (1.0 - (y / z));
} else if (a <= 1.9e+42) {
tmp = t + x;
} 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-179)) then
tmp = t + x
else if (a <= 6.5d-291) then
tmp = t * (1.0d0 - (y / z))
else if (a <= 1.9d+42) then
tmp = t + x
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-179) {
tmp = t + x;
} else if (a <= 6.5e-291) {
tmp = t * (1.0 - (y / z));
} else if (a <= 1.9e+42) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.6e-179: tmp = t + x elif a <= 6.5e-291: tmp = t * (1.0 - (y / z)) elif a <= 1.9e+42: tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.6e-179) tmp = Float64(t + x); elseif (a <= 6.5e-291) tmp = Float64(t * Float64(1.0 - Float64(y / z))); elseif (a <= 1.9e+42) tmp = Float64(t + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.6e-179) tmp = t + x; elseif (a <= 6.5e-291) tmp = t * (1.0 - (y / z)); elseif (a <= 1.9e+42) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.6e-179], N[(t + x), $MachinePrecision], If[LessEqual[a, 6.5e-291], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.9e+42], N[(t + x), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{-179}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-291}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;a \leq 1.9 \cdot 10^{+42}:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.60000000000000005e-179 or 6.50000000000000002e-291 < a < 1.8999999999999999e42Initial program 90.2%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in z around inf 68.4%
if -2.60000000000000005e-179 < a < 6.50000000000000002e-291Initial program 88.3%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in a around 0 81.5%
mul-1-neg81.5%
unsub-neg81.5%
associate-/l*93.0%
Simplified93.0%
clear-num93.0%
un-div-inv93.1%
Applied egg-rr93.1%
Taylor expanded in t around inf 90.0%
if 1.8999999999999999e42 < a Initial program 84.3%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in x around inf 70.4%
Final simplification71.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.6e-67) (not (<= z 1.18e-11))) (+ t x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.6e-67) || !(z <= 1.18e-11)) {
tmp = t + x;
} 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 <= (-9.6d-67)) .or. (.not. (z <= 1.18d-11))) then
tmp = t + x
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 <= -9.6e-67) || !(z <= 1.18e-11)) {
tmp = t + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.6e-67) or not (z <= 1.18e-11): tmp = t + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.6e-67) || !(z <= 1.18e-11)) tmp = Float64(t + x); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9.6e-67) || ~((z <= 1.18e-11))) tmp = t + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.6e-67], N[Not[LessEqual[z, 1.18e-11]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{-67} \lor \neg \left(z \leq 1.18 \cdot 10^{-11}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -9.6e-67 or 1.18e-11 < z Initial program 82.8%
associate-/l*92.4%
Simplified92.4%
Taylor expanded in z around inf 73.3%
if -9.6e-67 < z < 1.18e-11Initial program 96.5%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in z around 0 77.8%
Final simplification75.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.5e+180) (+ x (/ t (/ z (- z y)))) (+ x (* (- y z) (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.5e+180) {
tmp = x + (t / (z / (z - y)));
} else {
tmp = x + ((y - z) * (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 <= (-4.5d+180)) then
tmp = x + (t / (z / (z - y)))
else
tmp = x + ((y - z) * (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 <= -4.5e+180) {
tmp = x + (t / (z / (z - y)));
} else {
tmp = x + ((y - z) * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.5e+180: tmp = x + (t / (z / (z - y))) else: tmp = x + ((y - z) * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.5e+180) tmp = Float64(x + Float64(t / Float64(z / Float64(z - y)))); else tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.5e+180) tmp = x + (t / (z / (z - y))); else tmp = x + ((y - z) * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.5e+180], N[(x + N[(t / N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+180}:\\
\;\;\;\;x + \frac{t}{\frac{z}{z - y}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -4.49999999999999981e180Initial program 69.5%
associate-/l*80.9%
Simplified80.9%
Taylor expanded in a around 0 68.1%
mul-1-neg68.1%
unsub-neg68.1%
associate-/l*98.6%
Simplified98.6%
clear-num98.5%
un-div-inv98.6%
Applied egg-rr98.6%
if -4.49999999999999981e180 < z Initial program 90.9%
associate-/l*95.7%
Simplified95.7%
Final simplification96.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -7e+39) t (if (<= t 5.4e+129) x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e+39) {
tmp = t;
} else if (t <= 5.4e+129) {
tmp = x;
} else {
tmp = 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 <= (-7d+39)) then
tmp = t
else if (t <= 5.4d+129) then
tmp = x
else
tmp = 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 <= -7e+39) {
tmp = t;
} else if (t <= 5.4e+129) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7e+39: tmp = t elif t <= 5.4e+129: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e+39) tmp = t; elseif (t <= 5.4e+129) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7e+39) tmp = t; elseif (t <= 5.4e+129) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e+39], t, If[LessEqual[t, 5.4e+129], x, t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+39}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{+129}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if t < -7.0000000000000003e39 or 5.4000000000000002e129 < t Initial program 69.6%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 47.6%
Taylor expanded in x around 0 37.8%
if -7.0000000000000003e39 < t < 5.4000000000000002e129Initial program 97.7%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in x around inf 66.1%
(FPCore (x y z t a) :precision binary64 (if (<= a 2.6e+42) (+ t x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 2.6e+42) {
tmp = t + x;
} 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+42) then
tmp = t + x
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+42) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 2.6e+42: tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 2.6e+42) tmp = Float64(t + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 2.6e+42) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 2.6e+42], N[(t + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.6 \cdot 10^{+42}:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 2.5999999999999999e42Initial program 89.9%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in z around inf 64.5%
if 2.5999999999999999e42 < a Initial program 84.3%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in x around inf 70.4%
Final simplification65.7%
(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 88.8%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in z around inf 63.3%
Taylor expanded in x around 0 22.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 2024145
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (if (< t -10682974490174067/10000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 312887599100691/80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t)))))
(+ x (/ (* (- y z) t) (- a z))))