
(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 (fma (/ (- y z) (- a z)) t x))
double code(double x, double y, double z, double t, double a) {
return fma(((y - z) / (a - z)), t, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(y - z) / Float64(a - z)), t, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)
\end{array}
Initial program 83.8%
+-commutative83.8%
associate-*l/97.7%
fma-def97.7%
Simplified97.7%
Final simplification97.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (- y z) (/ a t)))) (t_2 (- x (/ t (/ z (- y z))))))
(if (<= z -2.1e+19)
(+ x (- t (* y (/ t z))))
(if (<= z -9.5e-38)
t_1
(if (<= z -5.8e-64)
t_2
(if (<= z -7.2e-213)
(+ x (/ (* (- y z) t) a))
(if (<= z 1.45e-132) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) / (a / t));
double t_2 = x - (t / (z / (y - z)));
double tmp;
if (z <= -2.1e+19) {
tmp = x + (t - (y * (t / z)));
} else if (z <= -9.5e-38) {
tmp = t_1;
} else if (z <= -5.8e-64) {
tmp = t_2;
} else if (z <= -7.2e-213) {
tmp = x + (((y - z) * t) / a);
} else if (z <= 1.45e-132) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x + ((y - z) / (a / t))
t_2 = x - (t / (z / (y - z)))
if (z <= (-2.1d+19)) then
tmp = x + (t - (y * (t / z)))
else if (z <= (-9.5d-38)) then
tmp = t_1
else if (z <= (-5.8d-64)) then
tmp = t_2
else if (z <= (-7.2d-213)) then
tmp = x + (((y - z) * t) / a)
else if (z <= 1.45d-132) then
tmp = t_1
else
tmp = t_2
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 / t));
double t_2 = x - (t / (z / (y - z)));
double tmp;
if (z <= -2.1e+19) {
tmp = x + (t - (y * (t / z)));
} else if (z <= -9.5e-38) {
tmp = t_1;
} else if (z <= -5.8e-64) {
tmp = t_2;
} else if (z <= -7.2e-213) {
tmp = x + (((y - z) * t) / a);
} else if (z <= 1.45e-132) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) / (a / t)) t_2 = x - (t / (z / (y - z))) tmp = 0 if z <= -2.1e+19: tmp = x + (t - (y * (t / z))) elif z <= -9.5e-38: tmp = t_1 elif z <= -5.8e-64: tmp = t_2 elif z <= -7.2e-213: tmp = x + (((y - z) * t) / a) elif z <= 1.45e-132: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) / Float64(a / t))) t_2 = Float64(x - Float64(t / Float64(z / Float64(y - z)))) tmp = 0.0 if (z <= -2.1e+19) tmp = Float64(x + Float64(t - Float64(y * Float64(t / z)))); elseif (z <= -9.5e-38) tmp = t_1; elseif (z <= -5.8e-64) tmp = t_2; elseif (z <= -7.2e-213) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / a)); elseif (z <= 1.45e-132) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) / (a / t)); t_2 = x - (t / (z / (y - z))); tmp = 0.0; if (z <= -2.1e+19) tmp = x + (t - (y * (t / z))); elseif (z <= -9.5e-38) tmp = t_1; elseif (z <= -5.8e-64) tmp = t_2; elseif (z <= -7.2e-213) tmp = x + (((y - z) * t) / a); elseif (z <= 1.45e-132) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(t / N[(z / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+19], N[(x + N[(t - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.5e-38], t$95$1, If[LessEqual[z, -5.8e-64], t$95$2, If[LessEqual[z, -7.2e-213], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e-132], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{\frac{a}{t}}\\
t_2 := x - \frac{t}{\frac{z}{y - z}}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+19}:\\
\;\;\;\;x + \left(t - y \cdot \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-64}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-213}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-132}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.1e19Initial program 74.4%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 71.0%
mul-1-neg71.0%
unsub-neg71.0%
associate-/l*91.3%
Simplified91.3%
Taylor expanded in z around 0 82.6%
neg-mul-182.6%
+-commutative82.6%
unsub-neg82.6%
associate-*l/91.4%
*-commutative91.4%
Simplified91.4%
if -2.1e19 < z < -9.5000000000000009e-38 or -7.2000000000000002e-213 < z < 1.44999999999999992e-132Initial program 90.2%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in a around inf 92.8%
if -9.5000000000000009e-38 < z < -5.7999999999999998e-64 or 1.44999999999999992e-132 < z Initial program 80.5%
associate-*l/99.0%
Simplified99.0%
Taylor expanded in a around 0 70.0%
mul-1-neg70.0%
unsub-neg70.0%
associate-/l*82.8%
Simplified82.8%
if -5.7999999999999998e-64 < z < -7.2000000000000002e-213Initial program 99.9%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in a around inf 89.9%
Final simplification88.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.1e+24)
(+ t x)
(if (<= z 1.65e-131)
(+ x (/ y (/ a t)))
(if (<= z 1.6e+85) (- x (/ t (/ z y))) (+ t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+24) {
tmp = t + x;
} else if (z <= 1.65e-131) {
tmp = x + (y / (a / t));
} else if (z <= 1.6e+85) {
tmp = x - (t / (z / y));
} 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.1d+24)) then
tmp = t + x
else if (z <= 1.65d-131) then
tmp = x + (y / (a / t))
else if (z <= 1.6d+85) then
tmp = x - (t / (z / y))
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.1e+24) {
tmp = t + x;
} else if (z <= 1.65e-131) {
tmp = x + (y / (a / t));
} else if (z <= 1.6e+85) {
tmp = x - (t / (z / y));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+24: tmp = t + x elif z <= 1.65e-131: tmp = x + (y / (a / t)) elif z <= 1.6e+85: tmp = x - (t / (z / y)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+24) tmp = Float64(t + x); elseif (z <= 1.65e-131) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 1.6e+85) tmp = Float64(x - Float64(t / Float64(z / y))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e+24) tmp = t + x; elseif (z <= 1.65e-131) tmp = x + (y / (a / t)); elseif (z <= 1.6e+85) tmp = x - (t / (z / y)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+24], N[(t + x), $MachinePrecision], If[LessEqual[z, 1.65e-131], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+85], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+24}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-131}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+85}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -1.10000000000000001e24 or 1.60000000000000009e85 < z Initial program 70.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.1%
if -1.10000000000000001e24 < z < 1.6500000000000001e-131Initial program 93.5%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in z around 0 77.7%
div-inv77.7%
*-commutative77.7%
associate-*l*80.3%
div-inv80.3%
clear-num80.3%
div-inv80.6%
add-cube-cbrt80.2%
*-un-lft-identity80.2%
times-frac80.0%
pow280.0%
Applied egg-rr80.0%
/-rgt-identity80.0%
associate-*r/80.2%
unpow280.2%
rem-3cbrt-lft80.6%
Simplified80.6%
if 1.6500000000000001e-131 < z < 1.60000000000000009e85Initial program 94.0%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in y around inf 80.0%
Taylor expanded in a around 0 71.6%
mul-1-neg71.6%
unsub-neg71.6%
associate-/l*71.4%
Simplified71.4%
Final simplification79.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2e+23)
(+ t x)
(if (<= z 1.4e-131)
(+ x (/ y (/ a t)))
(if (<= z 9.5e+84) (- x (/ (* y t) z)) (+ t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+23) {
tmp = t + x;
} else if (z <= 1.4e-131) {
tmp = x + (y / (a / t));
} else if (z <= 9.5e+84) {
tmp = x - ((y * t) / z);
} 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 <= (-2d+23)) then
tmp = t + x
else if (z <= 1.4d-131) then
tmp = x + (y / (a / t))
else if (z <= 9.5d+84) then
tmp = x - ((y * t) / z)
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 <= -2e+23) {
tmp = t + x;
} else if (z <= 1.4e-131) {
tmp = x + (y / (a / t));
} else if (z <= 9.5e+84) {
tmp = x - ((y * t) / z);
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e+23: tmp = t + x elif z <= 1.4e-131: tmp = x + (y / (a / t)) elif z <= 9.5e+84: tmp = x - ((y * t) / z) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+23) tmp = Float64(t + x); elseif (z <= 1.4e-131) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 9.5e+84) tmp = Float64(x - Float64(Float64(y * t) / z)); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2e+23) tmp = t + x; elseif (z <= 1.4e-131) tmp = x + (y / (a / t)); elseif (z <= 9.5e+84) tmp = x - ((y * t) / z); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+23], N[(t + x), $MachinePrecision], If[LessEqual[z, 1.4e-131], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+84], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+23}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-131}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+84}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -1.9999999999999998e23 or 9.49999999999999979e84 < z Initial program 70.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.1%
if -1.9999999999999998e23 < z < 1.4e-131Initial program 93.5%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in z around 0 77.7%
div-inv77.7%
*-commutative77.7%
associate-*l*80.3%
div-inv80.3%
clear-num80.3%
div-inv80.6%
add-cube-cbrt80.2%
*-un-lft-identity80.2%
times-frac80.0%
pow280.0%
Applied egg-rr80.0%
/-rgt-identity80.0%
associate-*r/80.2%
unpow280.2%
rem-3cbrt-lft80.6%
Simplified80.6%
if 1.4e-131 < z < 9.49999999999999979e84Initial program 94.0%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in a around 0 74.9%
mul-1-neg74.9%
unsub-neg74.9%
associate-/l*74.7%
Simplified74.7%
Taylor expanded in z around 0 71.6%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.8e+47) (not (<= z 1.42e+85))) (+ t x) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.8e+47) || !(z <= 1.42e+85)) {
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.8d+47)) .or. (.not. (z <= 1.42d+85))) 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.8e+47) || !(z <= 1.42e+85)) {
tmp = t + x;
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.8e+47) or not (z <= 1.42e+85): 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.8e+47) || !(z <= 1.42e+85)) tmp = Float64(t + x); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.8e+47) || ~((z <= 1.42e+85))) 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.8e+47], N[Not[LessEqual[z, 1.42e+85]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+47} \lor \neg \left(z \leq 1.42 \cdot 10^{+85}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -3.8000000000000003e47 or 1.42e85 < z Initial program 67.0%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 82.5%
if -3.8000000000000003e47 < z < 1.42e85Initial program 94.0%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in y around inf 83.4%
Final simplification83.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.3e+38) (not (<= z 5.5e+53))) (+ x (- t (* y (/ t z)))) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.3e+38) || !(z <= 5.5e+53)) {
tmp = x + (t - (y * (t / z)));
} 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.3d+38)) .or. (.not. (z <= 5.5d+53))) then
tmp = x + (t - (y * (t / z)))
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.3e+38) || !(z <= 5.5e+53)) {
tmp = x + (t - (y * (t / z)));
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.3e+38) or not (z <= 5.5e+53): tmp = x + (t - (y * (t / z))) else: tmp = x + ((y * t) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.3e+38) || !(z <= 5.5e+53)) tmp = Float64(x + Float64(t - Float64(y * Float64(t / z)))); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.3e+38) || ~((z <= 5.5e+53))) tmp = x + (t - (y * (t / z))); else tmp = x + ((y * t) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.3e+38], N[Not[LessEqual[z, 5.5e+53]], $MachinePrecision]], N[(x + N[(t - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+38} \lor \neg \left(z \leq 5.5 \cdot 10^{+53}\right):\\
\;\;\;\;x + \left(t - y \cdot \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -2.3000000000000001e38 or 5.49999999999999975e53 < z Initial program 69.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in a around 0 67.0%
mul-1-neg67.0%
unsub-neg67.0%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in z around 0 79.7%
neg-mul-179.7%
+-commutative79.7%
unsub-neg79.7%
associate-*l/90.0%
*-commutative90.0%
Simplified90.0%
if -2.3000000000000001e38 < z < 5.49999999999999975e53Initial program 93.7%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in y around inf 83.0%
Final simplification85.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e+23) (not (<= z 7.5e+84))) (+ t x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+23) || !(z <= 7.5e+84)) {
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 <= (-1.9d+23)) .or. (.not. (z <= 7.5d+84))) 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 <= -1.9e+23) || !(z <= 7.5e+84)) {
tmp = t + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e+23) or not (z <= 7.5e+84): tmp = t + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e+23) || !(z <= 7.5e+84)) 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 <= -1.9e+23) || ~((z <= 7.5e+84))) tmp = t + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e+23], N[Not[LessEqual[z, 7.5e+84]], $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 -1.9 \cdot 10^{+23} \lor \neg \left(z \leq 7.5 \cdot 10^{+84}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.89999999999999987e23 or 7.5000000000000001e84 < z Initial program 70.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.1%
if -1.89999999999999987e23 < z < 7.5000000000000001e84Initial program 93.6%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in z around 0 70.7%
div-inv70.7%
*-commutative70.7%
associate-*l*73.7%
div-inv73.7%
Applied egg-rr73.7%
Final simplification76.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.8e+27) (not (<= z 7.5e+84))) (+ t x) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.8e+27) || !(z <= 7.5e+84)) {
tmp = t + x;
} 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 <= (-7.8d+27)) .or. (.not. (z <= 7.5d+84))) then
tmp = t + x
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 <= -7.8e+27) || !(z <= 7.5e+84)) {
tmp = t + x;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.8e+27) or not (z <= 7.5e+84): tmp = t + x else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.8e+27) || !(z <= 7.5e+84)) tmp = Float64(t + x); 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 <= -7.8e+27) || ~((z <= 7.5e+84))) tmp = t + x; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.8e+27], N[Not[LessEqual[z, 7.5e+84]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+27} \lor \neg \left(z \leq 7.5 \cdot 10^{+84}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -7.7999999999999997e27 or 7.5000000000000001e84 < z Initial program 70.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.1%
if -7.7999999999999997e27 < z < 7.5000000000000001e84Initial program 93.6%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in z around 0 70.7%
div-inv70.7%
*-commutative70.7%
associate-*l*73.7%
div-inv73.7%
clear-num73.7%
div-inv73.8%
add-cube-cbrt73.6%
*-un-lft-identity73.6%
times-frac73.5%
pow273.5%
Applied egg-rr73.5%
/-rgt-identity73.5%
associate-*r/73.6%
unpow273.6%
rem-3cbrt-lft73.8%
Simplified73.8%
Final simplification76.9%
(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 83.8%
associate-*l/97.7%
Simplified97.7%
Final simplification97.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e+65) (not (<= z 1.52e-207))) (+ t x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e+65) || !(z <= 1.52e-207)) {
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+65)) .or. (.not. (z <= 1.52d-207))) 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+65) || !(z <= 1.52e-207)) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e+65) or not (z <= 1.52e-207): tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e+65) || !(z <= 1.52e-207)) 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+65) || ~((z <= 1.52e-207))) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e+65], N[Not[LessEqual[z, 1.52e-207]], $MachinePrecision]], N[(t + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+65} \lor \neg \left(z \leq 1.52 \cdot 10^{-207}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.8000000000000003e65 or 1.52000000000000005e-207 < z Initial program 77.6%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in z around inf 72.5%
if -4.8000000000000003e65 < z < 1.52000000000000005e-207Initial program 93.4%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in x around inf 51.9%
Final simplification64.4%
(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 83.8%
associate-*l/97.7%
Simplified97.7%
Taylor expanded in x around inf 51.4%
Final simplification51.4%
(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 2023310
(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))))