
(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 10 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 -5e+300) (not (<= t_1 4e+307)))
(+ 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 <= -5e+300) || !(t_1 <= 4e+307)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = t_1 + 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) :: t_1
real(8) :: tmp
t_1 = ((y - z) * t) / (a - z)
if ((t_1 <= (-5d+300)) .or. (.not. (t_1 <= 4d+307))) then
tmp = x + ((y - z) * (t / (a - z)))
else
tmp = t_1 + x
end if
code = tmp
end function
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 <= -5e+300) || !(t_1 <= 4e+307)) {
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 <= -5e+300) or not (t_1 <= 4e+307): 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 <= -5e+300) || !(t_1 <= 4e+307)) 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 <= -5e+300) || ~((t_1 <= 4e+307))) 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, -5e+300], N[Not[LessEqual[t$95$1, 4e+307]], $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 -5 \cdot 10^{+300} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+307}\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)) < -5.00000000000000026e300 or 3.99999999999999994e307 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 41.4%
associate-/l*99.8%
Simplified99.8%
if -5.00000000000000026e300 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 3.99999999999999994e307Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -5.6e+188) (and (not (<= y 1.95e+219)) (<= y 9.8e+232))) (* (/ y z) (- t)) (+ t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -5.6e+188) || (!(y <= 1.95e+219) && (y <= 9.8e+232))) {
tmp = (y / z) * -t;
} 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 ((y <= (-5.6d+188)) .or. (.not. (y <= 1.95d+219)) .and. (y <= 9.8d+232)) then
tmp = (y / z) * -t
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 ((y <= -5.6e+188) || (!(y <= 1.95e+219) && (y <= 9.8e+232))) {
tmp = (y / z) * -t;
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -5.6e+188) or (not (y <= 1.95e+219) and (y <= 9.8e+232)): tmp = (y / z) * -t else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -5.6e+188) || (!(y <= 1.95e+219) && (y <= 9.8e+232))) tmp = Float64(Float64(y / z) * Float64(-t)); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -5.6e+188) || (~((y <= 1.95e+219)) && (y <= 9.8e+232))) tmp = (y / z) * -t; else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -5.6e+188], And[N[Not[LessEqual[y, 1.95e+219]], $MachinePrecision], LessEqual[y, 9.8e+232]]], N[(N[(y / z), $MachinePrecision] * (-t)), $MachinePrecision], N[(t + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{+188} \lor \neg \left(y \leq 1.95 \cdot 10^{+219}\right) \land y \leq 9.8 \cdot 10^{+232}:\\
\;\;\;\;\frac{y}{z} \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if y < -5.5999999999999996e188 or 1.95e219 < y < 9.8000000000000001e232Initial program 77.0%
associate-/l*90.2%
Simplified90.2%
Taylor expanded in y around inf 71.5%
Taylor expanded in a around 0 47.1%
mul-1-neg47.1%
unsub-neg47.1%
associate-*l/52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in x around 0 46.3%
mul-1-neg46.3%
associate-/l*45.1%
distribute-rgt-neg-in45.1%
distribute-frac-neg245.1%
Simplified45.1%
if -5.5999999999999996e188 < y < 1.95e219 or 9.8000000000000001e232 < y Initial program 86.7%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in z around inf 67.9%
Final simplification64.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -5.6e+188) (* (- y) (/ t z)) (if (or (<= y 4.1e+219) (not (<= y 7e+234))) (+ t x) (* (/ y z) (- t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.6e+188) {
tmp = -y * (t / z);
} else if ((y <= 4.1e+219) || !(y <= 7e+234)) {
tmp = t + x;
} else {
tmp = (y / z) * -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 (y <= (-5.6d+188)) then
tmp = -y * (t / z)
else if ((y <= 4.1d+219) .or. (.not. (y <= 7d+234))) then
tmp = t + x
else
tmp = (y / z) * -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.6e+188) {
tmp = -y * (t / z);
} else if ((y <= 4.1e+219) || !(y <= 7e+234)) {
tmp = t + x;
} else {
tmp = (y / z) * -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.6e+188: tmp = -y * (t / z) elif (y <= 4.1e+219) or not (y <= 7e+234): tmp = t + x else: tmp = (y / z) * -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.6e+188) tmp = Float64(Float64(-y) * Float64(t / z)); elseif ((y <= 4.1e+219) || !(y <= 7e+234)) tmp = Float64(t + x); else tmp = Float64(Float64(y / z) * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5.6e+188) tmp = -y * (t / z); elseif ((y <= 4.1e+219) || ~((y <= 7e+234))) tmp = t + x; else tmp = (y / z) * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.6e+188], N[((-y) * N[(t / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 4.1e+219], N[Not[LessEqual[y, 7e+234]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{+188}:\\
\;\;\;\;\left(-y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+219} \lor \neg \left(y \leq 7 \cdot 10^{+234}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot \left(-t\right)\\
\end{array}
\end{array}
if y < -5.5999999999999996e188Initial program 78.6%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in y around inf 72.0%
Taylor expanded in a around 0 42.7%
mul-1-neg42.7%
unsub-neg42.7%
associate-*l/49.1%
*-commutative49.1%
Simplified49.1%
Taylor expanded in x around 0 41.7%
*-commutative41.7%
associate-*r/48.3%
neg-mul-148.3%
distribute-lft-neg-in48.3%
Simplified48.3%
if -5.5999999999999996e188 < y < 4.0999999999999998e219 or 7.00000000000000065e234 < y Initial program 86.7%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in z around inf 67.9%
if 4.0999999999999998e219 < y < 7.00000000000000065e234Initial program 69.1%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in y around inf 69.1%
Taylor expanded in a around 0 69.1%
mul-1-neg69.1%
unsub-neg69.1%
associate-*l/70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in x around 0 69.1%
mul-1-neg69.1%
associate-/l*70.3%
distribute-rgt-neg-in70.3%
distribute-frac-neg270.3%
Simplified70.3%
Final simplification65.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.85e+147) (not (<= z 1.1e+52))) (+ t x) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.85e+147) || !(z <= 1.1e+52)) {
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 <= (-2.85d+147)) .or. (.not. (z <= 1.1d+52))) 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 <= -2.85e+147) || !(z <= 1.1e+52)) {
tmp = t + x;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.85e+147) or not (z <= 1.1e+52): tmp = t + x else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.85e+147) || !(z <= 1.1e+52)) 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 <= -2.85e+147) || ~((z <= 1.1e+52))) 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, -2.85e+147], N[Not[LessEqual[z, 1.1e+52]], $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 -2.85 \cdot 10^{+147} \lor \neg \left(z \leq 1.1 \cdot 10^{+52}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -2.84999999999999996e147 or 1.1e52 < z Initial program 69.3%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in z around inf 86.5%
if -2.84999999999999996e147 < z < 1.1e52Initial program 94.2%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in y around inf 86.4%
associate-/l*87.5%
Simplified87.5%
Final simplification87.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.5e+142) (not (<= z 2.25e-17))) (+ 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 ((z <= -9.5e+142) || !(z <= 2.25e-17)) {
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 ((z <= (-9.5d+142)) .or. (.not. (z <= 2.25d-17))) 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 ((z <= -9.5e+142) || !(z <= 2.25e-17)) {
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 (z <= -9.5e+142) or not (z <= 2.25e-17): 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 ((z <= -9.5e+142) || !(z <= 2.25e-17)) 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 ((z <= -9.5e+142) || ~((z <= 2.25e-17))) 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[Or[LessEqual[z, -9.5e+142], N[Not[LessEqual[z, 2.25e-17]], $MachinePrecision]], 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}\;z \leq -9.5 \cdot 10^{+142} \lor \neg \left(z \leq 2.25 \cdot 10^{-17}\right):\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -9.50000000000000001e142 or 2.24999999999999989e-17 < z Initial program 72.0%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in a around 0 68.3%
mul-1-neg68.3%
unsub-neg68.3%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in y around 0 95.3%
if -9.50000000000000001e142 < z < 2.24999999999999989e-17Initial program 93.9%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in y around inf 86.4%
associate-/l*87.6%
Simplified87.6%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -53.0) (not (<= z 6.5e+27))) (+ t x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -53.0) || !(z <= 6.5e+27)) {
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 <= (-53.0d0)) .or. (.not. (z <= 6.5d+27))) 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 <= -53.0) || !(z <= 6.5e+27)) {
tmp = t + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -53.0) or not (z <= 6.5e+27): tmp = t + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -53.0) || !(z <= 6.5e+27)) tmp = Float64(t + x); 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 <= -53.0) || ~((z <= 6.5e+27))) tmp = t + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -53.0], N[Not[LessEqual[z, 6.5e+27]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -53 \lor \neg \left(z \leq 6.5 \cdot 10^{+27}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -53 or 6.5000000000000005e27 < z Initial program 75.2%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in z around inf 82.4%
if -53 < z < 6.5000000000000005e27Initial program 94.9%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around 0 73.6%
*-commutative73.6%
associate-/l*73.5%
Simplified73.5%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -485000.0) (not (<= z 1.3e+27))) (+ t x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -485000.0) || !(z <= 1.3e+27)) {
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 <= (-485000.0d0)) .or. (.not. (z <= 1.3d+27))) 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 <= -485000.0) || !(z <= 1.3e+27)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -485000.0) or not (z <= 1.3e+27): tmp = t + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -485000.0) || !(z <= 1.3e+27)) 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 <= -485000.0) || ~((z <= 1.3e+27))) tmp = t + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -485000.0], N[Not[LessEqual[z, 1.3e+27]], $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 -485000 \lor \neg \left(z \leq 1.3 \cdot 10^{+27}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -485000 or 1.30000000000000004e27 < z Initial program 75.2%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in z around inf 82.4%
if -485000 < z < 1.30000000000000004e27Initial program 94.9%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around 0 73.6%
+-commutative73.6%
Simplified73.6%
associate-/l*75.4%
*-commutative75.4%
Applied egg-rr75.4%
Final simplification78.8%
(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(y - z) * Float64(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[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t}{a - z}
\end{array}
Initial program 85.4%
associate-/l*95.3%
Simplified95.3%
Final simplification95.3%
(FPCore (x y z t a) :precision binary64 (+ t x))
double code(double x, double y, double z, double t, double a) {
return t + 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 = t + x
end function
public static double code(double x, double y, double z, double t, double a) {
return t + x;
}
def code(x, y, z, t, a): return t + x
function code(x, y, z, t, a) return Float64(t + x) end
function tmp = code(x, y, z, t, a) tmp = t + x; end
code[x_, y_, z_, t_, a_] := N[(t + x), $MachinePrecision]
\begin{array}{l}
\\
t + x
\end{array}
Initial program 85.4%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in z around inf 60.6%
Final simplification60.6%
(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 85.4%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in x around inf 47.7%
Final simplification47.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 2024067
(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))))