
(FPCore (x y z t) :precision binary64 (+ x (* (- y x) (/ z t))))
double code(double x, double y, double z, double t) {
return x + ((y - x) * (z / t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - x) * (z / t))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - x) * (z / t));
}
def code(x, y, z, t): return x + ((y - x) * (z / t))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - x) * Float64(z / t))) end
function tmp = code(x, y, z, t) tmp = x + ((y - x) * (z / t)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \frac{z}{t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y x) (/ z t))))
double code(double x, double y, double z, double t) {
return x + ((y - x) * (z / t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - x) * (z / t))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - x) * (z / t));
}
def code(x, y, z, t): return x + ((y - x) * (z / t))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - x) * Float64(z / t))) end
function tmp = code(x, y, z, t) tmp = x + ((y - x) * (z / t)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \frac{z}{t}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* z (- y x)) t)))
(if (<= (/ z t) -2e+243)
t_1
(if (<= (/ z t) 1e+234) (+ x (/ (- y x) (/ t z))) (+ x t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (z * (y - x)) / t;
double tmp;
if ((z / t) <= -2e+243) {
tmp = t_1;
} else if ((z / t) <= 1e+234) {
tmp = x + ((y - x) / (t / z));
} else {
tmp = x + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (z * (y - x)) / t
if ((z / t) <= (-2d+243)) then
tmp = t_1
else if ((z / t) <= 1d+234) then
tmp = x + ((y - x) / (t / z))
else
tmp = x + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * (y - x)) / t;
double tmp;
if ((z / t) <= -2e+243) {
tmp = t_1;
} else if ((z / t) <= 1e+234) {
tmp = x + ((y - x) / (t / z));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * (y - x)) / t tmp = 0 if (z / t) <= -2e+243: tmp = t_1 elif (z / t) <= 1e+234: tmp = x + ((y - x) / (t / z)) else: tmp = x + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * Float64(y - x)) / t) tmp = 0.0 if (Float64(z / t) <= -2e+243) tmp = t_1; elseif (Float64(z / t) <= 1e+234) tmp = Float64(x + Float64(Float64(y - x) / Float64(t / z))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * (y - x)) / t; tmp = 0.0; if ((z / t) <= -2e+243) tmp = t_1; elseif ((z / t) <= 1e+234) tmp = x + ((y - x) / (t / z)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[N[(z / t), $MachinePrecision], -2e+243], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], 1e+234], N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(y - x\right)}{t}\\
\mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+243}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{z}{t} \leq 10^{+234}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 z t) < -2.0000000000000001e243Initial program 80.6%
Taylor expanded in z around inf 83.1%
*-commutative83.1%
sub-div99.7%
associate-*l/99.9%
Applied egg-rr99.9%
if -2.0000000000000001e243 < (/.f64 z t) < 1.00000000000000002e234Initial program 99.4%
clear-num99.3%
un-div-inv99.4%
Applied egg-rr99.4%
if 1.00000000000000002e234 < (/.f64 z t) Initial program 77.6%
associate-*r/99.9%
Applied egg-rr99.9%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ z t) y)) (t_2 (* (/ z t) (- x))))
(if (<= (/ z t) -5e+77)
t_1
(if (<= (/ z t) -4e+32)
t_2
(if (<= (/ z t) -2e-22)
t_1
(if (<= (/ z t) 2e-18)
x
(if (<= (/ z t) 1e+47)
t_1
(if (<= (/ z t) 5e+258) t_2 (/ (* z y) t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (z / t) * y;
double t_2 = (z / t) * -x;
double tmp;
if ((z / t) <= -5e+77) {
tmp = t_1;
} else if ((z / t) <= -4e+32) {
tmp = t_2;
} else if ((z / t) <= -2e-22) {
tmp = t_1;
} else if ((z / t) <= 2e-18) {
tmp = x;
} else if ((z / t) <= 1e+47) {
tmp = t_1;
} else if ((z / t) <= 5e+258) {
tmp = t_2;
} else {
tmp = (z * y) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z / t) * y
t_2 = (z / t) * -x
if ((z / t) <= (-5d+77)) then
tmp = t_1
else if ((z / t) <= (-4d+32)) then
tmp = t_2
else if ((z / t) <= (-2d-22)) then
tmp = t_1
else if ((z / t) <= 2d-18) then
tmp = x
else if ((z / t) <= 1d+47) then
tmp = t_1
else if ((z / t) <= 5d+258) then
tmp = t_2
else
tmp = (z * y) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z / t) * y;
double t_2 = (z / t) * -x;
double tmp;
if ((z / t) <= -5e+77) {
tmp = t_1;
} else if ((z / t) <= -4e+32) {
tmp = t_2;
} else if ((z / t) <= -2e-22) {
tmp = t_1;
} else if ((z / t) <= 2e-18) {
tmp = x;
} else if ((z / t) <= 1e+47) {
tmp = t_1;
} else if ((z / t) <= 5e+258) {
tmp = t_2;
} else {
tmp = (z * y) / t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / t) * y t_2 = (z / t) * -x tmp = 0 if (z / t) <= -5e+77: tmp = t_1 elif (z / t) <= -4e+32: tmp = t_2 elif (z / t) <= -2e-22: tmp = t_1 elif (z / t) <= 2e-18: tmp = x elif (z / t) <= 1e+47: tmp = t_1 elif (z / t) <= 5e+258: tmp = t_2 else: tmp = (z * y) / t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z / t) * y) t_2 = Float64(Float64(z / t) * Float64(-x)) tmp = 0.0 if (Float64(z / t) <= -5e+77) tmp = t_1; elseif (Float64(z / t) <= -4e+32) tmp = t_2; elseif (Float64(z / t) <= -2e-22) tmp = t_1; elseif (Float64(z / t) <= 2e-18) tmp = x; elseif (Float64(z / t) <= 1e+47) tmp = t_1; elseif (Float64(z / t) <= 5e+258) tmp = t_2; else tmp = Float64(Float64(z * y) / t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z / t) * y; t_2 = (z / t) * -x; tmp = 0.0; if ((z / t) <= -5e+77) tmp = t_1; elseif ((z / t) <= -4e+32) tmp = t_2; elseif ((z / t) <= -2e-22) tmp = t_1; elseif ((z / t) <= 2e-18) tmp = x; elseif ((z / t) <= 1e+47) tmp = t_1; elseif ((z / t) <= 5e+258) tmp = t_2; else tmp = (z * y) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z / t), $MachinePrecision] * (-x)), $MachinePrecision]}, If[LessEqual[N[(z / t), $MachinePrecision], -5e+77], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], -4e+32], t$95$2, If[LessEqual[N[(z / t), $MachinePrecision], -2e-22], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], 2e-18], x, If[LessEqual[N[(z / t), $MachinePrecision], 1e+47], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], 5e+258], t$95$2, N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{t} \cdot y\\
t_2 := \frac{z}{t} \cdot \left(-x\right)\\
\mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{z}{t} \leq -4 \cdot 10^{+32}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{z}{t} \leq -2 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{elif}\;\frac{z}{t} \leq 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+258}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\end{array}
\end{array}
if (/.f64 z t) < -5.00000000000000004e77 or -4.00000000000000021e32 < (/.f64 z t) < -2.0000000000000001e-22 or 2.0000000000000001e-18 < (/.f64 z t) < 1e47Initial program 93.3%
Taylor expanded in z around inf 78.9%
Taylor expanded in y around inf 58.3%
associate-/l*64.9%
Simplified64.9%
if -5.00000000000000004e77 < (/.f64 z t) < -4.00000000000000021e32 or 1e47 < (/.f64 z t) < 5e258Initial program 99.7%
Taylor expanded in z around inf 91.8%
Taylor expanded in y around 0 66.1%
mul-1-neg66.1%
associate-*r/72.3%
distribute-lft-neg-out72.3%
*-commutative72.3%
Simplified72.3%
if -2.0000000000000001e-22 < (/.f64 z t) < 2.0000000000000001e-18Initial program 99.1%
Taylor expanded in z around 0 82.6%
if 5e258 < (/.f64 z t) Initial program 74.6%
Taylor expanded in z around inf 96.3%
Taylor expanded in y around inf 65.6%
Final simplification73.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ z t) y)) (t_2 (* z (/ (- x) t))))
(if (<= (/ z t) -5e+83)
t_1
(if (<= (/ z t) -4e+32)
t_2
(if (<= (/ z t) -2e-22)
t_1
(if (<= (/ z t) 2e-18)
x
(if (<= (/ z t) 1e+47)
t_1
(if (<= (/ z t) 5e+258) t_2 (/ (* z y) t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (z / t) * y;
double t_2 = z * (-x / t);
double tmp;
if ((z / t) <= -5e+83) {
tmp = t_1;
} else if ((z / t) <= -4e+32) {
tmp = t_2;
} else if ((z / t) <= -2e-22) {
tmp = t_1;
} else if ((z / t) <= 2e-18) {
tmp = x;
} else if ((z / t) <= 1e+47) {
tmp = t_1;
} else if ((z / t) <= 5e+258) {
tmp = t_2;
} else {
tmp = (z * y) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z / t) * y
t_2 = z * (-x / t)
if ((z / t) <= (-5d+83)) then
tmp = t_1
else if ((z / t) <= (-4d+32)) then
tmp = t_2
else if ((z / t) <= (-2d-22)) then
tmp = t_1
else if ((z / t) <= 2d-18) then
tmp = x
else if ((z / t) <= 1d+47) then
tmp = t_1
else if ((z / t) <= 5d+258) then
tmp = t_2
else
tmp = (z * y) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z / t) * y;
double t_2 = z * (-x / t);
double tmp;
if ((z / t) <= -5e+83) {
tmp = t_1;
} else if ((z / t) <= -4e+32) {
tmp = t_2;
} else if ((z / t) <= -2e-22) {
tmp = t_1;
} else if ((z / t) <= 2e-18) {
tmp = x;
} else if ((z / t) <= 1e+47) {
tmp = t_1;
} else if ((z / t) <= 5e+258) {
tmp = t_2;
} else {
tmp = (z * y) / t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / t) * y t_2 = z * (-x / t) tmp = 0 if (z / t) <= -5e+83: tmp = t_1 elif (z / t) <= -4e+32: tmp = t_2 elif (z / t) <= -2e-22: tmp = t_1 elif (z / t) <= 2e-18: tmp = x elif (z / t) <= 1e+47: tmp = t_1 elif (z / t) <= 5e+258: tmp = t_2 else: tmp = (z * y) / t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z / t) * y) t_2 = Float64(z * Float64(Float64(-x) / t)) tmp = 0.0 if (Float64(z / t) <= -5e+83) tmp = t_1; elseif (Float64(z / t) <= -4e+32) tmp = t_2; elseif (Float64(z / t) <= -2e-22) tmp = t_1; elseif (Float64(z / t) <= 2e-18) tmp = x; elseif (Float64(z / t) <= 1e+47) tmp = t_1; elseif (Float64(z / t) <= 5e+258) tmp = t_2; else tmp = Float64(Float64(z * y) / t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z / t) * y; t_2 = z * (-x / t); tmp = 0.0; if ((z / t) <= -5e+83) tmp = t_1; elseif ((z / t) <= -4e+32) tmp = t_2; elseif ((z / t) <= -2e-22) tmp = t_1; elseif ((z / t) <= 2e-18) tmp = x; elseif ((z / t) <= 1e+47) tmp = t_1; elseif ((z / t) <= 5e+258) tmp = t_2; else tmp = (z * y) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[((-x) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z / t), $MachinePrecision], -5e+83], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], -4e+32], t$95$2, If[LessEqual[N[(z / t), $MachinePrecision], -2e-22], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], 2e-18], x, If[LessEqual[N[(z / t), $MachinePrecision], 1e+47], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], 5e+258], t$95$2, N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{t} \cdot y\\
t_2 := z \cdot \frac{-x}{t}\\
\mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{z}{t} \leq -4 \cdot 10^{+32}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{z}{t} \leq -2 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{elif}\;\frac{z}{t} \leq 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+258}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\end{array}
\end{array}
if (/.f64 z t) < -5.00000000000000029e83 or -4.00000000000000021e32 < (/.f64 z t) < -2.0000000000000001e-22 or 2.0000000000000001e-18 < (/.f64 z t) < 1e47Initial program 93.1%
Taylor expanded in z around inf 78.3%
Taylor expanded in y around inf 58.5%
associate-/l*65.3%
Simplified65.3%
if -5.00000000000000029e83 < (/.f64 z t) < -4.00000000000000021e32 or 1e47 < (/.f64 z t) < 5e258Initial program 99.7%
Taylor expanded in z around inf 92.2%
Taylor expanded in y around 0 65.5%
associate-*r/65.5%
associate-*r*65.5%
neg-mul-165.5%
*-commutative65.5%
associate-/l*67.0%
Simplified67.0%
if -2.0000000000000001e-22 < (/.f64 z t) < 2.0000000000000001e-18Initial program 99.1%
Taylor expanded in z around 0 82.6%
if 5e258 < (/.f64 z t) Initial program 74.6%
Taylor expanded in z around inf 96.3%
Taylor expanded in y around inf 65.6%
Final simplification73.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ z t) -5e+200) (not (<= (/ z t) 1e+234))) (/ (* z (- y x)) t) (+ x (* (/ z t) (- y x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z / t) <= -5e+200) || !((z / t) <= 1e+234)) {
tmp = (z * (y - x)) / t;
} else {
tmp = x + ((z / t) * (y - x));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((z / t) <= (-5d+200)) .or. (.not. ((z / t) <= 1d+234))) then
tmp = (z * (y - x)) / t
else
tmp = x + ((z / t) * (y - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z / t) <= -5e+200) || !((z / t) <= 1e+234)) {
tmp = (z * (y - x)) / t;
} else {
tmp = x + ((z / t) * (y - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z / t) <= -5e+200) or not ((z / t) <= 1e+234): tmp = (z * (y - x)) / t else: tmp = x + ((z / t) * (y - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z / t) <= -5e+200) || !(Float64(z / t) <= 1e+234)) tmp = Float64(Float64(z * Float64(y - x)) / t); else tmp = Float64(x + Float64(Float64(z / t) * Float64(y - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z / t) <= -5e+200) || ~(((z / t) <= 1e+234))) tmp = (z * (y - x)) / t; else tmp = x + ((z / t) * (y - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z / t), $MachinePrecision], -5e+200], N[Not[LessEqual[N[(z / t), $MachinePrecision], 1e+234]], $MachinePrecision]], N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(x + N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{+200} \lor \neg \left(\frac{z}{t} \leq 10^{+234}\right):\\
\;\;\;\;\frac{z \cdot \left(y - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{t} \cdot \left(y - x\right)\\
\end{array}
\end{array}
if (/.f64 z t) < -5.00000000000000019e200 or 1.00000000000000002e234 < (/.f64 z t) Initial program 81.1%
Taylor expanded in z around inf 91.9%
*-commutative91.9%
sub-div99.8%
associate-*l/99.9%
Applied egg-rr99.9%
if -5.00000000000000019e200 < (/.f64 z t) < 1.00000000000000002e234Initial program 99.3%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* z (- y x)) t)))
(if (<= (/ z t) -5e+200)
t_1
(if (<= (/ z t) 1e+234) (+ x (* (/ z t) (- y x))) (+ x t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (z * (y - x)) / t;
double tmp;
if ((z / t) <= -5e+200) {
tmp = t_1;
} else if ((z / t) <= 1e+234) {
tmp = x + ((z / t) * (y - x));
} else {
tmp = x + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (z * (y - x)) / t
if ((z / t) <= (-5d+200)) then
tmp = t_1
else if ((z / t) <= 1d+234) then
tmp = x + ((z / t) * (y - x))
else
tmp = x + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * (y - x)) / t;
double tmp;
if ((z / t) <= -5e+200) {
tmp = t_1;
} else if ((z / t) <= 1e+234) {
tmp = x + ((z / t) * (y - x));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * (y - x)) / t tmp = 0 if (z / t) <= -5e+200: tmp = t_1 elif (z / t) <= 1e+234: tmp = x + ((z / t) * (y - x)) else: tmp = x + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * Float64(y - x)) / t) tmp = 0.0 if (Float64(z / t) <= -5e+200) tmp = t_1; elseif (Float64(z / t) <= 1e+234) tmp = Float64(x + Float64(Float64(z / t) * Float64(y - x))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * (y - x)) / t; tmp = 0.0; if ((z / t) <= -5e+200) tmp = t_1; elseif ((z / t) <= 1e+234) tmp = x + ((z / t) * (y - x)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[N[(z / t), $MachinePrecision], -5e+200], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], 1e+234], N[(x + N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(y - x\right)}{t}\\
\mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{+200}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{z}{t} \leq 10^{+234}:\\
\;\;\;\;x + \frac{z}{t} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 z t) < -5.00000000000000019e200Initial program 84.9%
Taylor expanded in z around inf 86.8%
*-commutative86.8%
sub-div99.7%
associate-*l/99.8%
Applied egg-rr99.8%
if -5.00000000000000019e200 < (/.f64 z t) < 1.00000000000000002e234Initial program 99.3%
if 1.00000000000000002e234 < (/.f64 z t) Initial program 77.6%
associate-*r/99.9%
Applied egg-rr99.9%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ z t) -50000000000.0) (not (<= (/ z t) 200000000.0))) (* z (/ (- y x) t)) (+ x (* (/ z t) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z / t) <= -50000000000.0) || !((z / t) <= 200000000.0)) {
tmp = z * ((y - x) / t);
} else {
tmp = x + ((z / t) * y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((z / t) <= (-50000000000.0d0)) .or. (.not. ((z / t) <= 200000000.0d0))) then
tmp = z * ((y - x) / t)
else
tmp = x + ((z / t) * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z / t) <= -50000000000.0) || !((z / t) <= 200000000.0)) {
tmp = z * ((y - x) / t);
} else {
tmp = x + ((z / t) * y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z / t) <= -50000000000.0) or not ((z / t) <= 200000000.0): tmp = z * ((y - x) / t) else: tmp = x + ((z / t) * y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z / t) <= -50000000000.0) || !(Float64(z / t) <= 200000000.0)) tmp = Float64(z * Float64(Float64(y - x) / t)); else tmp = Float64(x + Float64(Float64(z / t) * y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z / t) <= -50000000000.0) || ~(((z / t) <= 200000000.0))) tmp = z * ((y - x) / t); else tmp = x + ((z / t) * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z / t), $MachinePrecision], -50000000000.0], N[Not[LessEqual[N[(z / t), $MachinePrecision], 200000000.0]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -50000000000 \lor \neg \left(\frac{z}{t} \leq 200000000\right):\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{t} \cdot y\\
\end{array}
\end{array}
if (/.f64 z t) < -5e10 or 2e8 < (/.f64 z t) Initial program 90.5%
Taylor expanded in z around inf 87.6%
Taylor expanded in y around 0 88.0%
mul-1-neg88.0%
associate-*r/76.7%
distribute-lft-neg-out76.7%
associate-/l*78.7%
distribute-rgt-out90.1%
+-commutative90.1%
sub-neg90.1%
*-commutative90.1%
associate-/l*95.7%
associate-*l/92.3%
*-commutative92.3%
Simplified92.3%
if -5e10 < (/.f64 z t) < 2e8Initial program 99.2%
Taylor expanded in y around inf 94.2%
associate-*r/98.7%
Simplified98.7%
Final simplification95.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ z t) -2e-22) (not (<= (/ z t) 2e-18))) (* z (/ (- y x) t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if (((z / t) <= -2e-22) || !((z / t) <= 2e-18)) {
tmp = z * ((y - x) / t);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((z / t) <= (-2d-22)) .or. (.not. ((z / t) <= 2d-18))) then
tmp = z * ((y - x) / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z / t) <= -2e-22) || !((z / t) <= 2e-18)) {
tmp = z * ((y - x) / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z / t) <= -2e-22) or not ((z / t) <= 2e-18): tmp = z * ((y - x) / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z / t) <= -2e-22) || !(Float64(z / t) <= 2e-18)) tmp = Float64(z * Float64(Float64(y - x) / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z / t) <= -2e-22) || ~(((z / t) <= 2e-18))) tmp = z * ((y - x) / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z / t), $MachinePrecision], -2e-22], N[Not[LessEqual[N[(z / t), $MachinePrecision], 2e-18]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{-22} \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-18}\right):\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (/.f64 z t) < -2.0000000000000001e-22 or 2.0000000000000001e-18 < (/.f64 z t) Initial program 91.5%
Taylor expanded in z around inf 86.4%
Taylor expanded in y around 0 85.5%
mul-1-neg85.5%
associate-*r/75.5%
distribute-lft-neg-out75.5%
associate-/l*79.8%
distribute-rgt-out89.9%
+-commutative89.9%
sub-neg89.9%
*-commutative89.9%
associate-/l*92.3%
associate-*l/90.6%
*-commutative90.6%
Simplified90.6%
if -2.0000000000000001e-22 < (/.f64 z t) < 2.0000000000000001e-18Initial program 99.1%
Taylor expanded in z around 0 82.6%
Final simplification87.2%
(FPCore (x y z t) :precision binary64 (if (<= (/ z t) -50000000000.0) (* z (/ (- y x) t)) (if (<= (/ z t) 200000000.0) (+ x (* (/ z t) y)) (/ (* z (- y x)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z / t) <= -50000000000.0) {
tmp = z * ((y - x) / t);
} else if ((z / t) <= 200000000.0) {
tmp = x + ((z / t) * y);
} else {
tmp = (z * (y - x)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z / t) <= (-50000000000.0d0)) then
tmp = z * ((y - x) / t)
else if ((z / t) <= 200000000.0d0) then
tmp = x + ((z / t) * y)
else
tmp = (z * (y - x)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z / t) <= -50000000000.0) {
tmp = z * ((y - x) / t);
} else if ((z / t) <= 200000000.0) {
tmp = x + ((z / t) * y);
} else {
tmp = (z * (y - x)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z / t) <= -50000000000.0: tmp = z * ((y - x) / t) elif (z / t) <= 200000000.0: tmp = x + ((z / t) * y) else: tmp = (z * (y - x)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z / t) <= -50000000000.0) tmp = Float64(z * Float64(Float64(y - x) / t)); elseif (Float64(z / t) <= 200000000.0) tmp = Float64(x + Float64(Float64(z / t) * y)); else tmp = Float64(Float64(z * Float64(y - x)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z / t) <= -50000000000.0) tmp = z * ((y - x) / t); elseif ((z / t) <= 200000000.0) tmp = x + ((z / t) * y); else tmp = (z * (y - x)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -50000000000.0], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 200000000.0], N[(x + N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -50000000000:\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\mathbf{elif}\;\frac{z}{t} \leq 200000000:\\
\;\;\;\;x + \frac{z}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(y - x\right)}{t}\\
\end{array}
\end{array}
if (/.f64 z t) < -5e10Initial program 92.3%
Taylor expanded in z around inf 87.0%
Taylor expanded in y around 0 85.3%
mul-1-neg85.3%
associate-*r/76.0%
distribute-lft-neg-out76.0%
associate-/l*79.0%
distribute-rgt-out92.1%
+-commutative92.1%
sub-neg92.1%
*-commutative92.1%
associate-/l*95.0%
associate-*l/95.2%
*-commutative95.2%
Simplified95.2%
if -5e10 < (/.f64 z t) < 2e8Initial program 99.2%
Taylor expanded in y around inf 94.2%
associate-*r/98.7%
Simplified98.7%
if 2e8 < (/.f64 z t) Initial program 88.9%
Taylor expanded in z around inf 88.1%
*-commutative88.1%
sub-div89.6%
associate-*l/96.3%
Applied egg-rr96.3%
Final simplification97.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ z t) -2.4e-22) (not (<= (/ z t) 8.4e-18))) (* (/ z t) y) x))
double code(double x, double y, double z, double t) {
double tmp;
if (((z / t) <= -2.4e-22) || !((z / t) <= 8.4e-18)) {
tmp = (z / t) * y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((z / t) <= (-2.4d-22)) .or. (.not. ((z / t) <= 8.4d-18))) then
tmp = (z / t) * y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z / t) <= -2.4e-22) || !((z / t) <= 8.4e-18)) {
tmp = (z / t) * y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z / t) <= -2.4e-22) or not ((z / t) <= 8.4e-18): tmp = (z / t) * y else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z / t) <= -2.4e-22) || !(Float64(z / t) <= 8.4e-18)) tmp = Float64(Float64(z / t) * y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z / t) <= -2.4e-22) || ~(((z / t) <= 8.4e-18))) tmp = (z / t) * y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z / t), $MachinePrecision], -2.4e-22], N[Not[LessEqual[N[(z / t), $MachinePrecision], 8.4e-18]], $MachinePrecision]], N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -2.4 \cdot 10^{-22} \lor \neg \left(\frac{z}{t} \leq 8.4 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{z}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (/.f64 z t) < -2.40000000000000002e-22 or 8.39999999999999998e-18 < (/.f64 z t) Initial program 91.5%
Taylor expanded in z around inf 86.4%
Taylor expanded in y around inf 51.0%
associate-/l*53.0%
Simplified53.0%
if -2.40000000000000002e-22 < (/.f64 z t) < 8.39999999999999998e-18Initial program 99.1%
Taylor expanded in z around 0 82.6%
Final simplification65.8%
(FPCore (x y z t) :precision binary64 (if (<= (/ z t) -2e-22) (* (/ z t) y) (if (<= (/ z t) 2e-18) x (/ (* z y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z / t) <= -2e-22) {
tmp = (z / t) * y;
} else if ((z / t) <= 2e-18) {
tmp = x;
} else {
tmp = (z * y) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z / t) <= (-2d-22)) then
tmp = (z / t) * y
else if ((z / t) <= 2d-18) then
tmp = x
else
tmp = (z * y) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z / t) <= -2e-22) {
tmp = (z / t) * y;
} else if ((z / t) <= 2e-18) {
tmp = x;
} else {
tmp = (z * y) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z / t) <= -2e-22: tmp = (z / t) * y elif (z / t) <= 2e-18: tmp = x else: tmp = (z * y) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z / t) <= -2e-22) tmp = Float64(Float64(z / t) * y); elseif (Float64(z / t) <= 2e-18) tmp = x; else tmp = Float64(Float64(z * y) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z / t) <= -2e-22) tmp = (z / t) * y; elseif ((z / t) <= 2e-18) tmp = x; else tmp = (z * y) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -2e-22], N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 2e-18], x, N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{-22}:\\
\;\;\;\;\frac{z}{t} \cdot y\\
\mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\end{array}
\end{array}
if (/.f64 z t) < -2.0000000000000001e-22Initial program 93.2%
Taylor expanded in z around inf 83.5%
Taylor expanded in y around inf 48.0%
associate-/l*56.1%
Simplified56.1%
if -2.0000000000000001e-22 < (/.f64 z t) < 2.0000000000000001e-18Initial program 99.1%
Taylor expanded in z around 0 82.6%
if 2.0000000000000001e-18 < (/.f64 z t) Initial program 89.9%
Taylor expanded in z around inf 89.1%
Taylor expanded in y around inf 53.9%
Final simplification66.8%
(FPCore (x y z t) :precision binary64 (if (<= (/ z t) -2e-22) (* (/ z t) y) (if (<= (/ z t) 2e-18) x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z / t) <= -2e-22) {
tmp = (z / t) * y;
} else if ((z / t) <= 2e-18) {
tmp = x;
} else {
tmp = z * (y / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z / t) <= (-2d-22)) then
tmp = (z / t) * y
else if ((z / t) <= 2d-18) then
tmp = x
else
tmp = z * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z / t) <= -2e-22) {
tmp = (z / t) * y;
} else if ((z / t) <= 2e-18) {
tmp = x;
} else {
tmp = z * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z / t) <= -2e-22: tmp = (z / t) * y elif (z / t) <= 2e-18: tmp = x else: tmp = z * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z / t) <= -2e-22) tmp = Float64(Float64(z / t) * y); elseif (Float64(z / t) <= 2e-18) tmp = x; else tmp = Float64(z * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z / t) <= -2e-22) tmp = (z / t) * y; elseif ((z / t) <= 2e-18) tmp = x; else tmp = z * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -2e-22], N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 2e-18], x, N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{-22}:\\
\;\;\;\;\frac{z}{t} \cdot y\\
\mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if (/.f64 z t) < -2.0000000000000001e-22Initial program 93.2%
Taylor expanded in z around inf 83.5%
Taylor expanded in y around inf 48.0%
associate-/l*56.1%
Simplified56.1%
if -2.0000000000000001e-22 < (/.f64 z t) < 2.0000000000000001e-18Initial program 99.1%
Taylor expanded in z around 0 82.6%
if 2.0000000000000001e-18 < (/.f64 z t) Initial program 89.9%
Taylor expanded in z around inf 89.1%
Taylor expanded in y around inf 53.9%
associate-*l/50.3%
*-commutative50.3%
Simplified50.3%
Final simplification65.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.8e-199) (not (<= x 9.5e-164))) (* x (- 1.0 (/ z t))) (* z (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e-199) || !(x <= 9.5e-164)) {
tmp = x * (1.0 - (z / t));
} else {
tmp = z * (y / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-2.8d-199)) .or. (.not. (x <= 9.5d-164))) then
tmp = x * (1.0d0 - (z / t))
else
tmp = z * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e-199) || !(x <= 9.5e-164)) {
tmp = x * (1.0 - (z / t));
} else {
tmp = z * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.8e-199) or not (x <= 9.5e-164): tmp = x * (1.0 - (z / t)) else: tmp = z * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.8e-199) || !(x <= 9.5e-164)) tmp = Float64(x * Float64(1.0 - Float64(z / t))); else tmp = Float64(z * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.8e-199) || ~((x <= 9.5e-164))) tmp = x * (1.0 - (z / t)); else tmp = z * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.8e-199], N[Not[LessEqual[x, 9.5e-164]], $MachinePrecision]], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-199} \lor \neg \left(x \leq 9.5 \cdot 10^{-164}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if x < -2.80000000000000018e-199 or 9.5000000000000001e-164 < x Initial program 96.3%
Taylor expanded in x around inf 75.0%
mul-1-neg75.0%
unsub-neg75.0%
Simplified75.0%
if -2.80000000000000018e-199 < x < 9.5000000000000001e-164Initial program 89.4%
Taylor expanded in z around inf 88.2%
Taylor expanded in y around inf 71.7%
associate-*l/76.5%
*-commutative76.5%
Simplified76.5%
Final simplification75.3%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 94.8%
Taylor expanded in z around 0 37.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y x) (/ z t))) (t_2 (+ x (/ (- y x) (/ t z)))))
(if (< t_1 -1013646692435.8867)
t_2
(if (< t_1 0.0) (+ x (/ (* (- y x) z) t)) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = (y - x) * (z / t);
double t_2 = x + ((y - x) / (t / z));
double tmp;
if (t_1 < -1013646692435.8867) {
tmp = t_2;
} else if (t_1 < 0.0) {
tmp = x + (((y - x) * z) / t);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y - x) * (z / t)
t_2 = x + ((y - x) / (t / z))
if (t_1 < (-1013646692435.8867d0)) then
tmp = t_2
else if (t_1 < 0.0d0) then
tmp = x + (((y - x) * z) / t)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - x) * (z / t);
double t_2 = x + ((y - x) / (t / z));
double tmp;
if (t_1 < -1013646692435.8867) {
tmp = t_2;
} else if (t_1 < 0.0) {
tmp = x + (((y - x) * z) / t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - x) * (z / t) t_2 = x + ((y - x) / (t / z)) tmp = 0 if t_1 < -1013646692435.8867: tmp = t_2 elif t_1 < 0.0: tmp = x + (((y - x) * z) / t) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - x) * Float64(z / t)) t_2 = Float64(x + Float64(Float64(y - x) / Float64(t / z))) tmp = 0.0 if (t_1 < -1013646692435.8867) tmp = t_2; elseif (t_1 < 0.0) tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / t)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - x) * (z / t); t_2 = x + ((y - x) / (t / z)); tmp = 0.0; if (t_1 < -1013646692435.8867) tmp = t_2; elseif (t_1 < 0.0) tmp = x + (((y - x) * z) / t); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$1, -1013646692435.8867], t$95$2, If[Less[t$95$1, 0.0], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - x\right) \cdot \frac{z}{t}\\
t_2 := x + \frac{y - x}{\frac{t}{z}}\\
\mathbf{if}\;t\_1 < -1013646692435.8867:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 < 0:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024103
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"
:precision binary64
:alt
(if (< (* (- y x) (/ z t)) -1013646692435.8867) (+ x (/ (- y x) (/ t z))) (if (< (* (- y x) (/ z t)) 0.0) (+ x (/ (* (- y x) z) t)) (+ x (/ (- y x) (/ t z)))))
(+ x (* (- y x) (/ z t))))