
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(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(y / Float64(Float64(z - a) / Float64(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[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
Initial program 98.8%
clear-num98.8%
un-div-inv98.8%
Applied egg-rr98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -5e-8)
(+ x (/ (* y t) (- a z)))
(if (<= t_1 4e-6)
(+ x (* y (/ (- t z) a)))
(if (<= t_1 1000000.0)
(- x (* y (/ (- t z) z)))
(+ x (* y (/ t (- a z)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -5e-8) {
tmp = x + ((y * t) / (a - z));
} else if (t_1 <= 4e-6) {
tmp = x + (y * ((t - z) / a));
} else if (t_1 <= 1000000.0) {
tmp = x - (y * ((t - z) / 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) :: t_1
real(8) :: tmp
t_1 = (z - t) / (z - a)
if (t_1 <= (-5d-8)) then
tmp = x + ((y * t) / (a - z))
else if (t_1 <= 4d-6) then
tmp = x + (y * ((t - z) / a))
else if (t_1 <= 1000000.0d0) then
tmp = x - (y * ((t - z) / 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 t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -5e-8) {
tmp = x + ((y * t) / (a - z));
} else if (t_1 <= 4e-6) {
tmp = x + (y * ((t - z) / a));
} else if (t_1 <= 1000000.0) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -5e-8: tmp = x + ((y * t) / (a - z)) elif t_1 <= 4e-6: tmp = x + (y * ((t - z) / a)) elif t_1 <= 1000000.0: tmp = x - (y * ((t - z) / z)) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -5e-8) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); elseif (t_1 <= 4e-6) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); elseif (t_1 <= 1000000.0) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -5e-8) tmp = x + ((y * t) / (a - z)); elseif (t_1 <= 4e-6) tmp = x + (y * ((t - z) / a)); elseif (t_1 <= 1000000.0) tmp = x - (y * ((t - z) / z)); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-8], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e-6], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1000000.0], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-8}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-6}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{elif}\;t\_1 \leq 1000000:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -4.9999999999999998e-8Initial program 97.3%
clear-num97.5%
un-div-inv97.5%
Applied egg-rr97.5%
Taylor expanded in t around inf 99.1%
mul-1-neg99.1%
associate-/l*91.9%
distribute-lft-neg-out91.9%
*-commutative91.9%
Simplified91.9%
*-commutative91.9%
add-sqr-sqrt51.7%
sqrt-unprod50.8%
sqr-neg50.8%
sqrt-unprod17.7%
add-sqr-sqrt27.9%
cancel-sign-sub-inv27.9%
*-commutative27.9%
associate-*l/27.9%
add-sqr-sqrt17.7%
sqrt-unprod50.9%
sqr-neg50.9%
sqrt-unprod54.1%
add-sqr-sqrt99.1%
Applied egg-rr99.1%
if -4.9999999999999998e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 3.99999999999999982e-6Initial program 99.0%
+-commutative99.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in a around inf 85.5%
+-commutative85.5%
mul-1-neg85.5%
associate-/l*97.7%
distribute-rgt-neg-in97.7%
distribute-frac-neg97.7%
neg-sub097.7%
sub-neg97.7%
+-commutative97.7%
associate--r+97.7%
neg-sub097.7%
remove-double-neg97.7%
Simplified97.7%
if 3.99999999999999982e-6 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e6Initial program 100.0%
Taylor expanded in a around 0 99.4%
if 1e6 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.5%
Taylor expanded in t around inf 90.1%
associate-*r/90.1%
mul-1-neg90.1%
distribute-lft-neg-out90.1%
*-commutative90.1%
*-lft-identity90.1%
times-frac96.7%
/-rgt-identity96.7%
distribute-neg-frac96.7%
distribute-neg-frac296.7%
neg-sub096.7%
sub-neg96.7%
+-commutative96.7%
associate--r+96.7%
neg-sub096.7%
remove-double-neg96.7%
Simplified96.7%
Final simplification98.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (+ x (* y (/ t (- a z))))))
(if (<= t_1 -2000000000.0)
t_2
(if (<= t_1 4e-6)
(+ x (* y (/ (- t z) a)))
(if (<= t_1 1000000.0) (- x (* y (/ (- t z) z))) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = x + (y * (t / (a - z)));
double tmp;
if (t_1 <= -2000000000.0) {
tmp = t_2;
} else if (t_1 <= 4e-6) {
tmp = x + (y * ((t - z) / a));
} else if (t_1 <= 1000000.0) {
tmp = x - (y * ((t - z) / z));
} 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 = (z - t) / (z - a)
t_2 = x + (y * (t / (a - z)))
if (t_1 <= (-2000000000.0d0)) then
tmp = t_2
else if (t_1 <= 4d-6) then
tmp = x + (y * ((t - z) / a))
else if (t_1 <= 1000000.0d0) then
tmp = x - (y * ((t - z) / z))
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 = (z - t) / (z - a);
double t_2 = x + (y * (t / (a - z)));
double tmp;
if (t_1 <= -2000000000.0) {
tmp = t_2;
} else if (t_1 <= 4e-6) {
tmp = x + (y * ((t - z) / a));
} else if (t_1 <= 1000000.0) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = x + (y * (t / (a - z))) tmp = 0 if t_1 <= -2000000000.0: tmp = t_2 elif t_1 <= 4e-6: tmp = x + (y * ((t - z) / a)) elif t_1 <= 1000000.0: tmp = x - (y * ((t - z) / z)) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(x + Float64(y * Float64(t / Float64(a - z)))) tmp = 0.0 if (t_1 <= -2000000000.0) tmp = t_2; elseif (t_1 <= 4e-6) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); elseif (t_1 <= 1000000.0) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = x + (y * (t / (a - z))); tmp = 0.0; if (t_1 <= -2000000000.0) tmp = t_2; elseif (t_1 <= 4e-6) tmp = x + (y * ((t - z) / a)); elseif (t_1 <= 1000000.0) tmp = x - (y * ((t - z) / z)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2000000000.0], t$95$2, If[LessEqual[t$95$1, 4e-6], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1000000.0], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := x + y \cdot \frac{t}{a - z}\\
\mathbf{if}\;t\_1 \leq -2000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-6}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{elif}\;t\_1 \leq 1000000:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e9 or 1e6 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.4%
Taylor expanded in t around inf 94.6%
associate-*r/94.6%
mul-1-neg94.6%
distribute-lft-neg-out94.6%
*-commutative94.6%
*-lft-identity94.6%
times-frac96.5%
/-rgt-identity96.5%
distribute-neg-frac96.5%
distribute-neg-frac296.5%
neg-sub096.5%
sub-neg96.5%
+-commutative96.5%
associate--r+96.5%
neg-sub096.5%
remove-double-neg96.5%
Simplified96.5%
if -2e9 < (/.f64 (-.f64 z t) (-.f64 z a)) < 3.99999999999999982e-6Initial program 99.0%
+-commutative99.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in a around inf 85.8%
+-commutative85.8%
mul-1-neg85.8%
associate-/l*97.8%
distribute-rgt-neg-in97.8%
distribute-frac-neg97.8%
neg-sub097.8%
sub-neg97.8%
+-commutative97.8%
associate--r+97.8%
neg-sub097.8%
remove-double-neg97.8%
Simplified97.8%
if 3.99999999999999982e-6 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e6Initial program 100.0%
Taylor expanded in a around 0 99.4%
Final simplification97.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (+ x (* y (/ t (- a z))))))
(if (<= t_1 -5e-8)
t_2
(if (<= t_1 4e-6)
(- x (* y (/ z a)))
(if (<= t_1 1000000.0) (- x (* y (/ (- t z) z))) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = x + (y * (t / (a - z)));
double tmp;
if (t_1 <= -5e-8) {
tmp = t_2;
} else if (t_1 <= 4e-6) {
tmp = x - (y * (z / a));
} else if (t_1 <= 1000000.0) {
tmp = x - (y * ((t - z) / z));
} 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 = (z - t) / (z - a)
t_2 = x + (y * (t / (a - z)))
if (t_1 <= (-5d-8)) then
tmp = t_2
else if (t_1 <= 4d-6) then
tmp = x - (y * (z / a))
else if (t_1 <= 1000000.0d0) then
tmp = x - (y * ((t - z) / z))
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 = (z - t) / (z - a);
double t_2 = x + (y * (t / (a - z)));
double tmp;
if (t_1 <= -5e-8) {
tmp = t_2;
} else if (t_1 <= 4e-6) {
tmp = x - (y * (z / a));
} else if (t_1 <= 1000000.0) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = x + (y * (t / (a - z))) tmp = 0 if t_1 <= -5e-8: tmp = t_2 elif t_1 <= 4e-6: tmp = x - (y * (z / a)) elif t_1 <= 1000000.0: tmp = x - (y * ((t - z) / z)) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(x + Float64(y * Float64(t / Float64(a - z)))) tmp = 0.0 if (t_1 <= -5e-8) tmp = t_2; elseif (t_1 <= 4e-6) tmp = Float64(x - Float64(y * Float64(z / a))); elseif (t_1 <= 1000000.0) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = x + (y * (t / (a - z))); tmp = 0.0; if (t_1 <= -5e-8) tmp = t_2; elseif (t_1 <= 4e-6) tmp = x - (y * (z / a)); elseif (t_1 <= 1000000.0) tmp = x - (y * ((t - z) / z)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-8], t$95$2, If[LessEqual[t$95$1, 4e-6], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1000000.0], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := x + y \cdot \frac{t}{a - z}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-8}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-6}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{elif}\;t\_1 \leq 1000000:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -4.9999999999999998e-8 or 1e6 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.4%
Taylor expanded in t around inf 94.7%
associate-*r/94.7%
mul-1-neg94.7%
distribute-lft-neg-out94.7%
*-commutative94.7%
*-lft-identity94.7%
times-frac96.6%
/-rgt-identity96.6%
distribute-neg-frac96.6%
distribute-neg-frac296.6%
neg-sub096.6%
sub-neg96.6%
+-commutative96.6%
associate--r+96.6%
neg-sub096.6%
remove-double-neg96.6%
Simplified96.6%
if -4.9999999999999998e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 3.99999999999999982e-6Initial program 99.0%
+-commutative99.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in t around 0 80.3%
+-commutative80.3%
associate-/l*87.2%
Simplified87.2%
Taylor expanded in z around 0 79.5%
mul-1-neg79.5%
unsub-neg79.5%
associate-/l*86.0%
Simplified86.0%
if 3.99999999999999982e-6 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e6Initial program 100.0%
Taylor expanded in a around 0 99.4%
Final simplification93.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (+ x (* y (/ t (- a z))))))
(if (<= t_1 -5e-8)
t_2
(if (<= t_1 4e-6)
(- x (* y (/ z a)))
(if (<= t_1 1.00001) (+ x y) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = x + (y * (t / (a - z)));
double tmp;
if (t_1 <= -5e-8) {
tmp = t_2;
} else if (t_1 <= 4e-6) {
tmp = x - (y * (z / a));
} else if (t_1 <= 1.00001) {
tmp = x + y;
} 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 = (z - t) / (z - a)
t_2 = x + (y * (t / (a - z)))
if (t_1 <= (-5d-8)) then
tmp = t_2
else if (t_1 <= 4d-6) then
tmp = x - (y * (z / a))
else if (t_1 <= 1.00001d0) then
tmp = x + y
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 = (z - t) / (z - a);
double t_2 = x + (y * (t / (a - z)));
double tmp;
if (t_1 <= -5e-8) {
tmp = t_2;
} else if (t_1 <= 4e-6) {
tmp = x - (y * (z / a));
} else if (t_1 <= 1.00001) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = x + (y * (t / (a - z))) tmp = 0 if t_1 <= -5e-8: tmp = t_2 elif t_1 <= 4e-6: tmp = x - (y * (z / a)) elif t_1 <= 1.00001: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(x + Float64(y * Float64(t / Float64(a - z)))) tmp = 0.0 if (t_1 <= -5e-8) tmp = t_2; elseif (t_1 <= 4e-6) tmp = Float64(x - Float64(y * Float64(z / a))); elseif (t_1 <= 1.00001) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = x + (y * (t / (a - z))); tmp = 0.0; if (t_1 <= -5e-8) tmp = t_2; elseif (t_1 <= 4e-6) tmp = x - (y * (z / a)); elseif (t_1 <= 1.00001) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-8], t$95$2, If[LessEqual[t$95$1, 4e-6], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.00001], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := x + y \cdot \frac{t}{a - z}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-8}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-6}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{elif}\;t\_1 \leq 1.00001:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -4.9999999999999998e-8 or 1.0000100000000001 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.5%
Taylor expanded in t around inf 94.3%
associate-*r/94.3%
mul-1-neg94.3%
distribute-lft-neg-out94.3%
*-commutative94.3%
*-lft-identity94.3%
times-frac96.1%
/-rgt-identity96.1%
distribute-neg-frac96.1%
distribute-neg-frac296.1%
neg-sub096.1%
sub-neg96.1%
+-commutative96.1%
associate--r+96.1%
neg-sub096.1%
remove-double-neg96.1%
Simplified96.1%
if -4.9999999999999998e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 3.99999999999999982e-6Initial program 99.0%
+-commutative99.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in t around 0 80.3%
+-commutative80.3%
associate-/l*87.2%
Simplified87.2%
Taylor expanded in z around 0 79.5%
mul-1-neg79.5%
unsub-neg79.5%
associate-/l*86.0%
Simplified86.0%
if 3.99999999999999982e-6 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000100000000001Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 98.7%
+-commutative98.7%
Simplified98.7%
Final simplification93.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -4e-8)
(* y t_1)
(if (<= t_1 4e-6)
(- x (* y (/ z a)))
(if (<= t_1 5e+35) (+ x y) (* y (/ t (- a z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -4e-8) {
tmp = y * t_1;
} else if (t_1 <= 4e-6) {
tmp = x - (y * (z / a));
} else if (t_1 <= 5e+35) {
tmp = x + y;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = (z - t) / (z - a)
if (t_1 <= (-4d-8)) then
tmp = y * t_1
else if (t_1 <= 4d-6) then
tmp = x - (y * (z / a))
else if (t_1 <= 5d+35) then
tmp = x + y
else
tmp = 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 t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -4e-8) {
tmp = y * t_1;
} else if (t_1 <= 4e-6) {
tmp = x - (y * (z / a));
} else if (t_1 <= 5e+35) {
tmp = x + y;
} else {
tmp = y * (t / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -4e-8: tmp = y * t_1 elif t_1 <= 4e-6: tmp = x - (y * (z / a)) elif t_1 <= 5e+35: tmp = x + y else: tmp = y * (t / (a - z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -4e-8) tmp = Float64(y * t_1); elseif (t_1 <= 4e-6) tmp = Float64(x - Float64(y * Float64(z / a))); elseif (t_1 <= 5e+35) tmp = Float64(x + y); else tmp = Float64(y * Float64(t / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -4e-8) tmp = y * t_1; elseif (t_1 <= 4e-6) tmp = x - (y * (z / a)); elseif (t_1 <= 5e+35) tmp = x + y; else tmp = y * (t / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-8], N[(y * t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 4e-6], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+35], N[(x + y), $MachinePrecision], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-8}:\\
\;\;\;\;y \cdot t\_1\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-6}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+35}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -4.0000000000000001e-8Initial program 97.4%
+-commutative97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in y around inf 88.7%
associate--l+88.7%
div-sub88.7%
Simplified88.7%
Taylor expanded in x around 0 71.5%
div-sub71.5%
Simplified71.5%
if -4.0000000000000001e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 3.99999999999999982e-6Initial program 98.9%
+-commutative98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in t around 0 81.0%
+-commutative81.0%
associate-/l*87.1%
Simplified87.1%
Taylor expanded in z around 0 80.3%
mul-1-neg80.3%
unsub-neg80.3%
associate-/l*86.3%
Simplified86.3%
if 3.99999999999999982e-6 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5.00000000000000021e35Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 96.8%
+-commutative96.8%
Simplified96.8%
if 5.00000000000000021e35 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.2%
+-commutative97.2%
fma-define97.2%
Simplified97.2%
Taylor expanded in y around inf 83.3%
associate--l+83.3%
div-sub83.3%
Simplified83.3%
Taylor expanded in x around 0 67.5%
div-sub67.5%
Simplified67.5%
Taylor expanded in t around inf 62.1%
associate-*r/91.8%
mul-1-neg91.8%
distribute-lft-neg-out91.8%
*-commutative91.8%
*-lft-identity91.8%
times-frac97.2%
/-rgt-identity97.2%
distribute-neg-frac97.2%
distribute-neg-frac297.2%
neg-sub097.2%
sub-neg97.2%
+-commutative97.2%
associate--r+97.2%
neg-sub097.2%
remove-double-neg97.2%
Simplified67.5%
Final simplification84.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (or (<= t_1 -5e-8) (not (<= t_1 1.00001)))
(+ x (* y (/ t (- a z))))
(+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if ((t_1 <= -5e-8) || !(t_1 <= 1.00001)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (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) :: t_1
real(8) :: tmp
t_1 = (z - t) / (z - a)
if ((t_1 <= (-5d-8)) .or. (.not. (t_1 <= 1.00001d0))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if ((t_1 <= -5e-8) || !(t_1 <= 1.00001)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if (t_1 <= -5e-8) or not (t_1 <= 1.00001): tmp = x + (y * (t / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if ((t_1 <= -5e-8) || !(t_1 <= 1.00001)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if ((t_1 <= -5e-8) || ~((t_1 <= 1.00001))) tmp = x + (y * (t / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e-8], N[Not[LessEqual[t$95$1, 1.00001]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-8} \lor \neg \left(t\_1 \leq 1.00001\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -4.9999999999999998e-8 or 1.0000100000000001 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.5%
Taylor expanded in t around inf 94.3%
associate-*r/94.3%
mul-1-neg94.3%
distribute-lft-neg-out94.3%
*-commutative94.3%
*-lft-identity94.3%
times-frac96.1%
/-rgt-identity96.1%
distribute-neg-frac96.1%
distribute-neg-frac296.1%
neg-sub096.1%
sub-neg96.1%
+-commutative96.1%
associate--r+96.1%
neg-sub096.1%
remove-double-neg96.1%
Simplified96.1%
if -4.9999999999999998e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000100000000001Initial program 99.4%
+-commutative99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in t around 0 80.9%
+-commutative80.9%
associate-/l*92.5%
Simplified92.5%
Final simplification93.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.5e-15)
(+ x y)
(if (<= z 1.1e-19)
(+ x (* t (/ y a)))
(if (<= z 3.2e+82) (- x (* t (/ y z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e-15) {
tmp = x + y;
} else if (z <= 1.1e-19) {
tmp = x + (t * (y / a));
} else if (z <= 3.2e+82) {
tmp = x - (t * (y / z));
} else {
tmp = x + 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 <= (-5.5d-15)) then
tmp = x + y
else if (z <= 1.1d-19) then
tmp = x + (t * (y / a))
else if (z <= 3.2d+82) then
tmp = x - (t * (y / z))
else
tmp = x + 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 <= -5.5e-15) {
tmp = x + y;
} else if (z <= 1.1e-19) {
tmp = x + (t * (y / a));
} else if (z <= 3.2e+82) {
tmp = x - (t * (y / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e-15: tmp = x + y elif z <= 1.1e-19: tmp = x + (t * (y / a)) elif z <= 3.2e+82: tmp = x - (t * (y / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e-15) tmp = Float64(x + y); elseif (z <= 1.1e-19) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 3.2e+82) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e-15) tmp = x + y; elseif (z <= 1.1e-19) tmp = x + (t * (y / a)); elseif (z <= 3.2e+82) tmp = x - (t * (y / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e-15], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.1e-19], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+82], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-15}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-19}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+82}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.5000000000000002e-15 or 3.19999999999999975e82 < z Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 78.9%
+-commutative78.9%
Simplified78.9%
if -5.5000000000000002e-15 < z < 1.0999999999999999e-19Initial program 97.7%
+-commutative97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in z around 0 75.8%
+-commutative75.8%
associate-/l*78.4%
Simplified78.4%
if 1.0999999999999999e-19 < z < 3.19999999999999975e82Initial program 99.9%
Taylor expanded in t around inf 80.6%
associate-*r/80.6%
mul-1-neg80.6%
distribute-lft-neg-out80.6%
*-commutative80.6%
*-lft-identity80.6%
times-frac89.2%
/-rgt-identity89.2%
distribute-neg-frac89.2%
distribute-neg-frac289.2%
neg-sub089.2%
sub-neg89.2%
+-commutative89.2%
associate--r+89.2%
neg-sub089.2%
remove-double-neg89.2%
Simplified89.2%
Taylor expanded in a around 0 80.2%
mul-1-neg80.2%
unsub-neg80.2%
associate-/l*81.4%
Simplified81.4%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4e-15) (not (<= z 1.9e+79))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e-15) || !(z <= 1.9e+79)) {
tmp = x + y;
} 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 <= (-4d-15)) .or. (.not. (z <= 1.9d+79))) then
tmp = x + y
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 <= -4e-15) || !(z <= 1.9e+79)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4e-15) or not (z <= 1.9e+79): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4e-15) || !(z <= 1.9e+79)) tmp = Float64(x + y); 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 <= -4e-15) || ~((z <= 1.9e+79))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4e-15], N[Not[LessEqual[z, 1.9e+79]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-15} \lor \neg \left(z \leq 1.9 \cdot 10^{+79}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -4.0000000000000003e-15 or 1.9000000000000001e79 < z Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -4.0000000000000003e-15 < z < 1.9000000000000001e79Initial program 98.0%
+-commutative98.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in z around 0 72.6%
+-commutative72.6%
associate-/l*75.4%
Simplified75.4%
Final simplification76.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.5e-16) (not (<= z 1.9e+79))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.5e-16) || !(z <= 1.9e+79)) {
tmp = x + y;
} 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 <= (-8.5d-16)) .or. (.not. (z <= 1.9d+79))) then
tmp = x + y
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 <= -8.5e-16) || !(z <= 1.9e+79)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.5e-16) or not (z <= 1.9e+79): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.5e-16) || !(z <= 1.9e+79)) tmp = Float64(x + y); 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 <= -8.5e-16) || ~((z <= 1.9e+79))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.5e-16], N[Not[LessEqual[z, 1.9e+79]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-16} \lor \neg \left(z \leq 1.9 \cdot 10^{+79}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -8.5000000000000001e-16 or 1.9000000000000001e79 < z Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -8.5000000000000001e-16 < z < 1.9000000000000001e79Initial program 98.0%
clear-num98.0%
un-div-inv98.0%
Applied egg-rr98.0%
Taylor expanded in z around 0 75.0%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e-16) (not (<= z 7.6e+79))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e-16) || !(z <= 7.6e+79)) {
tmp = x + y;
} 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 <= (-9d-16)) .or. (.not. (z <= 7.6d+79))) then
tmp = x + y
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 <= -9e-16) || !(z <= 7.6e+79)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e-16) or not (z <= 7.6e+79): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e-16) || !(z <= 7.6e+79)) tmp = Float64(x + y); 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 <= -9e-16) || ~((z <= 7.6e+79))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e-16], N[Not[LessEqual[z, 7.6e+79]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-16} \lor \neg \left(z \leq 7.6 \cdot 10^{+79}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -9.0000000000000003e-16 or 7.6000000000000005e79 < z Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -9.0000000000000003e-16 < z < 7.6000000000000005e79Initial program 98.0%
Taylor expanded in z around 0 75.0%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -8.2e+71) (not (<= y 6.8e+221))) (* y (/ t (- a z))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -8.2e+71) || !(y <= 6.8e+221)) {
tmp = y * (t / (a - z));
} else {
tmp = x + 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 ((y <= (-8.2d+71)) .or. (.not. (y <= 6.8d+221))) then
tmp = y * (t / (a - z))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -8.2e+71) || !(y <= 6.8e+221)) {
tmp = y * (t / (a - z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -8.2e+71) or not (y <= 6.8e+221): tmp = y * (t / (a - z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -8.2e+71) || !(y <= 6.8e+221)) tmp = Float64(y * Float64(t / Float64(a - z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -8.2e+71) || ~((y <= 6.8e+221))) tmp = y * (t / (a - z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -8.2e+71], N[Not[LessEqual[y, 6.8e+221]], $MachinePrecision]], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+71} \lor \neg \left(y \leq 6.8 \cdot 10^{+221}\right):\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -8.2000000000000004e71 or 6.7999999999999997e221 < y Initial program 99.8%
+-commutative99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 99.7%
associate--l+99.7%
div-sub99.7%
Simplified99.7%
Taylor expanded in x around 0 83.1%
div-sub83.1%
Simplified83.1%
Taylor expanded in t around inf 39.2%
associate-*r/51.7%
mul-1-neg51.7%
distribute-lft-neg-out51.7%
*-commutative51.7%
*-lft-identity51.7%
times-frac67.1%
/-rgt-identity67.1%
distribute-neg-frac67.1%
distribute-neg-frac267.1%
neg-sub067.1%
sub-neg67.1%
+-commutative67.1%
associate--r+67.1%
neg-sub067.1%
remove-double-neg67.1%
Simplified51.4%
if -8.2000000000000004e71 < y < 6.7999999999999997e221Initial program 98.5%
+-commutative98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in z around inf 70.3%
+-commutative70.3%
Simplified70.3%
Final simplification65.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.2e+72) (* y (/ t (- a z))) (if (<= y 1.7e+207) (+ x y) (* y (/ (- z t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.2e+72) {
tmp = y * (t / (a - z));
} else if (y <= 1.7e+207) {
tmp = x + y;
} else {
tmp = y * ((z - t) / 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.2d+72)) then
tmp = y * (t / (a - z))
else if (y <= 1.7d+207) then
tmp = x + y
else
tmp = y * ((z - t) / 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.2e+72) {
tmp = y * (t / (a - z));
} else if (y <= 1.7e+207) {
tmp = x + y;
} else {
tmp = y * ((z - t) / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.2e+72: tmp = y * (t / (a - z)) elif y <= 1.7e+207: tmp = x + y else: tmp = y * ((z - t) / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.2e+72) tmp = Float64(y * Float64(t / Float64(a - z))); elseif (y <= 1.7e+207) tmp = Float64(x + y); else tmp = Float64(y * Float64(Float64(z - t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.2e+72) tmp = y * (t / (a - z)); elseif (y <= 1.7e+207) tmp = x + y; else tmp = y * ((z - t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.2e+72], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+207], N[(x + y), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+72}:\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+207}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if y < -1.20000000000000005e72Initial program 99.8%
+-commutative99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 99.7%
associate--l+99.7%
div-sub99.7%
Simplified99.7%
Taylor expanded in x around 0 79.8%
div-sub79.8%
Simplified79.8%
Taylor expanded in t around inf 36.2%
associate-*r/50.3%
mul-1-neg50.3%
distribute-lft-neg-out50.3%
*-commutative50.3%
*-lft-identity50.3%
times-frac68.7%
/-rgt-identity68.7%
distribute-neg-frac68.7%
distribute-neg-frac268.7%
neg-sub068.7%
sub-neg68.7%
+-commutative68.7%
associate--r+68.7%
neg-sub068.7%
remove-double-neg68.7%
Simplified50.3%
if -1.20000000000000005e72 < y < 1.6999999999999999e207Initial program 98.5%
+-commutative98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in z around inf 71.0%
+-commutative71.0%
Simplified71.0%
if 1.6999999999999999e207 < y Initial program 99.8%
+-commutative99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 99.8%
associate--l+99.8%
div-sub99.8%
Simplified99.8%
Taylor expanded in x around 0 82.2%
div-sub82.2%
Simplified82.2%
Taylor expanded in a around 0 61.2%
Final simplification66.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.8e+46) x (if (<= a 3.7e+98) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.8e+46) {
tmp = x;
} else if (a <= 3.7e+98) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-6.8d+46)) then
tmp = x
else if (a <= 3.7d+98) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.8e+46) {
tmp = x;
} else if (a <= 3.7e+98) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.8e+46: tmp = x elif a <= 3.7e+98: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.8e+46) tmp = x; elseif (a <= 3.7e+98) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6.8e+46) tmp = x; elseif (a <= 3.7e+98) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.8e+46], x, If[LessEqual[a, 3.7e+98], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{+46}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.7 \cdot 10^{+98}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -6.7999999999999996e46 or 3.6999999999999999e98 < a Initial program 98.9%
+-commutative98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in y around 0 64.3%
if -6.7999999999999996e46 < a < 3.6999999999999999e98Initial program 98.8%
+-commutative98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in z around inf 65.7%
+-commutative65.7%
Simplified65.7%
Final simplification65.2%
(FPCore (x y z t a) :precision binary64 (if (<= x -6.2e-270) x (if (<= x 1.2e-145) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6.2e-270) {
tmp = x;
} else if (x <= 1.2e-145) {
tmp = y;
} 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 (x <= (-6.2d-270)) then
tmp = x
else if (x <= 1.2d-145) then
tmp = y
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 (x <= -6.2e-270) {
tmp = x;
} else if (x <= 1.2e-145) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -6.2e-270: tmp = x elif x <= 1.2e-145: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -6.2e-270) tmp = x; elseif (x <= 1.2e-145) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -6.2e-270) tmp = x; elseif (x <= 1.2e-145) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -6.2e-270], x, If[LessEqual[x, 1.2e-145], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{-270}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-145}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.2e-270 or 1.20000000000000008e-145 < x Initial program 99.0%
+-commutative99.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in y around 0 63.5%
if -6.2e-270 < x < 1.20000000000000008e-145Initial program 97.6%
+-commutative97.6%
fma-define97.6%
Simplified97.6%
Taylor expanded in y around inf 97.5%
associate--l+97.5%
div-sub97.5%
Simplified97.5%
Taylor expanded in x around 0 91.9%
div-sub91.9%
Simplified91.9%
Taylor expanded in z around inf 36.0%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.8%
(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 98.8%
+-commutative98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in y around 0 54.6%
(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(y / Float64(Float64(z - a) / Float64(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[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024170
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (* y (/ (- z t) (- z a)))))