
(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
(let* ((t_1 (/ (* (- y z) t) (- a z))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+294)))
(+ x (* (/ t (- z a)) (- z y)))
(+ 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 <= 5e+294)) {
tmp = x + ((t / (z - a)) * (z - y));
} 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 <= 5e+294)) {
tmp = x + ((t / (z - a)) * (z - y));
} 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 <= 5e+294): tmp = x + ((t / (z - a)) * (z - y)) 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 <= 5e+294)) tmp = Float64(x + Float64(Float64(t / Float64(z - a)) * Float64(z - y))); 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 <= 5e+294))) tmp = x + ((t / (z - a)) * (z - y)); 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, 5e+294]], $MachinePrecision]], N[(x + N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $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 5 \cdot 10^{+294}\right):\\
\;\;\;\;x + \frac{t}{z - a} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 4.9999999999999999e294 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 40.2%
associate-/l*99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 4.9999999999999999e294Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.15e+68) (not (<= z 4.7e+126))) (+ t x) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.15e+68) || !(z <= 4.7e+126)) {
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 <= (-2.15d+68)) .or. (.not. (z <= 4.7d+126))) 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 <= -2.15e+68) || !(z <= 4.7e+126)) {
tmp = t + x;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.15e+68) or not (z <= 4.7e+126): tmp = t + x else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.15e+68) || !(z <= 4.7e+126)) 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 <= -2.15e+68) || ~((z <= 4.7e+126))) 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, -2.15e+68], N[Not[LessEqual[z, 4.7e+126]], $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 -2.15 \cdot 10^{+68} \lor \neg \left(z \leq 4.7 \cdot 10^{+126}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -2.1500000000000001e68 or 4.6999999999999999e126 < z Initial program 69.2%
associate-/l*91.3%
Simplified91.3%
Taylor expanded in z around inf 89.1%
if -2.1500000000000001e68 < z < 4.6999999999999999e126Initial program 92.6%
associate-/l*95.9%
Simplified95.9%
clear-num95.9%
un-div-inv95.9%
Applied egg-rr95.9%
Taylor expanded in y around inf 82.1%
*-commutative82.1%
associate-*r/87.2%
Simplified87.2%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e+67) (not (<= z 3.9e+125))) (+ t x) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e+67) || !(z <= 3.9e+125)) {
tmp = t + x;
} 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.35d+67)) .or. (.not. (z <= 3.9d+125))) then
tmp = t + x
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.35e+67) || !(z <= 3.9e+125)) {
tmp = t + x;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e+67) or not (z <= 3.9e+125): tmp = t + x else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e+67) || !(z <= 3.9e+125)) tmp = Float64(t + x); 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.35e+67) || ~((z <= 3.9e+125))) tmp = t + x; else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.35e+67], N[Not[LessEqual[z, 3.9e+125]], $MachinePrecision]], N[(t + x), $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.35 \cdot 10^{+67} \lor \neg \left(z \leq 3.9 \cdot 10^{+125}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.35e67 or 3.9000000000000002e125 < z Initial program 69.2%
associate-/l*91.3%
Simplified91.3%
Taylor expanded in z around inf 89.1%
if -1.35e67 < z < 3.9000000000000002e125Initial program 92.6%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in y around inf 82.1%
associate-/l*86.1%
Simplified86.1%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.7e+74) (+ x (* y (/ t (- a z)))) (if (<= y 2.2e+47) (+ x (* t (/ z (- z a)))) (+ x (* t (/ y (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.7e+74) {
tmp = x + (y * (t / (a - z)));
} else if (y <= 2.2e+47) {
tmp = x + (t * (z / (z - a)));
} 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 (y <= (-3.7d+74)) then
tmp = x + (y * (t / (a - z)))
else if (y <= 2.2d+47) then
tmp = x + (t * (z / (z - a)))
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 (y <= -3.7e+74) {
tmp = x + (y * (t / (a - z)));
} else if (y <= 2.2e+47) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.7e+74: tmp = x + (y * (t / (a - z))) elif y <= 2.2e+47: tmp = x + (t * (z / (z - a))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.7e+74) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); elseif (y <= 2.2e+47) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); 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 (y <= -3.7e+74) tmp = x + (y * (t / (a - z))); elseif (y <= 2.2e+47) tmp = x + (t * (z / (z - a))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.7e+74], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+47], N[(x + N[(t * N[(z / N[(z - a), $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}\;y \leq -3.7 \cdot 10^{+74}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+47}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if y < -3.7000000000000001e74Initial program 85.0%
associate-/l*98.5%
Simplified98.5%
clear-num97.8%
un-div-inv97.9%
Applied egg-rr97.9%
Taylor expanded in y around inf 81.2%
*-commutative81.2%
associate-*r/92.5%
Simplified92.5%
if -3.7000000000000001e74 < y < 2.1999999999999999e47Initial program 86.2%
associate-/l*93.0%
Simplified93.0%
Taylor expanded in y around 0 79.0%
associate-*r/79.0%
mul-1-neg79.0%
distribute-rgt-neg-out79.0%
associate-*l/88.4%
Simplified88.4%
Taylor expanded in x around 0 79.0%
mul-1-neg79.0%
unsub-neg79.0%
associate-/l*92.7%
Simplified92.7%
if 2.1999999999999999e47 < y Initial program 79.2%
associate-/l*93.7%
Simplified93.7%
Taylor expanded in y around inf 74.6%
associate-/l*88.3%
Simplified88.3%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.02e+74) (+ x (* y (/ t (- a z)))) (if (<= y 1.4e+47) (+ x (* z (/ t (- z a)))) (+ x (* t (/ y (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.02e+74) {
tmp = x + (y * (t / (a - z)));
} else if (y <= 1.4e+47) {
tmp = x + (z * (t / (z - a)));
} 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 (y <= (-1.02d+74)) then
tmp = x + (y * (t / (a - z)))
else if (y <= 1.4d+47) then
tmp = x + (z * (t / (z - a)))
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 (y <= -1.02e+74) {
tmp = x + (y * (t / (a - z)));
} else if (y <= 1.4e+47) {
tmp = x + (z * (t / (z - a)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.02e+74: tmp = x + (y * (t / (a - z))) elif y <= 1.4e+47: tmp = x + (z * (t / (z - a))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.02e+74) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); elseif (y <= 1.4e+47) tmp = Float64(x + Float64(z * Float64(t / Float64(z - a)))); 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 (y <= -1.02e+74) tmp = x + (y * (t / (a - z))); elseif (y <= 1.4e+47) tmp = x + (z * (t / (z - a))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.02e+74], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+47], N[(x + N[(z * N[(t / N[(z - a), $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}\;y \leq -1.02 \cdot 10^{+74}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+47}:\\
\;\;\;\;x + z \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if y < -1.02000000000000005e74Initial program 85.0%
associate-/l*98.5%
Simplified98.5%
clear-num97.8%
un-div-inv97.9%
Applied egg-rr97.9%
Taylor expanded in y around inf 81.2%
*-commutative81.2%
associate-*r/92.5%
Simplified92.5%
if -1.02000000000000005e74 < y < 1.39999999999999994e47Initial program 86.2%
associate-/l*93.0%
Simplified93.0%
Taylor expanded in y around 0 79.0%
associate-*r/79.0%
mul-1-neg79.0%
distribute-rgt-neg-out79.0%
associate-*l/88.4%
Simplified88.4%
associate-*l/79.0%
frac-2neg79.0%
add-sqr-sqrt41.3%
sqrt-unprod49.6%
sqr-neg49.6%
sqrt-unprod27.3%
add-sqr-sqrt56.1%
distribute-rgt-neg-out56.1%
*-commutative56.1%
add-sqr-sqrt28.7%
sqrt-unprod52.4%
sqr-neg52.4%
sqrt-unprod37.5%
add-sqr-sqrt79.0%
sub-neg79.0%
distribute-neg-in79.0%
add-sqr-sqrt41.3%
sqrt-unprod64.7%
sqr-neg64.7%
sqrt-unprod28.5%
add-sqr-sqrt59.7%
add-sqr-sqrt31.2%
sqrt-unprod66.5%
sqr-neg66.5%
Applied egg-rr79.0%
associate-/l*88.4%
+-commutative88.4%
unsub-neg88.4%
Simplified88.4%
if 1.39999999999999994e47 < y Initial program 79.2%
associate-/l*93.7%
Simplified93.7%
Taylor expanded in y around inf 74.6%
associate-/l*88.3%
Simplified88.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.3e+54) (not (<= z 7.8e-5))) (+ t x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e+54) || !(z <= 7.8e-5)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4.3d+54)) .or. (.not. (z <= 7.8d-5))) then
tmp = t + x
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e+54) || !(z <= 7.8e-5)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.3e+54) or not (z <= 7.8e-5): tmp = t + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.3e+54) || !(z <= 7.8e-5)) tmp = Float64(t + x); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.3e+54) || ~((z <= 7.8e-5))) tmp = t + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.3e+54], N[Not[LessEqual[z, 7.8e-5]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+54} \lor \neg \left(z \leq 7.8 \cdot 10^{-5}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -4.29999999999999976e54 or 7.7999999999999999e-5 < z Initial program 73.7%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in z around inf 81.7%
if -4.29999999999999976e54 < z < 7.7999999999999999e-5Initial program 93.7%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in z around 0 74.5%
associate-/l*78.8%
Simplified78.8%
Final simplification80.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.05e+241) (+ x (* t (/ z (- z a)))) (+ x (* (/ t (- z a)) (- z y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.05e+241) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + ((t / (z - a)) * (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.05d+241)) then
tmp = x + (t * (z / (z - a)))
else
tmp = x + ((t / (z - a)) * (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.05e+241) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + ((t / (z - a)) * (z - y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.05e+241: tmp = x + (t * (z / (z - a))) else: tmp = x + ((t / (z - a)) * (z - y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.05e+241) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(Float64(t / Float64(z - a)) * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.05e+241) tmp = x + (t * (z / (z - a))); else tmp = x + ((t / (z - a)) * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.05e+241], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{+241}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{z - a} \cdot \left(z - y\right)\\
\end{array}
\end{array}
if z < -2.05000000000000007e241Initial program 71.7%
associate-/l*71.0%
Simplified71.0%
Taylor expanded in y around 0 71.7%
associate-*r/71.7%
mul-1-neg71.7%
distribute-rgt-neg-out71.7%
associate-*l/71.0%
Simplified71.0%
Taylor expanded in x around 0 71.7%
mul-1-neg71.7%
unsub-neg71.7%
associate-/l*99.9%
Simplified99.9%
if -2.05000000000000007e241 < z Initial program 85.1%
associate-/l*95.9%
Simplified95.9%
Final simplification96.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e-91) (not (<= z 5.8e-94))) (+ t x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e-91) || !(z <= 5.8e-94)) {
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 ((z <= (-4.8d-91)) .or. (.not. (z <= 5.8d-94))) 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 ((z <= -4.8e-91) || !(z <= 5.8e-94)) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e-91) or not (z <= 5.8e-94): tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e-91) || !(z <= 5.8e-94)) tmp = Float64(t + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.8e-91) || ~((z <= 5.8e-94))) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e-91], N[Not[LessEqual[z, 5.8e-94]], $MachinePrecision]], N[(t + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-91} \lor \neg \left(z \leq 5.8 \cdot 10^{-94}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.80000000000000022e-91 or 5.79999999999999991e-94 < z Initial program 79.4%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in z around inf 73.9%
if -4.80000000000000022e-91 < z < 5.79999999999999991e-94Initial program 94.3%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in a around inf 80.4%
*-commutative80.4%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in x around inf 50.4%
Final simplification66.3%
(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.2%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in a around inf 54.5%
*-commutative54.5%
associate-/l*57.6%
Simplified57.6%
Taylor expanded in x around inf 48.9%
(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 2024085
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(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))))