
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* t (/ (- y z) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + (t * ((y - z) / (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 + (t * ((y - z) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t * ((y - z) / (a - z)));
}
def code(x, y, z, t, a): return x + (t * ((y - z) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(t * Float64(Float64(y - z) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (t * ((y - z) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + t \cdot \frac{y - z}{a - z}
\end{array}
Initial program 86.7%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in y around 0 85.9%
associate-*r/85.9%
mul-1-neg85.9%
distribute-rgt-neg-out85.9%
associate-*l/86.5%
associate-*l/93.1%
distribute-lft-out95.0%
+-commutative95.0%
sub-neg95.0%
associate-*l/86.7%
associate-*r/98.8%
Simplified98.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.1e+68)
(+ x t)
(if (<= z 5.5e-45)
(+ x (* t (/ y a)))
(if (<= z 5e+121) (- x (/ t (/ z y))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e+68) {
tmp = x + t;
} else if (z <= 5.5e-45) {
tmp = x + (t * (y / a));
} else if (z <= 5e+121) {
tmp = x - (t / (z / y));
} else {
tmp = x + t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.1d+68)) then
tmp = x + t
else if (z <= 5.5d-45) then
tmp = x + (t * (y / a))
else if (z <= 5d+121) then
tmp = x - (t / (z / y))
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e+68) {
tmp = x + t;
} else if (z <= 5.5e-45) {
tmp = x + (t * (y / a));
} else if (z <= 5e+121) {
tmp = x - (t / (z / y));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.1e+68: tmp = x + t elif z <= 5.5e-45: tmp = x + (t * (y / a)) elif z <= 5e+121: tmp = x - (t / (z / y)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e+68) tmp = Float64(x + t); elseif (z <= 5.5e-45) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 5e+121) tmp = Float64(x - Float64(t / Float64(z / y))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.1e+68) tmp = x + t; elseif (z <= 5.5e-45) tmp = x + (t * (y / a)); elseif (z <= 5e+121) tmp = x - (t / (z / y)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e+68], N[(x + t), $MachinePrecision], If[LessEqual[z, 5.5e-45], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+121], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+68}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-45}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+121}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -3.0999999999999998e68 or 5.00000000000000007e121 < z Initial program 74.5%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in z around inf 81.0%
if -3.0999999999999998e68 < z < 5.5000000000000003e-45Initial program 93.2%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in y around inf 84.7%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in a around inf 72.3%
+-commutative72.3%
associate-/l*78.3%
Simplified78.3%
if 5.5000000000000003e-45 < z < 5.00000000000000007e121Initial program 92.9%
+-commutative92.9%
associate-/l*99.8%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 75.5%
mul-1-neg75.5%
unsub-neg75.5%
associate-/l*82.4%
Simplified82.4%
clear-num82.4%
un-div-inv82.6%
Applied egg-rr82.6%
Taylor expanded in z around 0 81.5%
Final simplification79.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5e+63)
(+ x t)
(if (<= z 4.4e-44)
(+ x (* t (/ y a)))
(if (<= z 3.2e+119) (- x (* y (/ t z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e+63) {
tmp = x + t;
} else if (z <= 4.4e-44) {
tmp = x + (t * (y / a));
} else if (z <= 3.2e+119) {
tmp = x - (y * (t / z));
} else {
tmp = x + t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5d+63)) then
tmp = x + t
else if (z <= 4.4d-44) then
tmp = x + (t * (y / a))
else if (z <= 3.2d+119) then
tmp = x - (y * (t / z))
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e+63) {
tmp = x + t;
} else if (z <= 4.4e-44) {
tmp = x + (t * (y / a));
} else if (z <= 3.2e+119) {
tmp = x - (y * (t / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5e+63: tmp = x + t elif z <= 4.4e-44: tmp = x + (t * (y / a)) elif z <= 3.2e+119: tmp = x - (y * (t / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e+63) tmp = Float64(x + t); elseif (z <= 4.4e-44) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 3.2e+119) tmp = Float64(x - Float64(y * Float64(t / z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5e+63) tmp = x + t; elseif (z <= 4.4e-44) tmp = x + (t * (y / a)); elseif (z <= 3.2e+119) tmp = x - (y * (t / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e+63], N[(x + t), $MachinePrecision], If[LessEqual[z, 4.4e-44], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+119], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+63}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-44}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+119}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -5.00000000000000011e63 or 3.19999999999999989e119 < z Initial program 74.5%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in z around inf 81.0%
if -5.00000000000000011e63 < z < 4.40000000000000024e-44Initial program 93.2%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in y around inf 84.7%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in a around inf 72.3%
+-commutative72.3%
associate-/l*78.3%
Simplified78.3%
if 4.40000000000000024e-44 < z < 3.19999999999999989e119Initial program 92.9%
+-commutative92.9%
associate-/l*99.8%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 75.5%
mul-1-neg75.5%
unsub-neg75.5%
associate-/l*82.4%
Simplified82.4%
clear-num82.4%
un-div-inv82.6%
Applied egg-rr82.6%
Taylor expanded in z around 0 81.5%
associate-/r/81.4%
Applied egg-rr81.4%
Final simplification79.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.35e+70)
(+ x t)
(if (<= z 4.5e-44)
(+ x (* t (/ y a)))
(if (<= z 1.65e+120) (- x (* t (/ y z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e+70) {
tmp = x + t;
} else if (z <= 4.5e-44) {
tmp = x + (t * (y / a));
} else if (z <= 1.65e+120) {
tmp = x - (t * (y / z));
} else {
tmp = x + t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.35d+70)) then
tmp = x + t
else if (z <= 4.5d-44) then
tmp = x + (t * (y / a))
else if (z <= 1.65d+120) then
tmp = x - (t * (y / z))
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e+70) {
tmp = x + t;
} else if (z <= 4.5e-44) {
tmp = x + (t * (y / a));
} else if (z <= 1.65e+120) {
tmp = x - (t * (y / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.35e+70: tmp = x + t elif z <= 4.5e-44: tmp = x + (t * (y / a)) elif z <= 1.65e+120: tmp = x - (t * (y / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e+70) tmp = Float64(x + t); elseif (z <= 4.5e-44) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 1.65e+120) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.35e+70) tmp = x + t; elseif (z <= 4.5e-44) tmp = x + (t * (y / a)); elseif (z <= 1.65e+120) tmp = x - (t * (y / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e+70], N[(x + t), $MachinePrecision], If[LessEqual[z, 4.5e-44], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+120], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+70}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-44}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+120}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.35e70 or 1.64999999999999995e120 < z Initial program 74.5%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in z around inf 81.0%
if -1.35e70 < z < 4.4999999999999999e-44Initial program 93.2%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in y around inf 84.7%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in a around inf 72.3%
+-commutative72.3%
associate-/l*78.3%
Simplified78.3%
if 4.4999999999999999e-44 < z < 1.64999999999999995e120Initial program 92.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 82.2%
associate-/l*85.6%
Simplified85.6%
Taylor expanded in a around 0 78.0%
mul-1-neg78.0%
unsub-neg78.0%
associate-/l*81.4%
Simplified81.4%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.16e-103) (not (<= y 1.15e-47))) (+ x (* t (/ y (- a z)))) (+ x (* t (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.16e-103) || !(y <= 1.15e-47)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (t * (z / (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 <= (-2.16d-103)) .or. (.not. (y <= 1.15d-47))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (t * (z / (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 <= -2.16e-103) || !(y <= 1.15e-47)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (t * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.16e-103) or not (y <= 1.15e-47): tmp = x + (t * (y / (a - z))) else: tmp = x + (t * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.16e-103) || !(y <= 1.15e-47)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.16e-103) || ~((y <= 1.15e-47))) tmp = x + (t * (y / (a - z))); else tmp = x + (t * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.16e-103], N[Not[LessEqual[y, 1.15e-47]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.16 \cdot 10^{-103} \lor \neg \left(y \leq 1.15 \cdot 10^{-47}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if y < -2.1599999999999999e-103 or 1.14999999999999991e-47 < y Initial program 83.7%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in y around inf 81.6%
associate-/l*88.7%
Simplified88.7%
if -2.1599999999999999e-103 < y < 1.14999999999999991e-47Initial program 92.4%
+-commutative92.4%
associate-/l*91.4%
fma-define91.4%
Simplified91.4%
Taylor expanded in y around 0 89.0%
mul-1-neg89.0%
unsub-neg89.0%
associate-/l*96.5%
*-commutative96.5%
associate-/r/89.8%
Simplified89.8%
associate-/r/96.5%
Applied egg-rr96.5%
Final simplification91.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.7e+136) (not (<= z 6e+94))) (+ x (* t (/ (- z y) z))) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e+136) || !(z <= 6e+94)) {
tmp = x + (t * ((z - 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 <= (-1.7d+136)) .or. (.not. (z <= 6d+94))) then
tmp = x + (t * ((z - 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 <= -1.7e+136) || !(z <= 6e+94)) {
tmp = x + (t * ((z - y) / z));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.7e+136) or not (z <= 6e+94): tmp = x + (t * ((z - y) / z)) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.7e+136) || !(z <= 6e+94)) tmp = Float64(x + Float64(t * Float64(Float64(z - 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 <= -1.7e+136) || ~((z <= 6e+94))) tmp = x + (t * ((z - y) / z)); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.7e+136], N[Not[LessEqual[z, 6e+94]], $MachinePrecision]], N[(x + N[(t * N[(N[(z - y), $MachinePrecision] / z), $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 -1.7 \cdot 10^{+136} \lor \neg \left(z \leq 6 \cdot 10^{+94}\right):\\
\;\;\;\;x + t \cdot \frac{z - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.69999999999999998e136 or 6.0000000000000001e94 < z Initial program 72.0%
+-commutative72.0%
associate-/l*94.8%
fma-define94.8%
Simplified94.8%
Taylor expanded in a around 0 68.4%
mul-1-neg68.4%
unsub-neg68.4%
associate-/l*92.4%
Simplified92.4%
if -1.69999999999999998e136 < z < 6.0000000000000001e94Initial program 93.4%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in y around inf 83.9%
associate-/l*88.8%
Simplified88.8%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.16e+179) (not (<= z 2.6e+161))) (+ x t) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.16e+179) || !(z <= 2.6e+161)) {
tmp = x + t;
} 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.16d+179)) .or. (.not. (z <= 2.6d+161))) then
tmp = x + t
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.16e+179) || !(z <= 2.6e+161)) {
tmp = x + t;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.16e+179) or not (z <= 2.6e+161): tmp = x + t else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.16e+179) || !(z <= 2.6e+161)) tmp = Float64(x + t); 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.16e+179) || ~((z <= 2.6e+161))) tmp = x + t; else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.16e+179], N[Not[LessEqual[z, 2.6e+161]], $MachinePrecision]], N[(x + t), $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.16 \cdot 10^{+179} \lor \neg \left(z \leq 2.6 \cdot 10^{+161}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.16e179 or 2.5999999999999998e161 < z Initial program 67.9%
associate-/l*93.3%
Simplified93.3%
Taylor expanded in z around inf 88.1%
if -1.16e179 < z < 2.5999999999999998e161Initial program 92.7%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in y around inf 82.0%
associate-/l*86.4%
Simplified86.4%
Final simplification86.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e+65) (not (<= z 5e-10))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+65) || !(z <= 5e-10)) {
tmp = x + t;
} 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 <= (-1.9d+65)) .or. (.not. (z <= 5d-10))) then
tmp = x + t
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 <= -1.9e+65) || !(z <= 5e-10)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e+65) or not (z <= 5e-10): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e+65) || !(z <= 5e-10)) tmp = Float64(x + t); 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 <= -1.9e+65) || ~((z <= 5e-10))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e+65], N[Not[LessEqual[z, 5e-10]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+65} \lor \neg \left(z \leq 5 \cdot 10^{-10}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.90000000000000006e65 or 5.00000000000000031e-10 < z Initial program 77.7%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in z around inf 77.6%
if -1.90000000000000006e65 < z < 5.00000000000000031e-10Initial program 93.4%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in y around inf 84.6%
associate-/l*89.2%
Simplified89.2%
Taylor expanded in a around inf 71.3%
+-commutative71.3%
associate-/l*77.1%
Simplified77.1%
Final simplification77.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5e+64) (not (<= z 1.5e-9))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5e+64) || !(z <= 1.5e-9)) {
tmp = x + t;
} 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 <= (-5d+64)) .or. (.not. (z <= 1.5d-9))) then
tmp = x + t
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 <= -5e+64) || !(z <= 1.5e-9)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5e+64) or not (z <= 1.5e-9): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5e+64) || !(z <= 1.5e-9)) tmp = Float64(x + t); 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 <= -5e+64) || ~((z <= 1.5e-9))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5e+64], N[Not[LessEqual[z, 1.5e-9]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+64} \lor \neg \left(z \leq 1.5 \cdot 10^{-9}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -5e64 or 1.49999999999999999e-9 < z Initial program 77.7%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in z around inf 77.6%
if -5e64 < z < 1.49999999999999999e-9Initial program 93.4%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in z around 0 71.3%
*-commutative71.3%
associate-/l*75.8%
Simplified75.8%
Final simplification76.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.6e+91) (not (<= z 1.06e-171))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.6e+91) || !(z <= 1.06e-171)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.6d+91)) .or. (.not. (z <= 1.06d-171))) then
tmp = x + t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.6e+91) || !(z <= 1.06e-171)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.6e+91) or not (z <= 1.06e-171): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.6e+91) || !(z <= 1.06e-171)) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.6e+91) || ~((z <= 1.06e-171))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.6e+91], N[Not[LessEqual[z, 1.06e-171]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+91} \lor \neg \left(z \leq 1.06 \cdot 10^{-171}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.59999999999999995e91 or 1.0599999999999999e-171 < z Initial program 79.9%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in z around inf 68.1%
if -1.59999999999999995e91 < z < 1.0599999999999999e-171Initial program 95.6%
+-commutative95.6%
associate-/l*94.7%
fma-define94.8%
Simplified94.8%
Taylor expanded in t around 0 50.9%
Final simplification60.7%
(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 86.7%
+-commutative86.7%
associate-/l*95.0%
fma-define95.0%
Simplified95.0%
Taylor expanded in t around 0 50.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 2024107
(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))))