Skip to content

Commit

Permalink
Fix reverse mode complex error function
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Feb 28, 2024
1 parent f7a46fd commit 8832978
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions enzyme/Enzyme/InstructionDerivatives.td
Original file line number Diff line number Diff line change
Expand Up @@ -655,30 +655,30 @@ def ToStruct2 : SubRoutine<(Op (Op $re, $im):$z),
def : CallPattern<(Op $x, $tbd),
["Faddeeva_erf"],
[
(ToStruct2 (CFMul (DiffeRet), (CFMul (ConstantCFP<"1.1283791670955125738961589031215451716881012586580","0"> $x), (CFExp (CFNeg (CFMul $x, $x)))))),
(ToStruct2 (Conj (CFMul (Conj (DiffeRet)), (CFMul (ConstantCFP<"1.1283791670955125738961589031215451716881012586580","0"> $x), (CFExp (CFNeg (CFMul $x, $x))))))),
(InactiveArg) // relerr
],
(ForwardFromSummedReverse),
(ToStruct2 (CFMul (Shadow $x), (CFMul (ConstantCFP<"1.1283791670955125738961589031215451716881012586580","0"> $x), (CFExp (CFNeg (CFMul $x, $x)))))),
[ReadNone, NoUnwind]
>;

def : CallPattern<(Op $x, $tbd),
["Faddeeva_erfi"],
[
(ToStruct2 (CFMul (DiffeRet), (CFMul (ConstantCFP<"1.1283791670955125738961589031215451716881012586580","0"> $x), (CFExp (CFMul $x, $x))))),
(ToStruct2 (Conj (CFMul (Conj (DiffeRet)), (CFMul (ConstantCFP<"1.1283791670955125738961589031215451716881012586580","0"> $x), (CFExp (CFMul $x, $x)))))),
(InactiveArg) // relerr
],
(ForwardFromSummedReverse),
(ToStruct2 (CFMul (Shadow $x), (CFMul (ConstantCFP<"1.1283791670955125738961589031215451716881012586580","0"> $x), (CFExp (CFMul $x, $x))))),
[ReadNone, NoUnwind]
>;

def : CallPattern<(Op $x, $tbd),
["Faddeeva_erfc"],
[
(ToStruct2 (CFMul (DiffeRet), (CFMul (ConstantCFP<"-1.1283791670955125738961589031215451716881012586580","0"> $x), (CFExp (CFNeg (CFMul $x, $x)))))),
(ToStruct2 (Conj (CFMul (Conj (DiffeRet)), (CFMul (ConstantCFP<"-1.1283791670955125738961589031215451716881012586580","0"> $x), (CFExp (CFNeg (CFMul $x, $x))))))),
(InactiveArg) // relerr
],
(ForwardFromSummedReverse),
(ToStruct2 (CFMul (Shadow $x), (CFMul (ConstantCFP<"-1.1283791670955125738961589031215451716881012586580","0"> $x), (CFExp (CFNeg (CFMul $x, $x)))))),
[ReadNone, NoUnwind]
>;

Expand Down

0 comments on commit 8832978

Please sign in to comment.